修复数据验证的BUG + 升级不同类型数据默认值的获取

This commit is contained in:
2025-03-21 18:48:05 +08:00
parent be6b8e644f
commit f42606bf68
4 changed files with 26 additions and 24 deletions

View File

@ -23,6 +23,7 @@ func TestRun_Simple_Data(t *testing.T) {
}
companyInfo := map[string]any{
"address": "beijing",
"name": "xxxx",
}
testMap := map[string]any{
@ -56,17 +57,12 @@ func TestRun_Simple_Data(t *testing.T) {
Required: false,
RuleList: []Rule{
{
Tag: "min",
Args: []string{"1"},
},
{
Tag: "max",
Args: []string{"20"},
Tag: "required",
},
},
DefaultValue: "",
SourcePath: "company.name",
TargetPath: "company.cname",
TargetPath: "company.company_name",
Errmsg: "公司名称必须在[1,20]之间",
},
{