yjp 3 месяцев назад
Родитель
Сommit
c19fb9a2f5
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      framework/core/domain/entity/field.go
  2. 1 1
      framework/core/tag/check/validate.go

+ 1 - 1
framework/core/domain/entity/field.go

@@ -70,7 +70,7 @@ type TenantIDField struct {
 // UserIDFields 用户ID相关字段
 type UserIDFields struct {
 	CreateUserID     string `sqlmapping:"column:create_user_id;" sqlresult:"column:create_user_id;" check:"required,len=32,when=create"`
-	LastUpdateUserID string `sqlmapping:"column:last_update_user_id;" sqlresult:"column:last_update_user_id;" check:"required,len=32,when=create/update"`
+	LastUpdateUserID string `sqlmapping:"column:last_update_user_id;" sqlresult:"column:last_update_user_id;" check:"required,len=32,when=update"`
 	DeleteUserID     string `sqlmapping:"-" sqlresult:"-" check:"required,len=32,when=delete"`
 }
 

+ 1 - 1
framework/core/tag/check/validate.go

@@ -158,7 +158,7 @@ func (result Result) CheckFieldWhen(when string, check func(fieldName string) bo
 			}
 
 			if !find {
-				logger.GetInstance().Error(errors.New("使用的when不存在"))
+				logger.GetInstance().Info("使用的when不存在: when %v, whens %v\n", when, whens)
 				continue
 			}
 		}