修改UpdateSensitiveWord方法入参,ID成非必填,不选的话,默认只改vendorid=-2的
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
"time"
|
||||
@@ -32,13 +31,12 @@ func InsertSensitiveWord(word string, vendorID int, userName string) error {
|
||||
}
|
||||
|
||||
func DeleteSensitiveWord(wordList *model.SensitiveWord, id int, userName string, vendorID int) (word *model.SensitiveWord, err error) {
|
||||
if id == 0 {
|
||||
return nil, errors.New("入参错误,找不到相应ID")
|
||||
}
|
||||
if vendorID == 0 {
|
||||
vendorID = -2
|
||||
}
|
||||
wordList.ID = id
|
||||
if id != 0 {
|
||||
wordList.ID = id
|
||||
}
|
||||
wordList.VendorID = id
|
||||
wordList.DeletedAt = time.Now()
|
||||
wordList.LastOperator = userName
|
||||
@@ -49,13 +47,12 @@ func DeleteSensitiveWord(wordList *model.SensitiveWord, id int, userName string,
|
||||
}
|
||||
|
||||
func UpdateSensitiveWord(wordList *model.SensitiveWord, vendorID int, id int, userName string, params ...string) (word *model.SensitiveWord, err error) {
|
||||
if id == 0 {
|
||||
return nil, errors.New("入参错误,找不到相应ID")
|
||||
}
|
||||
if vendorID == 0 {
|
||||
vendorID = -2
|
||||
}
|
||||
wordList.ID = id
|
||||
if id != 0 {
|
||||
wordList.ID = id
|
||||
}
|
||||
wordList.VendorID = vendorID
|
||||
wordList.UpdatedAt = time.Now()
|
||||
wordList.LastOperator = userName
|
||||
|
||||
Reference in New Issue
Block a user