feat: Support projectPkg template variables in config, handler, logic, main, and svc template files (#4939)

This commit is contained in:
geekeryy
2025-08-19 20:29:41 +08:00
committed by GitHub
parent 20d20ef861
commit 73d6fcfccd
11 changed files with 42 additions and 34 deletions

View File

@@ -29,7 +29,7 @@ const (
//go:embed config.tpl
var configTemplate string
func genConfig(dir string, cfg *config.Config, api *spec.ApiSpec) error {
func genConfig(dir, projectPkg string, cfg *config.Config, api *spec.ApiSpec) error {
filename, err := format.FileNamingFormat(cfg.NamingFormat, configFile)
if err != nil {
return err
@@ -60,6 +60,7 @@ func genConfig(dir string, cfg *config.Config, api *spec.ApiSpec) error {
"authImport": authImportStr,
"auth": strings.Join(auths, "\n"),
"jwtTrans": strings.Join(jwtTransList, "\n"),
"projectPkg": projectPkg,
},
})
}