From f6a1f732f6e8e179c01372b9ceffe68a14e99cc1 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 19 Sep 2024 13:12:15 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E3=80=91INFRA=EF=BC=9A=E4=BB=A3=E7=A0=81=E7=94=9F?= =?UTF-8?q?=E6=88=90=E6=97=B6=EF=BC=8C=E9=BB=98=E8=AE=A4=E7=A6=81=E7=94=A8?= =?UTF-8?q?=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95=E7=9A=84=E7=94=9F=E6=88=90?= =?UTF-8?q?=EF=BC=8C=E6=9B=B4=E7=AC=A6=E5=90=88=E5=A4=A7=E5=AE=B6=E7=9A=84?= =?UTF-8?q?=E4=B9=A0=E6=83=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../infra/framework/codegen/config/CodegenProperties.java | 6 ++++++ .../module/infra/service/codegen/inner/CodegenEngine.java | 5 +++++ .../src/main/resources/application.yaml | 1 + 3 files changed, 12 insertions(+) diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/codegen/config/CodegenProperties.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/codegen/config/CodegenProperties.java index 7cc849f96..cfa1fa2fb 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/codegen/config/CodegenProperties.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/codegen/config/CodegenProperties.java @@ -34,4 +34,10 @@ public class CodegenProperties { @NotNull(message = "代码生成的前端类型不能为空") private Integer frontType; + /** + * 是否生成单元测试 + */ + @NotNull(message = "是否生成单元测试不能为空") + private Boolean unitTestEnable; + } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenEngine.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenEngine.java index 63e0c92ac..8f0068273 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenEngine.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/inner/CodegenEngine.java @@ -398,6 +398,11 @@ public class CodegenEngine { Map templates = new LinkedHashMap<>(); templates.putAll(SERVER_TEMPLATES); templates.putAll(FRONT_TEMPLATES.row(frontType)); + // 如果禁用单元测试,则移除对应的模版 + if (Boolean.FALSE.equals(codegenProperties.getUnitTestEnable())) { + templates.remove(javaTemplatePath("test/serviceTest")); + templates.remove("codegen/sql/h2.vm"); + } return templates; } diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/application.yaml b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/application.yaml index c4f43f51a..51e84e4aa 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/resources/application.yaml +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/resources/application.yaml @@ -161,6 +161,7 @@ yudao: base-package: cn.iocoder.yudao db-schemas: ${spring.datasource.dynamic.datasource.master.name} front-type: 20 # 前端模版的类型,参见 CodegenFrontTypeEnum 枚举类 + unit-test-enable: false # 是否生成单元测试 tenant: # 多租户相关配置项 enable: true ignore-urls: From 1869e1525e2f0fe9aeacfd192499013e72a93e18 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 20 Sep 2024 22:01:55 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E3=80=91=E6=8A=A5=E8=A1=A8=EF=BC=9Ajimureport=20from?= =?UTF-8?q?=201.7.8=20to=201.8.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-dependencies/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index f7e19bc91..2b1fd6a39 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -76,7 +76,7 @@ 2.15.1 8.5.7 2.0.5 - 1.7.8 + 1.8.1 2.12.2 4.6.0 From 34a4959e8ab246a1ab65c5fc621d93fd7c835ded Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 29 Sep 2024 08:08:31 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E3=80=90=E5=8A=9F=E8=83=BD=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E3=80=91=E7=BD=91=E5=85=B3=EF=BC=9A=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=20dev=20=E9=85=8D=E7=BD=AE=EF=BC=8C=E6=96=B9=E4=BE=BF=E9=83=A8?= =?UTF-8?q?=E7=BD=B2~?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-dev.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 yudao-gateway/src/main/resources/application-dev.yaml diff --git a/yudao-gateway/src/main/resources/application-dev.yaml b/yudao-gateway/src/main/resources/application-dev.yaml new file mode 100644 index 000000000..570439c11 --- /dev/null +++ b/yudao-gateway/src/main/resources/application-dev.yaml @@ -0,0 +1,14 @@ +--- #################### 注册中心 + 配置中心相关配置 #################### + +spring: + cloud: + nacos: + server-addr: 127.0.0.1:8848 # Nacos 服务器地址 + username: # Nacos 账号 + password: # Nacos 密码 + discovery: # 【配置中心】配置项 + namespace: dev # 命名空间。这里使用 dev 开发环境 + group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP + config: # 【注册中心】配置项 + namespace: dev # 命名空间。这里使用 dev 开发环境 + group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP \ No newline at end of file From 1106a2504af1720264387905c0a264bde55b933e Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 29 Sep 2024 13:01:54 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E3=80=90=E4=BE=9D=E8=B5=96=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E3=80=91spring=20boot=20from=203.3.1=20to=203.3.4=20?= =?UTF-8?q?=E3=80=90=E4=BE=9D=E8=B5=96=E5=8D=87=E7=BA=A7=E3=80=91spring=20?= =?UTF-8?q?boot=20admin=20from=203.3.2=20to=203.3.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- pom.xml | 2 +- yudao-dependencies/pom.xml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1207400ed..4784fe48c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

Coverage Status - Downloads + Downloads Downloads Downloads

diff --git a/pom.xml b/pom.xml index 2b8e647d0..075eb6cb4 100644 --- a/pom.xml +++ b/pom.xml @@ -40,7 +40,7 @@ 1.6.0 1.18.34 - 3.3.1 + 3.3.4 1.5.5.Final UTF-8 diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index 2b1fd6a39..3007e5357 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -17,7 +17,7 @@ 2.2.0-snapshot 1.6.0 - 3.3.1 + 3.3.4 2023.0.3 2023.0.1.2 @@ -43,7 +43,7 @@ 2.2.7 9.0.0 - 3.3.2 + 3.3.3 0.33.0 8.0.2.RELEASE