|
@@ -83,7 +83,7 @@ func CheckFieldsForUpdate(object Object, fieldMap map[string]string) error {
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
|
|
|
|
- if fieldValue.IsNil() {
|
|
|
|
|
|
+ if fieldValue.Kind() == reflect.Pointer && fieldValue.IsNil() {
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
|
|
|
|
@@ -115,8 +115,8 @@ func Check(object Object, fieldMap map[string]string) error {
|
|
// 返回值:
|
|
// 返回值:
|
|
// - 错误
|
|
// - 错误
|
|
func CheckField(object Object, fieldName string, fieldMap map[string]string) error {
|
|
func CheckField(object Object, fieldName string, fieldMap map[string]string) error {
|
|
- err := check.Struct(object, fieldMap).CheckFieldWhen("", func(fieldName string) bool {
|
|
|
|
- if fieldName == fieldName {
|
|
|
|
|
|
+ err := check.Struct(object, fieldMap).CheckFieldWhen("", func(fn string) bool {
|
|
|
|
+ if fieldName == fn {
|
|
return true
|
|
return true
|
|
}
|
|
}
|
|
|
|
|