增加验证规则表达式生成方法的约束

This commit is contained in:
白茶清欢 2025-01-23 18:51:56 +08:00
parent ae7bbe8584
commit 978e52089c
2 changed files with 30 additions and 0 deletions

4
go.mod
View File

@ -27,3 +27,7 @@ require (
github.com/tidwall/pretty v1.2.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
replace (
git.zhangdeman.cn/zhangdeman/consts => ../consts
)

View File

@ -0,0 +1,26 @@
// Package abstract ...
//
// Description : abstract ...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 2025-01-23 18:44
package abstract
import "git.zhangdeman.cn/zhangdeman/consts"
// IValidateRuleGenerateFunc 生成校验规则的方法约束
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 18:46 2025/1/23
//
// 参数说明
//
// - validateRule: 参数验证规则, 具体参见静态库声明
// - paramList: 验证规则需要的参数列表, 可以为空
//
// 返回值说明
// - express: 生成的表达式
// - err: 表达式生成过程中出现的异常
type IValidateRuleGenerateFunc func(validateRule consts.ValidatorRule, paramList ...any) (express string, err error)