可以了

This commit is contained in:
eson 2023-06-25 19:33:25 +08:00
parent 1a0156c686
commit 8fae3400d3
3 changed files with 16 additions and 9 deletions

View File

@ -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

View File

@ -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
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

View File

@ -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
name=${1%%\\*}
go run generator/main.go -name $name