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

@@ -61,7 +61,7 @@ func genUpdate(table Table, withCache, postgreSql bool) (
return "", "", err
}
output, err := util.With("update").Parse(text).Execute(
output, err := util.With("update").Parse(text).AddFunc("hasField", hasField(table)).Execute(
map[string]any{
"withCache": withCache,
"containsIndexCache": table.ContainsUniqueCacheKey,
@@ -94,7 +94,7 @@ func genUpdate(table Table, withCache, postgreSql bool) (
return "", "", err
}
updateMethodOutput, err := util.With("updateMethod").Parse(text).Execute(
updateMethodOutput, err := util.With("updateMethod").Parse(text).AddFunc("hasField", hasField(table)).Execute(
map[string]any{
"upperStartCamelObject": camelTableName,
"data": table,