Ver Fonte

修改bug

yjp há 3 meses atrás
pai
commit
c19fb9a2f5

+ 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
 			}
 		}