数据类型枚举值适配
This commit is contained in:
@ -7,6 +7,8 @@
|
||||
// Date : 2024-04-29 10:51
|
||||
package define
|
||||
|
||||
import "git.zhangdeman.cn/zhangdeman/consts/enums"
|
||||
|
||||
// FieldRule 字段验证规则
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
@ -14,7 +16,7 @@ package define
|
||||
// Date : 10:52 2024/4/29
|
||||
type FieldRule struct {
|
||||
Path string `json:"path"` // 字段路径
|
||||
Type string `json:"type"` // 数据类型, 具体枚举值参见 git.zhangdeman.cn/zhangdeman/consts
|
||||
Type enums.DataType `json:"type"` // 数据类型, 具体枚举值参见 git.zhangdeman.cn/zhangdeman/consts
|
||||
DisableRewrite bool `json:"disable_rewrite"` // 验证完相关数据类型之后, 不要重新给字段赋值
|
||||
DefaultValue any `json:"default_value"` // 默认值, 统一以字符串传入, 会转为最终设置的类型
|
||||
IsRequired bool `json:"is_required"` // 是否必传
|
||||
@ -35,9 +37,9 @@ type FieldRule struct {
|
||||
//
|
||||
// Date : 10:58 2024/4/29
|
||||
type RequiredCondition struct {
|
||||
DependOnField string `json:"depend_on_field"` // 依赖数据源中的那一个字段
|
||||
DependOnFieldType string `json:"depend_on_field_type"` // 依赖数据源数据类型
|
||||
DependOnFieldStatus []string `json:"depend_on_field_status"` // 依赖数据状态 : NOT_FOUND / IS_NIL / IS_ZERO / IS_EMPTY / IS_FALSE
|
||||
DependOnField string `json:"depend_on_field"` // 依赖数据源中的那一个字段
|
||||
DependOnFieldType enums.DataType `json:"depend_on_field_type"` // 依赖数据源数据类型
|
||||
DependOnFieldStatus []string `json:"depend_on_field_status"` // 依赖数据状态 : NOT_FOUND / IS_NIL / IS_ZERO / IS_EMPTY / IS_FALSE
|
||||
}
|
||||
|
||||
// ValueLimit 取值的限制
|
||||
|
Reference in New Issue
Block a user