use goctl template to generate all kinds of templates

This commit is contained in:
kevin
2020-10-19 23:13:18 +08:00
parent 85a815bea0
commit dfe6e88529
35 changed files with 152 additions and 104 deletions

View File

@@ -9,7 +9,6 @@ import (
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
"github.com/tal-tech/go-zero/tools/goctl/api/util"
"github.com/tal-tech/go-zero/tools/goctl/templatex"
ctlutil "github.com/tal-tech/go-zero/tools/goctl/util"
"github.com/tal-tech/go-zero/tools/goctl/vars"
)
@@ -94,7 +93,7 @@ func genLogicByRoute(dir string, group spec.Group, route spec.Route) error {
requestString = "req " + "types." + strings.Title(route.RequestType.Name)
}
text, err := templatex.LoadTemplate(category, logicTemplateFile, logicTemplate)
text, err := ctlutil.LoadTemplate(category, logicTemplateFile, logicTemplate)
if err != nil {
return err
}