gozero template (#147)
* model/rpc generate code from template cache * delete unused(deprecated) code * support template init|update|clean|revert * model: return the execute result for insert and update operation * // deprecated: containsAny * add template test * add default buildVersion * update build version
This commit is contained in:
@@ -14,8 +14,13 @@ func genVars(table Table, withCache bool) (string, error) {
|
||||
keys = append(keys, v.VarExpression)
|
||||
}
|
||||
camel := table.Name.ToCamel()
|
||||
text, err := util.LoadTemplate(category, varTemplateFile, template.Vars)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
output, err := util.With("var").
|
||||
Parse(template.Vars).
|
||||
Parse(text).
|
||||
GoFmt(true).
|
||||
Execute(map[string]interface{}{
|
||||
"lowerStartCamelObject": stringx.From(camel).UnTitle(),
|
||||
|
||||
Reference in New Issue
Block a user