增加单元测试 + 修复BUG
This commit is contained in:
@ -21,6 +21,7 @@ type FieldRule struct {
|
||||
AllowEmpty bool `json:"allow_empty"` // 必传时空字符串是否合法
|
||||
AllowZero bool `json:"allow_zero"` // 必传数字, 0 是否合法
|
||||
AllowNil bool `json:"allow_nil"` // 必传时, nil值是否合法
|
||||
AutoTrimSpace bool `json:"auto_trim_space"` // 自动去除前后空格
|
||||
DisableAutoConvert bool `json:"disable_auto_convert"` // 禁用自动格式转换, 不禁用情况下, ["1","2","3"] 可以转换成 [1,2,3] , "12.34" 可以转换成 12.34
|
||||
RequiredConditionGroup [][]RequiredCondition `json:"required_condition_group"` // 满足何种条件,字段必传,不配置则为无差别必传, 组之间是或条件, 满足一组即命中, 组之内为与条件
|
||||
ValueLimit *ValueLimit `json:"value_limit"` // 数据值的限制
|
||||
@ -56,7 +57,6 @@ type ValueLimit struct {
|
||||
//
|
||||
// Date : 11:16 2024/4/29
|
||||
type StringValueLimit struct {
|
||||
AutoTrimSpace bool `json:"auto_trim_space"` // 自动去除前后空格
|
||||
IncludeSubStrList []string `json:"include_sub_str_list"` // 必须包含指定的子串
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user