sensitive的新增和修改方法
This commit is contained in:
@@ -362,7 +362,10 @@ func (c *SkuController) GetSensitiveWordList() {
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /InsertSensitiveWord [post]
|
||||
func (c *SkuController) InsertSensitiveWord() {
|
||||
|
||||
c.callInsertSensitiveWord(func(params *tSkuInsertSensitiveWordParams) (retVal interface{}, errCode string, err error) {
|
||||
err = dao.InsertSensitiveWord(params.Word, params.VendorID, params.Ctx.GetUserName())
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 修改敏感词列表
|
||||
@@ -370,12 +373,24 @@ func (c *SkuController) InsertSensitiveWord() {
|
||||
// @Param token header string true "认证token"
|
||||
// @Param word query string true "关键词名字"
|
||||
// @Param vendorID query int false "VendorID"
|
||||
// @Param ID query int true "关键词ID"
|
||||
// @Param Status query int false "状态,0为修改默认,1为删除"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /UpdateSensitiveWord [put]
|
||||
func (c *SkuController) UpdateSensitiveWord() {
|
||||
|
||||
c.callUpdateSensitiveWord(func(params *tSkuUpdateSensitiveWordParams) (retVal interface{}, errCode string, err error) {
|
||||
word := &model.SensitiveWord{
|
||||
VendorID: params.VendorID,
|
||||
Word: params.Word,
|
||||
}
|
||||
if params.Status == 1 {
|
||||
retVal, err = dao.DeleteSensitiveWord(word, params.VendorID, params.Ctx.GetUserName())
|
||||
} else {
|
||||
retVal, err = dao.UpdateSensitiveWord(word, params.VendorID, params.Ctx.GetUserName(), "id", "word", "vendor_id", "last_operator")
|
||||
}
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 子分类下商品的重排序
|
||||
|
||||
Reference in New Issue
Block a user