mirror of
https://gitee.com/johng/gf
synced 2026-07-07 22:27:06 +08:00
fix(cmd/gf): fix gf gen dao with removeFieldPrefix (#4243)
Fixed: #4113 when use "removeFieldPrefix" config to generate entity, also delete prefix in json tag Co-authored-by: zhang <zhangtao@changxinsec.com> Co-authored-by: hailaz <739476267@qq.com>
This commit is contained in:
@ -98,7 +98,6 @@ func generateStructFieldDefinition(
|
||||
err error
|
||||
localTypeName gdb.LocalType
|
||||
localTypeNameStr string
|
||||
jsonTag = gstr.CaseConvert(field.Name, gstr.CaseTypeMatch(in.JsonCase))
|
||||
)
|
||||
|
||||
if in.TypeMapping != nil && len(in.TypeMapping) > 0 {
|
||||
@ -156,6 +155,8 @@ func generateStructFieldDefinition(
|
||||
" #" + formatFieldName(newFiledName, FieldNameCaseCamel),
|
||||
" #" + localTypeNameStr,
|
||||
}
|
||||
|
||||
jsonTag := gstr.CaseConvert(newFiledName, gstr.CaseTypeMatch(in.JsonCase))
|
||||
attrLines = append(attrLines, fmt.Sprintf(` #%sjson:"%s"`, tagKey, jsonTag))
|
||||
// orm tag
|
||||
if !in.IsDo {
|
||||
|
||||
Reference in New Issue
Block a user