优化验证规则表达式生成

This commit is contained in:
2025-01-24 11:36:45 +08:00
parent 064f5e2c5b
commit fcad833e88
3 changed files with 48 additions and 7 deletions

View File

@ -7,7 +7,10 @@
// Date : 2025-01-23 18:44
package abstract
import "git.zhangdeman.cn/zhangdeman/consts"
import (
"git.zhangdeman.cn/gateway/validator/v10/define"
"git.zhangdeman.cn/zhangdeman/consts"
)
// IValidateRuleGenerateFunc 生成校验规则的方法约束
//
@ -23,4 +26,11 @@ import "git.zhangdeman.cn/zhangdeman/consts"
// 返回值说明
// - express: 生成的表达式
// - err: 表达式生成过程中出现的异常
type IValidateRuleGenerateFunc func(validateRule consts.ValidatorRule, paramList ...any) (express string, err error)
type IValidateRuleGenerateFunc func(ruleConfig define.GenerateRuleExpressConfig) (express string, err error)
// IFieldValidateRuleGenerateFunc 字段验证规则生成方法
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 11:16 2025/1/24
type IFieldValidateRuleGenerateFunc func(validateRule consts.ValidatorRule, paramList ...any) (express string, err error)