hwh
2024-09-02 66da0f6808fa8496a3216c94973a552389ab96ba
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
 
currPath=$(pwd)
parentPath=$(dirname "$currPath")
apiServicesPath=${parentPath}/src/api-services/
 
echo "================================ 生成目录 ${apiServicesPath} ================================"
 
# 判断目录是否存在
if test -"$apiServicesPath"; then
  echo "================================ 删除目录 api-services ================================"
  rm -rf "${apiServicesPath}"
fi
 
echo "================================ 开始生成 api-services ================================"
 
java -jar "${currPath}"/swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/All%20Groups/swagger.json -l typescript-axios -"${apiServicesPath}"
 
rm -rf "${apiServicesPath}".swagger-codegen
rm -"${apiServicesPath}".gitignore
rm -"${apiServicesPath}".npmignore
rm -"${apiServicesPath}".swagger-codegen-ignore
rm -"${apiServicesPath}"git_push.sh
rm -"${apiServicesPath}"package.json
rm -"${apiServicesPath}"README.md
rm -"${apiServicesPath}"tsconfig.json
 
echo "================================ 生成结束 ================================"