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

@@ -65,17 +65,17 @@ func (m mono) createAPIProject() {
configPath := filepath.Join(apiWorkDir, "internal", "config")
svcPath := filepath.Join(apiWorkDir, "internal", "svc")
typesPath := filepath.Join(apiWorkDir, "internal", "types")
svcPkg, err := golang.GetParentPackage(svcPath)
svcPkg, _, err := golang.GetParentPackage(svcPath)
logx.Must(err)
typesPkg, err := golang.GetParentPackage(typesPath)
typesPkg, _, err := golang.GetParentPackage(typesPath)
logx.Must(err)
configPkg, err := golang.GetParentPackage(configPath)
configPkg, _, err := golang.GetParentPackage(configPath)
logx.Must(err)
var rpcClientPkg string
if m.callRPC {
rpcClientPath := filepath.Join(rpcWorkDir, "greet")
rpcClientPkg, err = golang.GetParentPackage(rpcClientPath)
rpcClientPkg, _, err = golang.GetParentPackage(rpcClientPath)
logx.Must(err)
}