This commit is contained in:
zhangdeman committed 2025-03-19 18:23:04 +08:00
1 parent 0efb8e0354
commit a40288f149
1 file changed
+2 -2
+2 -2
View File
@@ -76,7 +76,7 @@ func (h *handle) Run() ([]byte, error) {
continue
}
fieldName := wrapper.String(field.JsonTag).SnakeCaseToCamel()
// TODO : 支持嵌套结构体
fieldTag := h.generateTag(field)
h.dynamicStruct.AddField(fieldName, "", sourceValue, fieldTag, false)
}
@@ -85,7 +85,7 @@ func (h *handle) Run() ([]byte, error) {
return nil, err
}
if err := validatorInstance.Struct(val); nil != err {
return nil, GetValidateErr(val, err)
return nil, GetValidateErr(val, err, TagErrMsg)
}
targetByte, _ := json.Marshal(val)
return targetByte, nil
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.