fusenapi/fs_gen_api.sh

36 lines
1.1 KiB
Bash
Raw Normal View History

2023-07-12 06:11:04 +00:00
#!/bin/bash
name=${1%%\\*}
2023-06-26 10:19:51 +00:00
2023-07-12 06:11:04 +00:00
excluded_names=("backend" "product-template" "product-model" "basic")
for excluded_name in "${excluded_names[@]}"; do
if [ "$name" = "$excluded_name" ]; then
echo "不能在$name里使用"
2023-06-26 10:19:51 +00:00
exit
2023-07-12 06:11:04 +00:00
fi
2023-06-26 10:19:51 +00:00
done
2023-06-08 02:51:56 +00:00
echo $name
2023-06-21 04:21:56 +00:00
goctl api go -api server_api/$name.api -dir server/$name --home ./goctl_template/
2023-07-12 06:11:04 +00:00
# List of API filenames without the '.api' extension
# api_names=("backend" "canteen" "home-user-auth" "map-library" "product" "product-template" "shopping-cart-confirmation" "webset" "data-transfer" "inventory" "orders" "product-model" "render" "upload")
# # Iterate over API filenames and generate Go code, excluding certain names
# for api_name in "${api_names[@]}"; do
# skip=false
# for excluded_name in "${excluded_names[@]}"; do
# if [ "$api_name" = "$excluded_name" ]; then
# skip=true
# break
# fi
# done
# if [ "$skip" = true ]; then
# continue
# fi
# echo "Generating Go code for $api_name"
# goctl api go -api server_api/"$api_name".api -dir server/"$api_name" --home ./goctl_template/
# done