增加 map[string]string 处理
This commit is contained in:
4
run.go
4
run.go
@ -160,7 +160,7 @@ func formatInputVal(val gjson.Result, rule *define.FieldRule) (any, error) {
|
||||
}
|
||||
} else {
|
||||
if inputValStr, ok := inputVal.(string); ok {
|
||||
if rule.AutoTrimSpace {
|
||||
if !rule.DisableAutoTrimSpace {
|
||||
// 自动去空格
|
||||
inputVal = strings.TrimSpace(inputValStr)
|
||||
} else {
|
||||
@ -234,6 +234,8 @@ func handleData(inputVal any, rule *define.FieldRule) (any, error) {
|
||||
return handleMapStringFloat(inputVal, rule)
|
||||
case consts.DataTypeMapStrAny: // 对象结构
|
||||
return handleMapStringAny(inputVal, rule)
|
||||
case consts.DataTypeMapStrStr: // 对象结构
|
||||
return handleMapStringString(inputVal, rule)
|
||||
case consts.DataTypeMapStrSlice: // map列表
|
||||
return handleMapStringSlice(inputVal, rule)
|
||||
case consts.DataTypeMapAnyAny: // 任意类型map
|
||||
|
Reference in New Issue
Block a user