Browse Source

修改bug

yjp 3 months ago
parent
commit
c19fb9a2f5
2 changed files with 2 additions and 2 deletions
  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相关字段
 // UserIDFields 用户ID相关字段
 type UserIDFields struct {
 type UserIDFields struct {
 	CreateUserID     string `sqlmapping:"column:create_user_id;" sqlresult:"column:create_user_id;" check:"required,len=32,when=create"`
 	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"`
 	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 {
 			if !find {
-				logger.GetInstance().Error(errors.New("使用的when不存在"))
+				logger.GetInstance().Info("使用的when不存在: when %v, whens %v\n", when, whens)
 				continue
 				continue
 			}
 			}
 		}
 		}