fix: issues #120

This commit is contained in:
zhuyasen
2025-07-31 19:50:43 +08:00
parent f95dc285d2
commit 5da877b1c5
2 changed files with 5 additions and 2 deletions

View File

@@ -369,7 +369,11 @@ func (g *httpAndGRPCPbGenerator) addFields(r replacer.Replacer) []replacer.Field
fields = append(fields, getGRPCServiceFields()...) fields = append(fields, getGRPCServiceFields()...)
if g.suitedMonoRepo { if g.suitedMonoRepo {
fs := serverCodeFields(codeNameGRPCHTTPPb, g.moduleName, g.serverName) serverType := codeNameGRPCHTTPPb
if g.isAddDBInitCode {
serverType = codeNameGRPC // force to use grpc type when using mono-repo
}
fs := serverCodeFields(serverType, g.moduleName, g.serverName)
fields = append(fields, fs...) fields = append(fields, fs...)
} }

View File

@@ -105,7 +105,6 @@ function autoDetectTypesProto() {
if grep -q "$target" "$file"; then if grep -q "$target" "$file"; then
allProtoFiles=$allProtoFiles" $target" allProtoFiles=$allProtoFiles" $target"
sponge patch gen-types-pb --out=. > /dev/null 2>&1 sponge patch gen-types-pb --out=. > /dev/null 2>&1
# Note: If the project uses mono-repo type, please manually move "api/types" directory to "../api/types"
return 0 return 0
fi fi
done done