UNIVPLMDataIntegration/Web/api_build/build.bat

47 lines
1.6 KiB
Batchfile
Raw Normal View History

2024-06-15 13:02:35 +08:00
@echo off
CHCP 65001
set dir=%~dp0
set moduleName=system
set apiServicesPath=%dir%..\src\api-services\system\
2024-11-25 16:27:14 +08:00
set apiUrl=http://localhost:5005/swagger/Default/swagger.json
2025-09-14 18:13:03 +08:00
if "%1"=="dataApproval" (
set moduleName=dataApproval
set apiServicesPath=%dir%..\src\api-services\dataApproval\
set apiUrl=http://localhost:5005/swagger/DataApproval/swagger.json
2024-11-25 16:27:14 +08:00
) else if "%1"=="dingTalk" (
set moduleName=dingTalk
set apiServicesPath=%dir%..\src\api-services\dingTalk\
2024-11-25 16:27:14 +08:00
set apiUrl=http://localhost:5005/swagger/DingTalk/swagger.json
) else if "%1"=="goView" (
set moduleName=goView
set apiServicesPath=%dir%..\src\api-services\goView\
2025-09-14 18:13:03 +08:00
set apiUrl=http://localhost:5005/swagger/GoView/swagger.json
) else if "%1"=="aiChat" (
set moduleName=aiChat
set apiServicesPath=%dir%..\src\api-services\aiChat\
set apiUrl=http://localhost:5005/swagger/AiChat/swagger.json
2024-11-25 16:27:14 +08:00
)
2024-06-15 13:02:35 +08:00
if exist %apiServicesPath% (
2024-11-25 16:27:14 +08:00
echo ================================ 删除目录 %moduleName% ================================
2024-06-15 13:02:35 +08:00
rd /s /q %apiServicesPath%
)
2024-11-25 16:27:14 +08:00
echo ================================ 开始生成 %moduleName% ================================
2024-06-15 13:02:35 +08:00
2024-11-25 16:27:14 +08:00
java -jar %dir%swagger-codegen-cli.jar generate -i %apiUrl% -l typescript-axios -o %apiServicesPath%
2024-06-15 13:02:35 +08:00
@rem 删除不必要的文件和文件夹
rd /s /q %apiServicesPath%.swagger-codegen
del /q %apiServicesPath%.gitignore
del /q %apiServicesPath%.npmignore
del /q %apiServicesPath%.swagger-codegen-ignore
del /q %apiServicesPath%git_push.sh
del /q %apiServicesPath%package.json
del /q %apiServicesPath%README.md
del /q %apiServicesPath%tsconfig.json
echo ================================ 生成结束 ================================