浏览代码

!647 add Web/api_build/build.sh.
Merge pull request !647 from brachetto/N/A

zuohuaijun 3 年之前
父节点
当前提交
f430a026f5
共有 1 个文件被更改,包括 28 次插入 和 0 次删除
  1. 28 0
      Web/api_build/build.sh

+ 28 - 0
Web/api_build/build.sh

@@ -0,0 +1,28 @@
+#!/bin/sh
+
+currPath=$(pwd)
+parentPath=$(dirname "$currPath")
+apiServicesPath=${parentPath}/src/api-services/
+
+echo "================================ 生成目录 ${apiServicesPath} ================================"
+
+# 判断目录是否存在
+if test -d "$apiServicesPath"; then
+  echo "================================ 删除目录 api-services ================================"
+  rm -rf "${apiServicesPath}"
+fi
+
+echo "================================ 开始生成 api-services ================================"
+
+java -jar "${currPath}"/swagger-codegen-cli.jar generate -i http://localhost:5000/swagger/All%20Groups/swagger.json -l typescript-axios -o "${apiServicesPath}"
+
+rm -rf "${apiServicesPath}".swagger-codegen
+rm -f "${apiServicesPath}".gitignore
+rm -f "${apiServicesPath}".npmignore
+rm -f "${apiServicesPath}".swagger-codegen-ignore
+rm -f "${apiServicesPath}"git_push.sh
+rm -f "${apiServicesPath}"package.json
+rm -f "${apiServicesPath}"README.md
+rm -f "${apiServicesPath}"tsconfig.json
+
+echo "================================ 生成结束 ================================"