增加json数据过滤能力

This commit is contained in:
2024-04-07 22:15:10 +08:00
parent df4a0a0a39
commit 657b9b21d8
6 changed files with 202 additions and 2 deletions

25
define/filter.go Normal file
View File

@ -0,0 +1,25 @@
// Package define ...
//
// Description : define ...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 2024-04-07 21:43
package define
import "git.zhangdeman.cn/zhangdeman/data_mask"
// FilterRule ...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 21:43 2024/4/7
type FilterRule struct {
SourceDataPath string `json:"source_data_path"` // 原始数据路径
TargetDataPath string `json:"target_data_path"` // 目标数据路径
IsRequired bool `json:"is_required"` // 要求字段必须存在
AllowNil bool `json:"allow_nil"` // 允许nil值
DefaultValue string `json:"default_value"` // 不存在时的默认值
Type string `json:"type"` // 数据类型
DataMask data_mask.IDataMask `json:"-"` // 数据脱敏策略
}