From 1e9424e82eaba37d71d8c170db9e6563b889c198 Mon Sep 17 00:00:00 2001 From: Master Date: Wed, 10 Jul 2024 10:49:08 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Admin.NET/Admin.NET.Web.Entry/wwwroot/Template/index.vue.vm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Admin.NET/Admin.NET.Web.Entry/wwwroot/Template/index.vue.vm b/Admin.NET/Admin.NET.Web.Entry/wwwroot/Template/index.vue.vm index f26b6402..ce4bbe98 100644 --- a/Admin.NET/Admin.NET.Web.Entry/wwwroot/Template/index.vue.vm +++ b/Admin.NET/Admin.NET.Web.Entry/wwwroot/Template/index.vue.vm @@ -236,7 +236,7 @@ import { @(@Model.ClassName)Api } from '/@@/api-services/api'; import { @(@Model.ClassName), @(@Model.ClassName)Input, @(@Model.ClassName)Output } from '/@@/api-services/models'; } else { -@:import { page@(@Model.EntityName), delete@(@Model.EntityName) } from '/@@/api/@(@Model.PagePath)/@(@Model.LowerEntityName)'; +@:import { page@(@Model.ClassName), delete@(@Model.ClassName) } from '/@@/api/@(@Model.PagePath)/@(@Model.LowerEntityName)'; foreach (var column in Model.QueryWhetherList){ if(@column.EffectType == "fk"){ @:import { get@(@column.FkEntityName)@(@column.PropertyName)Dropdown } from '/@@/api/@(@Model.PagePath)/@(@Model.LowerEntityName)'; From 70c1efa126f87e60bd1db28c1a431faa58355e32 Mon Sep 17 00:00:00 2001 From: Master Date: Thu, 11 Jul 2024 09:09:05 +0800 Subject: [PATCH 2/2] add api_build all group --- Web/api_build/build_all.bat | 27 +++++++++++++++++++++++++++ Web/api_build/build_all.sh | 28 ++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 Web/api_build/build_all.bat create mode 100644 Web/api_build/build_all.sh diff --git a/Web/api_build/build_all.bat b/Web/api_build/build_all.bat new file mode 100644 index 00000000..ef0b785f --- /dev/null +++ b/Web/api_build/build_all.bat @@ -0,0 +1,27 @@ +@echo off +CHCP 65001 + +set dir=%~dp0 + +set apiServicesPath=%dir%..\src\api-services\ + +if exist %apiServicesPath% ( + echo ================================ 删除目录 api-services ================================ + rd /s /q %apiServicesPath% +) + +echo ================================ 开始生成 api-services ================================ + +java -jar %dir%swagger-codegen-cli.jar generate -i http://localhost:5005/swagger/All%20Groups/swagger.json -l typescript-axios -o %apiServicesPath% + +@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 ================================ 生成结束 ================================ \ No newline at end of file diff --git a/Web/api_build/build_all.sh b/Web/api_build/build_all.sh new file mode 100644 index 00000000..75b792bc --- /dev/null +++ b/Web/api_build/build_all.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:5005/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 "================================ 生成结束 ================================"