add utils to pkg
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"reflect"
|
||||
|
||||
"github.com/go-playground/validator/v10"
|
||||
"pkg.local/utils"
|
||||
)
|
||||
|
||||
// ValidatorMessages 自定义错误消息
|
||||
@@ -53,7 +54,7 @@ func CopySameField(src interface{}, dst interface{}) {
|
||||
func ValidateStruct(obj IValidator) string {
|
||||
err := v.Struct(obj)
|
||||
if err == nil {
|
||||
return ""
|
||||
return utils.StringEmpty
|
||||
}
|
||||
|
||||
customMsg := obj.GetMessage()
|
||||
|
||||
Reference in New Issue
Block a user