优化字段表达式构建, 增加单元测试

This commit is contained in:
2025-01-24 16:40:29 +08:00
parent 44e6c5cdcf
commit 5fe0557d90
4 changed files with 62 additions and 9 deletions

View File

@ -19,6 +19,7 @@ var (
ErrValidatorRuleParamCntIsNotEven = errors.New("validate rule param count is not even")
ErrValidatorRuleGroupOrSimpleRuleAllEmpty = errors.New("validator rule group or simple rule all empty")
ErrValidatorRuleFieldIsEmpty = errors.New("field is empty")
)
// IsErr 是否指定类型Err

View File

@ -26,6 +26,6 @@ type FieldValidateGenerateConfig struct {
//
// Date : 11:27 2025/1/24
type GenerateRuleExpressConfig struct {
Rule *consts.ValidatorRule `json:"rule,omitempty"` // 条件配置
ParamList []any `json:"param_list,omitempty"` // 规则验证的参数列表
Rule consts.ValidatorRule `json:"rule,omitempty"` // 条件配置
ParamList []any `json:"param_list,omitempty"` // 规则验证的参数列表
}