From 79c8fd785521a9b4136e2df476c81d469ac0dda5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=A1=82=E5=AD=90?= Date: Fri, 10 Feb 2023 15:13:16 +0000 Subject: [PATCH 01/12] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E5=86=85=E5=AE=B9=EF=BC=8C=E5=B9=B6=E6=94=B9=E6=97=B6=E5=8C=BA?= =?UTF-8?q?=E4=B8=BA=E6=9C=AC=E5=9C=B0=E6=97=B6=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 小桂子 --- yudao-server/src/main/resources/application-local.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yudao-server/src/main/resources/application-local.yaml b/yudao-server/src/main/resources/application-local.yaml index 1187ff7e19..d1d5120449 100644 --- a/yudao-server/src/main/resources/application-local.yaml +++ b/yudao-server/src/main/resources/application-local.yaml @@ -45,7 +45,7 @@ spring: datasource: master: name: ruoyi-vue-pro - url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true # MySQL Connector/J 8.X 连接的示例 + url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true # MySQL Connector/J 8.X 连接的示例 # url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT # MySQL Connector/J 5.X 连接的示例 # url: jdbc:postgresql://127.0.0.1:5432/${spring.datasource.dynamic.datasource.slave.name} # PostgreSQL 连接的示例 # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 @@ -56,7 +56,7 @@ spring: # password: JSm:g(*%lU4ZAkz06cd52KqT3)i1?H7W slave: # 模拟从库,可根据自己需要修改 name: ruoyi-vue-pro - url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true # MySQL Connector/J 8.X 连接的示例 + url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true # MySQL Connector/J 8.X 连接的示例 # url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT # MySQL Connector/J 5.X 连接的示例 # url: jdbc:postgresql://127.0.0.1:5432/${spring.datasource.dynamic.datasource.slave.name} # PostgreSQL 连接的示例 # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 From 96282abca02b8609df7d34c90691704560d082cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=A1=82=E5=AD=90?= Date: Fri, 10 Feb 2023 17:53:46 +0000 Subject: [PATCH 02/12] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E5=B9=B6=E6=9B=B4=E6=8D=A2=E4=B8=BA=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0=E5=8C=96=E6=97=B6=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 小桂子 --- yudao-server/src/main/resources/application-dev.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yudao-server/src/main/resources/application-dev.yaml b/yudao-server/src/main/resources/application-dev.yaml index 4a20cdfb3a..7cc4801e51 100644 --- a/yudao-server/src/main/resources/application-dev.yaml +++ b/yudao-server/src/main/resources/application-dev.yaml @@ -45,13 +45,13 @@ spring: datasource: master: name: ruoyi-vue-pro - url: jdbc:mysql://400-infra.server.iocoder.cn:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true + url: jdbc:mysql://400-infra.server.iocoder.cn:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true driver-class-name: com.mysql.jdbc.Driver username: root password: 3WLiVUBEwTbvAfsh slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改 name: ruoyi-vue-pro - url: jdbc:mysql://400-infra.server.iocoder.cn:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true + url: jdbc:mysql://400-infra.server.iocoder.cn:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&serverTimezone=CTT&allowPublicKeyRetrieval=true driver-class-name: com.mysql.jdbc.Driver username: root password: 3WLiVUBEwTbvAfsh From 5c6451f6aa57b098d3000b0cbe51931f33ea6447 Mon Sep 17 00:00:00 2001 From: zheng decan Date: Sun, 12 Feb 2023 21:02:10 +0800 Subject: [PATCH 03/12] =?UTF-8?q?fix:=20PostgreSQL=E7=9A=84SQL=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E5=9C=A8=E9=9D=9E=E5=A4=9A=E7=A7=9F=E6=88=B7=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E4=B8=8B=E9=83=A8=E4=BB=BD=E8=A1=A8tanant=5Fid?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=80=BC=E7=BC=BA=E5=A4=B1=E9=80=A0=E6=88=90?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/postgresql/ruoyi-vue-pro.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sql/postgresql/ruoyi-vue-pro.sql b/sql/postgresql/ruoyi-vue-pro.sql index c16a51f757..6ce36cbd77 100644 --- a/sql/postgresql/ruoyi-vue-pro.sql +++ b/sql/postgresql/ruoyi-vue-pro.sql @@ -2493,7 +2493,7 @@ CREATE TABLE "system_login_log" ( "id" int8 NOT NULL, "log_type" int8 NOT NULL, "trace_id" varchar(64) COLLATE "pg_catalog"."default" NOT NULL, - "user_id" int8 NOT NULL, + "user_id" int8 NOT NULL DEFAULT 0, "user_type" int2 NOT NULL, "username" varchar(50) COLLATE "pg_catalog"."default" NOT NULL, "result" int2 NOT NULL, @@ -2866,7 +2866,7 @@ CREATE TABLE "system_oauth2_access_token" ( "updater" varchar(64) COLLATE "pg_catalog"."default", "update_time" timestamp(6) NOT NULL, "deleted" int2 NOT NULL DEFAULT 0, - "tenant_id" int8 NOT NULL, + "tenant_id" int8 NOT NULL DEFAULT 0, "scopes" varchar(255) COLLATE "pg_catalog"."default" DEFAULT ''::character varying ) ; @@ -2909,7 +2909,7 @@ CREATE TABLE "system_oauth2_approve" ( "updater" varchar(64) COLLATE "pg_catalog"."default", "update_time" timestamp(6) NOT NULL, "deleted" int2 NOT NULL DEFAULT 0, - "tenant_id" int8 NOT NULL + "tenant_id" int8 NOT NULL DEFAULT 0 ) ; COMMENT ON COLUMN "system_oauth2_approve"."id" IS '编号'; @@ -3011,7 +3011,7 @@ CREATE TABLE "system_oauth2_code" ( "updater" varchar(64) COLLATE "pg_catalog"."default", "update_time" timestamp(6) NOT NULL, "deleted" int2 NOT NULL DEFAULT 0, - "tenant_id" int8 NOT NULL + "tenant_id" int8 NOT NULL DEFAULT 0 ) ; COMMENT ON COLUMN "system_oauth2_code"."id" IS '编号'; @@ -3053,7 +3053,7 @@ CREATE TABLE "system_oauth2_refresh_token" ( "updater" varchar(64) COLLATE "pg_catalog"."default", "update_time" timestamp(6) NOT NULL, "deleted" int2 NOT NULL DEFAULT 0, - "tenant_id" int8 NOT NULL, + "tenant_id" int8 NOT NULL DEFAULT 0, "scopes" varchar(255) COLLATE "pg_catalog"."default" DEFAULT ''::character varying ) ; From de8f8b450a1e7eeb8dce5425609fdc95ca5142e8 Mon Sep 17 00:00:00 2001 From: Rex <503431920@qq.com> Date: Tue, 14 Feb 2023 21:33:13 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E7=BC=BA=E9=99=B7-=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E5=99=A8=E7=9A=84=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/module/infra/service/codegen/CodegenServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenServiceImpl.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenServiceImpl.java index e3a352b8bf..7d42af3383 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenServiceImpl.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/codegen/CodegenServiceImpl.java @@ -158,7 +158,7 @@ public class CodegenServiceImpl implements CodegenService { //计算需要修改的字段,插入时重新插入,删除时将原来的删除 BiPredicate pr = - (tableField, codegenColumn) -> tableField.getType().equals(codegenColumn.getDataType()) + (tableField, codegenColumn) -> tableField.getMetaInfo().getJdbcType().name().equals(codegenColumn.getDataType()) && tableField.getMetaInfo().isNullable() == codegenColumn.getNullable() && tableField.isKeyFlag() == codegenColumn.getPrimaryKey() && tableField.getComment().equals(codegenColumn.getColumnComment()); From edc52d5f4f80333368997d80e2fcbd34dea59dd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AD=B1=E9=BE=99=E7=BC=98?= <794334212@qq.com> Date: Fri, 17 Feb 2023 09:58:38 +0000 Subject: [PATCH 05/12] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20Redis=20Pub/Sub=20?= =?UTF-8?q?=E5=B9=BF=E6=92=AD=E6=B6=88=E8=B4=B9=E7=9A=84=E5=AE=B9=E5=99=A8?= =?UTF-8?q?=20=E9=BB=98=E8=AE=A4=E6=9C=AA=E5=90=AF=E5=8A=A8=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20=E9=BB=98=E8=AE=A4=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=90=AF=E5=8A=A8Redis=20Pub/Sub=20=E5=B9=BF?= =?UTF-8?q?=E6=92=AD=E6=B6=88=E8=B4=B9=E7=9A=84=E5=AE=B9=E5=99=A8=20?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E5=8F=91=E5=87=BA=E6=B6=88=E6=81=AF=E5=90=8E?= =?UTF-8?q?=20=E6=B6=88=E8=B4=B9=E8=80=85=E6=94=B6=E4=B8=8D=E5=88=B0?= =?UTF-8?q?=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 筱龙缘 <794334212@qq.com> --- .../yudao/framework/mq/config/YudaoMQAutoConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/config/YudaoMQAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/config/YudaoMQAutoConfiguration.java index 042a4f736a..b452aa5466 100644 --- a/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/config/YudaoMQAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/config/YudaoMQAutoConfiguration.java @@ -56,7 +56,7 @@ public class YudaoMQAutoConfiguration { /** * 创建 Redis Pub/Sub 广播消费的容器 */ - @Bean + @Bean(initMethod = "start", destroyMethod = "stop") public RedisMessageListenerContainer redisMessageListenerContainer( RedisMQTemplate redisMQTemplate, List> listeners) { // 创建 RedisMessageListenerContainer 对象 From 5f47c00c517fe7a1e1d3b5ecd731918af93fc1ad Mon Sep 17 00:00:00 2001 From: chiwenda <48881696+chiwenda@users.noreply.github.com> Date: Mon, 20 Feb 2023 22:05:28 +0800 Subject: [PATCH 06/12] =?UTF-8?q?fix:=E7=94=A8=E6=88=B7=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA=E6=89=80=E5=B1=9E=E9=83=A8=E9=97=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/system/controller/admin/user/UserController.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java index 40efb2d236..549982e3c6 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/UserController.java @@ -123,7 +123,10 @@ public class UserController { @Parameter(name = "id", description = "编号", required = true, example = "1024") @PreAuthorize("@ss.hasPermission('system:user:query')") public CommonResult getUser(@RequestParam("id") Long id) { - return success(UserConvert.INSTANCE.convert(userService.getUser(id))); + AdminUserDO user = userService.getUser(id); + // 获得部门数据 + DeptDO dept = deptService.getDept(user.getDeptId()); + return success(UserConvert.INSTANCE.convert(user).setDept(UserConvert.INSTANCE.convert(dept))); } @GetMapping("/export") From 834675f5b6a862f9ef3ad4c8df9956bc7faef1c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=AD=E6=A5=BC=E7=9A=84=E9=9B=A8?= Date: Thu, 23 Feb 2023 09:37:21 +0000 Subject: [PATCH 07/12] =?UTF-8?q?update=20.github/workflows/yudao-ui-admin?= =?UTF-8?q?.yml.=20=E5=AE=9A=E4=B9=89node.js=E7=89=88=E6=9C=AC=E7=94=A8?= =?UTF-8?q?=E7=9A=84=20node-version=EF=BC=8C=E5=8F=96=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E7=94=A8=E7=9A=84matrix.node=5Fversion=EF=BC=8C=E6=89=80?= =?UTF-8?q?=E4=BB=A5=E4=B8=80=E7=9B=B4=E5=8F=96=E4=B8=8D=E5=88=B0=E3=80=82?= =?UTF-8?q?=20=E7=9C=8B=E4=BA=86=E4=B8=8BGitHub=20Actions=E7=9A=84?= =?UTF-8?q?=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95=EF=BC=8C=E4=BB=A5=E5=89=8D?= =?UTF-8?q?=E4=B9=9F=E5=8F=96=E4=B8=8D=E5=88=B0=E7=89=88=E6=9C=AC=E5=8F=B7?= =?UTF-8?q?=EF=BC=8C=E5=8F=AA=E4=B8=8D=E8=BF=87=E4=BB=A5=E5=89=8DGitHub?= =?UTF-8?q?=E5=BA=94=E8=AF=A5=E6=98=AF=E9=BB=98=E8=AE=A4=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E7=9A=8416.x=E7=89=88=E6=9C=AC=EF=BC=8C=E7=8E=B0=E5=9C=A8?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E4=BD=BF=E7=94=A818.x=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E4=BA=86=EF=BC=8C=E8=80=8C=E9=A1=B9=E7=9B=AE=E6=9C=80=E9=AB=98?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=88=B017.x=EF=BC=8C=E6=89=80=E4=BB=A5?= =?UTF-8?q?=E4=BB=A5=E5=89=8D=E4=B8=8D=E6=8A=A5=E9=94=99=EF=BC=8C=E4=BD=86?= =?UTF-8?q?=E7=8E=B0=E5=9C=A8=E6=8A=A5=E9=94=99=E4=BA=86=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 六楼的雨 --- .github/workflows/yudao-ui-admin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/yudao-ui-admin.yml b/.github/workflows/yudao-ui-admin.yml index 9650c2c365..a42a8f61cd 100644 --- a/.github/workflows/yudao-ui-admin.yml +++ b/.github/workflows/yudao-ui-admin.yml @@ -21,7 +21,7 @@ jobs: strategy: matrix: - node-version: [14.x, 16.x] + node_version: [14.x, 16.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: From c35d4f596a3f0909b9edeb95fb366bab95cb65e3 Mon Sep 17 00:00:00 2001 From: "jian.li" Date: Fri, 24 Feb 2023 13:13:10 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E7=BC=93=E5=AD=98=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E5=91=BD=E5=90=8D=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yudao/module/system/service/dept/DeptServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java index 1b2bbec044..8dc52fdf8c 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/dept/DeptServiceImpl.java @@ -76,9 +76,9 @@ public class DeptServiceImpl implements DeptService { // 第二步:构建缓存 ImmutableMap.Builder builder = ImmutableMap.builder(); ImmutableMultimap.Builder parentBuilder = ImmutableMultimap.builder(); - depts.forEach(sysRoleDO -> { - builder.put(sysRoleDO.getId(), sysRoleDO); - parentBuilder.put(sysRoleDO.getParentId(), sysRoleDO); + depts.forEach(deptDO -> { + builder.put(deptDO.getId(), deptDO); + parentBuilder.put(deptDO.getParentId(), deptDO); }); deptCache = builder.build(); parentDeptCache = parentBuilder.build(); From 5d6e2725a849337e621a8787044e9a6049580326 Mon Sep 17 00:00:00 2001 From: gaibu <1016771049@qq.com> Date: Fri, 24 Feb 2023 21:59:01 +0800 Subject: [PATCH 09/12] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/operatelog/core/annotations/OperateLog.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/annotations/OperateLog.java b/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/annotations/OperateLog.java index c9a117cb41..adac327369 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/annotations/OperateLog.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-operatelog/src/main/java/cn/iocoder/yudao/framework/operatelog/core/annotations/OperateLog.java @@ -1,8 +1,8 @@ package cn.iocoder.yudao.framework.operatelog.core.annotations; import cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum; -import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; @@ -23,13 +23,13 @@ public @interface OperateLog { /** * 操作模块 * - * 为空时,会尝试读取 {@link Api#value()} 属性 + * 为空时,会尝试读取 {@link Tag#name()} 属性 */ String module() default ""; /** * 操作名 * - * 为空时,会尝试读取 {@link ApiOperation#value()} 属性 + * 为空时,会尝试读取 {@link Operation#summary()} 属性 */ String name() default ""; /** From e5957f91339f71acb2be8ef452932451b165e221 Mon Sep 17 00:00:00 2001 From: gaibu <1016771049@qq.com> Date: Sun, 26 Feb 2023 11:41:12 +0800 Subject: [PATCH 10/12] =?UTF-8?q?test:=20=E5=AD=97=E5=85=B8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=A8=A1=E5=9D=97=E5=8D=95=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pom.xml | 6 +++ .../core/util/DictFrameworkUtilsTest.java | 53 +++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 yudao-framework/yudao-spring-boot-starter-biz-dict/src/test/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtilsTest.java diff --git a/yudao-framework/yudao-spring-boot-starter-biz-dict/pom.xml b/yudao-framework/yudao-spring-boot-starter-biz-dict/pom.xml index 26e057d28e..5acbc46c72 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-dict/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-biz-dict/pom.xml @@ -39,5 +39,11 @@ com.google.guava guava + + + cn.iocoder.boot + yudao-spring-boot-starter-test + test + diff --git a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/test/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtilsTest.java b/yudao-framework/yudao-spring-boot-starter-biz-dict/src/test/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtilsTest.java new file mode 100644 index 0000000000..fc98843e25 --- /dev/null +++ b/yudao-framework/yudao-spring-boot-starter-biz-dict/src/test/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtilsTest.java @@ -0,0 +1,53 @@ +package cn.iocoder.yudao.framework.dict.core.util; + +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; +import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest; +import cn.iocoder.yudao.framework.test.core.util.RandomUtils; +import cn.iocoder.yudao.module.system.api.dict.DictDataApi; +import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Mock; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.when; + +/** + * {@link DictFrameworkUtils} 的单元测试 + */ +public class DictFrameworkUtilsTest extends BaseMockitoUnitTest { + + @Mock + private DictDataApi dictDataApi; + + @BeforeEach + public void setUp() { + DictFrameworkUtils.init(dictDataApi); + } + + @Test + public void getDictDataLabelTest() { + DictDataRespDTO dataRespDTO = randomPojo(); + when(dictDataApi.getDictData(dataRespDTO.getDictType(), dataRespDTO.getValue())).thenReturn(dataRespDTO); + String dictDataLabel = DictFrameworkUtils.getDictDataLabel(dataRespDTO.getDictType(), dataRespDTO.getValue()); + assertEquals(dataRespDTO.getLabel(), dictDataLabel); + } + + @Test + public void parseDictDataValueTest() { + DictDataRespDTO resp = randomPojo(); + when(dictDataApi.parseDictData(resp.getDictType(), resp.getLabel())).thenReturn(resp); + String value = DictFrameworkUtils.parseDictDataValue(resp.getDictType(), resp.getLabel()); + assertEquals(resp.getValue(), value); + } + + private DictDataRespDTO randomPojo() { + DictDataRespDTO dataRespDTO = new DictDataRespDTO(); + dataRespDTO.setLabel(RandomUtils.randomString()); + dataRespDTO.setValue(RandomUtils.randomString()); + dataRespDTO.setDictType(RandomUtils.randomString()); + dataRespDTO.setStatus(CommonStatusEnum.ENABLE.getStatus()); + + return dataRespDTO; + } +} From 2083fb78466938a3f0ca6250cbfc3b0139524e53 Mon Sep 17 00:00:00 2001 From: gaibu <1016771049@qq.com> Date: Mon, 27 Feb 2023 22:29:40 +0800 Subject: [PATCH 11/12] =?UTF-8?q?test:=20=E4=BF=AE=E6=94=B9=20code=20revie?= =?UTF-8?q?w?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pom.xml | 1 + .../core/util/DictFrameworkUtilsTest.java | 31 ++++++++----------- 2 files changed, 14 insertions(+), 18 deletions(-) diff --git a/yudao-framework/yudao-spring-boot-starter-biz-dict/pom.xml b/yudao-framework/yudao-spring-boot-starter-biz-dict/pom.xml index 5acbc46c72..e74551ff01 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-dict/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-biz-dict/pom.xml @@ -39,6 +39,7 @@ com.google.guava guava + cn.iocoder.boot diff --git a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/test/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtilsTest.java b/yudao-framework/yudao-spring-boot-starter-biz-dict/src/test/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtilsTest.java index fc98843e25..787cf2376a 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-dict/src/test/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtilsTest.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-dict/src/test/java/cn/iocoder/yudao/framework/dict/core/util/DictFrameworkUtilsTest.java @@ -2,13 +2,13 @@ package cn.iocoder.yudao.framework.dict.core.util; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest; -import cn.iocoder.yudao.framework.test.core.util.RandomUtils; import cn.iocoder.yudao.module.system.api.dict.DictDataApi; import cn.iocoder.yudao.module.system.api.dict.dto.DictDataRespDTO; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.Mock; +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.Mockito.when; @@ -26,28 +26,23 @@ public class DictFrameworkUtilsTest extends BaseMockitoUnitTest { } @Test - public void getDictDataLabelTest() { - DictDataRespDTO dataRespDTO = randomPojo(); + public void testGetDictDataLabel() { + // mock 数据 + DictDataRespDTO dataRespDTO = randomPojo(DictDataRespDTO.class, o -> o.setStatus(CommonStatusEnum.ENABLE.getStatus())); + // mock 方法 when(dictDataApi.getDictData(dataRespDTO.getDictType(), dataRespDTO.getValue())).thenReturn(dataRespDTO); - String dictDataLabel = DictFrameworkUtils.getDictDataLabel(dataRespDTO.getDictType(), dataRespDTO.getValue()); - assertEquals(dataRespDTO.getLabel(), dictDataLabel); + // 断言返回值 + assertEquals(dataRespDTO.getLabel(), DictFrameworkUtils.getDictDataLabel(dataRespDTO.getDictType(), dataRespDTO.getValue())); } @Test - public void parseDictDataValueTest() { - DictDataRespDTO resp = randomPojo(); + public void testParseDictDataValue() { + // mock 数据 + DictDataRespDTO resp = randomPojo(DictDataRespDTO.class, o -> o.setStatus(CommonStatusEnum.ENABLE.getStatus())); + // mock 方法 when(dictDataApi.parseDictData(resp.getDictType(), resp.getLabel())).thenReturn(resp); - String value = DictFrameworkUtils.parseDictDataValue(resp.getDictType(), resp.getLabel()); - assertEquals(resp.getValue(), value); + // 断言返回值 + assertEquals(resp.getValue(), DictFrameworkUtils.parseDictDataValue(resp.getDictType(), resp.getLabel())); } - private DictDataRespDTO randomPojo() { - DictDataRespDTO dataRespDTO = new DictDataRespDTO(); - dataRespDTO.setLabel(RandomUtils.randomString()); - dataRespDTO.setValue(RandomUtils.randomString()); - dataRespDTO.setDictType(RandomUtils.randomString()); - dataRespDTO.setStatus(CommonStatusEnum.ENABLE.getStatus()); - - return dataRespDTO; - } } From 911040492ec3a1d0ffc3be3f4d755ce4c7bc008c Mon Sep 17 00:00:00 2001 From: zhangxingjia Date: Tue, 28 Feb 2023 19:02:51 +0800 Subject: [PATCH 12/12] =?UTF-8?q?fix:=20=E5=8E=BB=E6=8E=89Swagger=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E9=85=8D=E7=BD=AE=E7=B1=BB=E4=B8=AD=E7=9A=84=E5=86=97?= =?UTF-8?q?=E4=BD=99=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../swagger/config/YudaoSwaggerAutoConfiguration.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/YudaoSwaggerAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/YudaoSwaggerAutoConfiguration.java index 2481d2b741..32acb33cc3 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/YudaoSwaggerAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/YudaoSwaggerAutoConfiguration.java @@ -52,8 +52,7 @@ public class YudaoSwaggerAutoConfiguration { // 接口信息 .info(buildInfo(properties)) // 接口安全配置 - .components(new Components().securitySchemes(securitySchemas)) - .addSecurityItem(new SecurityRequirement().addList(HttpHeaders.AUTHORIZATION)); + .components(new Components().securitySchemes(securitySchemas)); securitySchemas.keySet().forEach(key -> openAPI.addSecurityItem(new SecurityRequirement().addList(key))); return openAPI; }