mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-10 08:29:58 +08:00
feat: goctl model Add a new method hasField (#5484)
This commit is contained in:
@@ -360,6 +360,7 @@ func (g *defaultGenerator) genModelCustom(in parser.Table, withCache bool) (stri
|
||||
|
||||
t := util.With("model-custom").
|
||||
Parse(text).
|
||||
AddFunc("hasField", hasField(Table{Table: in})).
|
||||
GoFmt(true)
|
||||
output, err := t.Execute(map[string]any{
|
||||
"pkg": g.pkg,
|
||||
@@ -381,6 +382,7 @@ func (g *defaultGenerator) executeModel(table Table, code *code) (*bytes.Buffer,
|
||||
}
|
||||
t := util.With("model").
|
||||
Parse(text).
|
||||
AddFunc("hasField", hasField(table)).
|
||||
GoFmt(true)
|
||||
output, err := t.Execute(map[string]any{
|
||||
"pkg": g.pkg,
|
||||
|
||||
Reference in New Issue
Block a user