feat: goctl model Add a new method hasField (#5484)

This commit is contained in:
fyyang
2026-03-22 14:26:56 +08:00
committed by GitHub
parent 004995f06a
commit 9a6447ab5c
8 changed files with 193 additions and 11 deletions

View File

@@ -28,7 +28,7 @@ func genImports(table Table, withCache, timeImport bool) (string, error) {
return "", err
}
buffer, err := util.With("import").Parse(text).Execute(map[string]any{
buffer, err := util.With("import").Parse(text).AddFunc("hasField", hasField(table)).Execute(map[string]any{
"time": timeImport,
"containsPQ": table.ContainsPQ,
"data": table,