feat: change swagger command

This commit is contained in:
zhuyasen 2025-06-20 22:07:34 +08:00
parent 85c243d643
commit 2eda08a3ad
3 changed files with 8 additions and 8 deletions

View File

@ -279,8 +279,8 @@ func NewCenter(configFile string) (*Center, error) {
checkResult $?
sponge web swagger2-to-openapi3 --file=docs/apis.swagger.json > /dev/null 2>&1
sponge web swagger --file=docs/apis.swagger.json > /dev/null 2>&1
# handle apis.swagger.json
sponge web swagger --enable-standardize-response --enable-to-openapi3 --enable-integer-to-string --file=docs/apis.swagger.json > /dev/null
moduleName=$(cat docs/gen.info | head -1 | cut -d , -f 1)
serverName=$(cat docs/gen.info | head -1 | cut -d , -f 2)
@ -308,8 +308,8 @@ func NewCenter(configFile string) (*Center, error) {
checkResult $?
sponge web swagger2-to-openapi3 --file=docs/apis.swagger.json > /dev/null 2>&1
sponge web swagger --file=docs/apis.swagger.json > /dev/null 2>&1
# handle apis.swagger.json
sponge web swagger --enable-standardize-response --enable-to-openapi3 --enable-integer-to-string --file=docs/apis.swagger.json > /dev/null
moduleName=$(cat docs/gen.info | head -1 | cut -d , -f 1)
serverName=$(cat docs/gen.info | head -1 | cut -d , -f 2)
@ -337,8 +337,8 @@ func NewCenter(configFile string) (*Center, error) {
checkResult $?
sponge web swagger2-to-openapi3 --file=docs/apis.swagger.json > /dev/null 2>&1
sponge web swagger --file=docs/apis.swagger.json > /dev/null 2>&1
# handle apis.swagger.json
sponge web swagger --enable-standardize-response --enable-to-openapi3 --enable-integer-to-string --file=docs/apis.swagger.json > /dev/null
moduleName=$(cat docs/gen.info | head -1 | cut -d , -f 1)
serverName=$(cat docs/gen.info | head -1 | cut -d , -f 2)

View File

@ -201,7 +201,7 @@ function generateBySpecifiedProto(){
checkResult $?
# handle apis.swagger.json
sponge web swagger --enable-standardize-response --enable-to-openapi3 --enable-integer-to-string --file=docs/apis.swagger.json > /dev/null 2>&1
sponge web swagger --enable-standardize-response --enable-to-openapi3 --enable-integer-to-string --file=docs/apis.swagger.json > /dev/null
# A total of four files are generated: the registration route file *_router.pb.go (saved in the same directory as the protobuf file),
# the injection route file *_router.go (saved in internal/routers by default), the logic code template file *.go (saved in internal/service by default),

View File

@ -30,7 +30,7 @@ checkResult $?
sponge patch modify-dup-num --dir=internal/ecode
sponge patch modify-dup-err-code --dir=internal/ecode
# handle swagger.json
sponge web swagger --enable-standardize-response --enable-to-openapi3 --enable-integer-to-string --file=docs/swagger.json > /dev/null 2>&1
sponge web swagger --enable-to-openapi3 --enable-integer-to-string --file=docs/swagger.json > /dev/null
colorGreen='\033[1;32m'
colorCyan='\033[1;36m'