diff --git a/fs_gen_api.sh b/fs_gen_api.sh index fbc7a45a..6d35a29e 100755 --- a/fs_gen_api.sh +++ b/fs_gen_api.sh @@ -1,5 +1,5 @@ #! /bin/bash -name=${1%\/} +name=${1%%\\*} echo $name goctl api go -api server_api/$name.api -dir server/$name --home ./goctl_template/ # ctxName=server/$name/internal/svc/servicecontext.go diff --git a/fs_gen_api_backend.sh b/fs_gen_api_backend.sh index 037cfba9..d051a688 100755 --- a/fs_gen_api_backend.sh +++ b/fs_gen_api_backend.sh @@ -1,7 +1,14 @@ #! /bin/bash -# 专为后台序列化 -name=${1%\/} -echo $name -goctl api go -api server_api/$name.api -dir server/$name --home ./goctl_template_backend/ -# ctxName=server/$name/internal/svc/servicecontext.go -# gofmt -w $ctxName \ No newline at end of file +name=${1%%\\*} +options=("backend" "backend1" "backend2") +for option in "${options[@]}"; do + if [ "$name" = "$option" ]; then + echo $name + goctl api go -api server_api/$name.api -dir server/$name --home ./goctl_template_backend/ + exit + fi +done + +for option in "${options[@]}"; do + echo "只支持 $option" +done \ No newline at end of file diff --git a/fs_gen_mysql_model.sh b/fs_gen_mysql_model.sh index 81e4550e..e6347e26 100755 --- a/fs_gen_mysql_model.sh +++ b/fs_gen_mysql_model.sh @@ -1,4 +1,4 @@ #! /bin/bash # goctl model mysql ddl --src ./ddl/$1.sql --dir model/ --home ./goctl_template - -go run generator/main.go -name $1 \ No newline at end of file +name=${1%%\\*} +go run generator/main.go -name $name \ No newline at end of file