Commit 23e3c4d0d94635f2e97ebfe302787d52c25a9be8
Merge branch 'master' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into feature/mall_product
Showing
20 changed files
with
111 additions
and
47 deletions
Docker-HOWTO.md
| @@ -45,13 +45,11 @@ docker compose --env-file docker.env up -d | @@ -45,13 +45,11 @@ docker compose --env-file docker.env up -d | ||
| 45 | 第一次执行,由于数据库未初始化,因此yudao-server容器会运行失败。执行如下命令初始化数据库: | 45 | 第一次执行,由于数据库未初始化,因此yudao-server容器会运行失败。执行如下命令初始化数据库: |
| 46 | 46 | ||
| 47 | ```shell | 47 | ```shell |
| 48 | -docker exec -i yudao-mysql \ | ||
| 49 | - sh -c 'exec mysql -uroot -p"$MYSQL_ROOT_PASSWORD" ruoyi-vue-pro' \ | 48 | +docker compose exec -T mysql \ |
| 49 | + sh -c 'exec mysql -uroot -p"$MYSQL_ROOT_PASSWORD" --default-character-set=utf8mb4 ruoyi-vue-pro' \ | ||
| 50 | < ./sql/mysql/ruoyi-vue-pro.sql | 50 | < ./sql/mysql/ruoyi-vue-pro.sql |
| 51 | ``` | 51 | ``` |
| 52 | 52 | ||
| 53 | -注意:这里用docker compose exec 会出现 `the input device is not a TTY` 报错 | ||
| 54 | - | ||
| 55 | ## Server:Port | 53 | ## Server:Port |
| 56 | 54 | ||
| 57 | - admin: http://localhost:8080 | 55 | - admin: http://localhost:8080 |
README.md
| @@ -249,7 +249,7 @@ ps:核心功能已经实现,正在对接微信小程序中... | @@ -249,7 +249,7 @@ ps:核心功能已经实现,正在对接微信小程序中... | ||
| 249 | 249 | ||
| 250 | | 框架 | 说明 | 版本 | 学习指南 | | 250 | | 框架 | 说明 | 版本 | 学习指南 | |
| 251 | |---------------------------------------------------------------------------------------------|------------------|-------------|----------------------------------------------------------------| | 251 | |---------------------------------------------------------------------------------------------|------------------|-------------|----------------------------------------------------------------| |
| 252 | -| [Spring Boot](https://spring.io/projects/spring-boot) | 应用开发框架 | 2.7.11 | [文档](https://github.com/YunaiV/SpringBoot-Labs) | | 252 | +| [Spring Boot](https://spring.io/projects/spring-boot) | 应用开发框架 | 2.7.12 | [文档](https://github.com/YunaiV/SpringBoot-Labs) | |
| 253 | | [MySQL](https://www.mysql.com/cn/) | 数据库服务器 | 5.7 / 8.0+ | | | 253 | | [MySQL](https://www.mysql.com/cn/) | 数据库服务器 | 5.7 / 8.0+ | | |
| 254 | | [Druid](https://github.com/alibaba/druid) | JDBC 连接池、监控组件 | 1.2.16 | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) | | 254 | | [Druid](https://github.com/alibaba/druid) | JDBC 连接池、监控组件 | 1.2.16 | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) | |
| 255 | | [MyBatis Plus](https://mp.baomidou.com/) | MyBatis 增强工具包 | 3.5.3.1 | [文档](http://www.iocoder.cn/Spring-Boot/MyBatis/?yudao) | | 255 | | [MyBatis Plus](https://mp.baomidou.com/) | MyBatis 增强工具包 | 3.5.3.1 | [文档](http://www.iocoder.cn/Spring-Boot/MyBatis/?yudao) | |
pom.xml
| @@ -39,7 +39,7 @@ | @@ -39,7 +39,7 @@ | ||
| 39 | <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version> | 39 | <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version> |
| 40 | <!-- 看看咋放到 bom 里 --> | 40 | <!-- 看看咋放到 bom 里 --> |
| 41 | <lombok.version>1.18.26</lombok.version> | 41 | <lombok.version>1.18.26</lombok.version> |
| 42 | - <spring.boot.version>2.7.11</spring.boot.version> | 42 | + <spring.boot.version>2.7.12</spring.boot.version> |
| 43 | <mapstruct.version>1.5.5.Final</mapstruct.version> | 43 | <mapstruct.version>1.5.5.Final</mapstruct.version> |
| 44 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | 44 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| 45 | </properties> | 45 | </properties> |
sql/postgresql/ruoyi-vue-pro.sql
| @@ -2405,6 +2405,10 @@ INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "st | @@ -2405,6 +2405,10 @@ INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "st | ||
| 2405 | INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1158, 3, 'implicit', 'implicit', 'system_oauth2_grant_type', 0, 'success', '', '简化模式', '1', '2022-05-12 00:23:40', '1', '2022-05-11 16:26:05', 0); | 2405 | INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1158, 3, 'implicit', 'implicit', 'system_oauth2_grant_type', 0, 'success', '', '简化模式', '1', '2022-05-12 00:23:40', '1', '2022-05-11 16:26:05', 0); |
| 2406 | INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1159, 4, 'client_credentials', 'client_credentials', 'system_oauth2_grant_type', 0, 'default', '', '客户端模式', '1', '2022-05-12 00:23:51', '1', '2022-05-11 16:26:08', 0); | 2406 | INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1159, 4, 'client_credentials', 'client_credentials', 'system_oauth2_grant_type', 0, 'default', '', '客户端模式', '1', '2022-05-12 00:23:51', '1', '2022-05-11 16:26:08', 0); |
| 2407 | INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1160, 5, 'refresh_token', 'refresh_token', 'system_oauth2_grant_type', 0, 'info', '', '刷新模式', '1', '2022-05-12 00:24:02', '1', '2022-05-11 16:26:11', 0); | 2407 | INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1160, 5, 'refresh_token', 'refresh_token', 'system_oauth2_grant_type', 0, 'info', '', '刷新模式', '1', '2022-05-12 00:24:02', '1', '2022-05-11 16:26:11', 0); |
| 2408 | +INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1161, 4, 'Vue 3 Vben', '30', 'infra_codegen_front_type', 0, '', '', '', '1', '2023-06-14 15:24:37.447', '1', '2023-06-14 15:24:37.447', 0); | ||
| 2409 | +INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1162, 3, 'Vue 3 Schema', '21', 'infra_codegen_front_type', 0, '', '', 'Vue 3 Element Plus Schema', '1', '2023-06-14 15:24:18.714', '1', '2023-06-14 15:36:40.317', 0); | ||
| 2410 | +INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1163, 2, 'Vue 3', '20', 'infra_codegen_front_type', 0, '', '', 'Vue 3 Element Plus', '1', '2023-06-14 15:24:05.654', '1', '2023-06-14 15:24:05.654', 0); | ||
| 2411 | +INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1164, 1, 'Vue 2', '10', 'infra_codegen_front_type', 0, '', '', 'Vue 2', '1', '2023-06-14 15:23:12.211', '1', '2023-06-14 15:23:57.816', 0); | ||
| 2408 | COMMIT; | 2412 | COMMIT; |
| 2409 | 2413 | ||
| 2410 | -- ---------------------------- | 2414 | -- ---------------------------- |
| @@ -2500,6 +2504,7 @@ INSERT INTO "system_dict_type" ("id", "name", "type", "status", "remark", "creat | @@ -2500,6 +2504,7 @@ INSERT INTO "system_dict_type" ("id", "name", "type", "status", "remark", "creat | ||
| 2500 | INSERT INTO "system_dict_type" ("id", "name", "type", "status", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (145, '角色类型', 'system_role_type', 0, '角色类型', '1', '2022-02-16 13:01:46', '1', '2022-02-16 13:01:46', 0); | 2504 | INSERT INTO "system_dict_type" ("id", "name", "type", "status", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (145, '角色类型', 'system_role_type', 0, '角色类型', '1', '2022-02-16 13:01:46', '1', '2022-02-16 13:01:46', 0); |
| 2501 | INSERT INTO "system_dict_type" ("id", "name", "type", "status", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (146, '文件存储器', 'infra_file_storage', 0, '文件存储器', '1', '2022-03-15 00:24:38', '1', '2022-03-15 00:24:38', 0); | 2505 | INSERT INTO "system_dict_type" ("id", "name", "type", "status", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (146, '文件存储器', 'infra_file_storage', 0, '文件存储器', '1', '2022-03-15 00:24:38', '1', '2022-03-15 00:24:38', 0); |
| 2502 | INSERT INTO "system_dict_type" ("id", "name", "type", "status", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (147, 'OAuth 2.0 授权类型', 'system_oauth2_grant_type', 0, 'OAuth 2.0 授权类型(模式)', '1', '2022-05-12 00:20:52', '1', '2022-05-11 16:25:49', 0); | 2506 | INSERT INTO "system_dict_type" ("id", "name", "type", "status", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (147, 'OAuth 2.0 授权类型', 'system_oauth2_grant_type', 0, 'OAuth 2.0 授权类型(模式)', '1', '2022-05-12 00:20:52', '1', '2022-05-11 16:25:49', 0); |
| 2507 | +INSERT INTO "system_dict_type" ("id", "name", "type", "status", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (148, '生成前端代码类型', 'infra_codegen_front_type', 0, '生成前端代码类型', '1', '2023-6-14 16:07:35', '1', '2023-6-14 16:07:39', 0); | ||
| 2503 | COMMIT; | 2508 | COMMIT; |
| 2504 | 2509 | ||
| 2505 | -- ---------------------------- | 2510 | -- ---------------------------- |
| @@ -2589,7 +2594,7 @@ COMMIT; | @@ -2589,7 +2594,7 @@ COMMIT; | ||
| 2589 | -- ---------------------------- | 2594 | -- ---------------------------- |
| 2590 | DROP TABLE IF EXISTS "system_menu"; | 2595 | DROP TABLE IF EXISTS "system_menu"; |
| 2591 | CREATE TABLE "system_menu" ( | 2596 | CREATE TABLE "system_menu" ( |
| 2592 | - "id" int8 NOT NULL, | 2597 | + "id" int8 NOT NULL DEFAULT nextval('system_menu_seq'::regclass), |
| 2593 | "name" varchar(50) COLLATE "pg_catalog"."default" NOT NULL, | 2598 | "name" varchar(50) COLLATE "pg_catalog"."default" NOT NULL, |
| 2594 | "permission" varchar(100) COLLATE "pg_catalog"."default" NOT NULL, | 2599 | "permission" varchar(100) COLLATE "pg_catalog"."default" NOT NULL, |
| 2595 | "type" int2 NOT NULL, | 2600 | "type" int2 NOT NULL, |
| @@ -2599,15 +2604,15 @@ CREATE TABLE "system_menu" ( | @@ -2599,15 +2604,15 @@ CREATE TABLE "system_menu" ( | ||
| 2599 | "icon" varchar(100) COLLATE "pg_catalog"."default", | 2604 | "icon" varchar(100) COLLATE "pg_catalog"."default", |
| 2600 | "component" varchar(255) COLLATE "pg_catalog"."default", | 2605 | "component" varchar(255) COLLATE "pg_catalog"."default", |
| 2601 | "status" int2 NOT NULL, | 2606 | "status" int2 NOT NULL, |
| 2602 | - "visible" bool NOT NULL, | ||
| 2603 | - "keep_alive" bool NOT NULL, | 2607 | + "visible" bool NOT NULL DEFAULT true, |
| 2608 | + "keep_alive" bool NOT NULL DEFAULT false, | ||
| 2604 | "creator" varchar(64) COLLATE "pg_catalog"."default", | 2609 | "creator" varchar(64) COLLATE "pg_catalog"."default", |
| 2605 | - "create_time" timestamp(6) NOT NULL, | 2610 | + "create_time" timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), |
| 2606 | "updater" varchar(64) COLLATE "pg_catalog"."default", | 2611 | "updater" varchar(64) COLLATE "pg_catalog"."default", |
| 2607 | - "update_time" timestamp(6) NOT NULL, | 2612 | + "update_time" timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), |
| 2608 | "deleted" int2 NOT NULL DEFAULT 0, | 2613 | "deleted" int2 NOT NULL DEFAULT 0, |
| 2609 | "component_name" varchar(255) COLLATE "pg_catalog"."default", | 2614 | "component_name" varchar(255) COLLATE "pg_catalog"."default", |
| 2610 | - "always_show" char(1) COLLATE "pg_catalog"."default" | 2615 | + "always_show" bool NOT NULL DEFAULT false |
| 2611 | ) | 2616 | ) |
| 2612 | ; | 2617 | ; |
| 2613 | COMMENT ON COLUMN "system_menu"."id" IS '菜单ID'; | 2618 | COMMENT ON COLUMN "system_menu"."id" IS '菜单ID'; |
| @@ -2738,19 +2743,19 @@ INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_i | @@ -2738,19 +2743,19 @@ INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_i | ||
| 2738 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1091, '文件查询', 'infra:file:query', 3, 1, 1090, '', '', '', 0, 't', 't', '', '2021-03-12 20:16:20', '', '2022-04-20 17:03:10', 0, NULL, '1'); | 2743 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1091, '文件查询', 'infra:file:query', 3, 1, 1090, '', '', '', 0, 't', 't', '', '2021-03-12 20:16:20', '', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2739 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1092, '文件删除', 'infra:file:delete', 3, 4, 1090, '', '', '', 0, 't', 't', '', '2021-03-12 20:16:20', '', '2022-04-20 17:03:10', 0, NULL, '1'); | 2744 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1092, '文件删除', 'infra:file:delete', 3, 4, 1090, '', '', '', 0, 't', 't', '', '2021-03-12 20:16:20', '', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2740 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1093, '短信管理', '', 1, 11, 1, 'sms', 'validCode', NULL, 0, 't', 't', '1', '2021-04-05 01:10:16', '1', '2022-04-20 17:03:10', 0, NULL, '1'); | 2745 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1093, '短信管理', '', 1, 11, 1, 'sms', 'validCode', NULL, 0, 't', 't', '1', '2021-04-05 01:10:16', '1', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2741 | -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1094, '短信渠道', '', 2, 0, 1093, 'sms-channel', 'phone', 'system/sms/smsChannel', 0, 't', 't', '', '2021-04-01 11:07:15', '1', '2022-04-20 17:03:10', 0, NULL, '1'); | 2746 | +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1094, '短信渠道', '', 2, 0, 1093, 'sms-channel', 'phone', 'system/sms/channel', 0, 't', 't', '', '2021-04-01 11:07:15', '1', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2742 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1095, '短信渠道查询', 'system:sms-channel:query', 3, 1, 1094, '', '', '', 0, 't', 't', '', '2021-04-01 11:07:15', '', '2022-04-20 17:03:10', 0, NULL, '1'); | 2747 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1095, '短信渠道查询', 'system:sms-channel:query', 3, 1, 1094, '', '', '', 0, 't', 't', '', '2021-04-01 11:07:15', '', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2743 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1096, '短信渠道创建', 'system:sms-channel:create', 3, 2, 1094, '', '', '', 0, 't', 't', '', '2021-04-01 11:07:15', '', '2022-04-20 17:03:10', 0, NULL, '1'); | 2748 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1096, '短信渠道创建', 'system:sms-channel:create', 3, 2, 1094, '', '', '', 0, 't', 't', '', '2021-04-01 11:07:15', '', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2744 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1097, '短信渠道更新', 'system:sms-channel:update', 3, 3, 1094, '', '', '', 0, 't', 't', '', '2021-04-01 11:07:15', '', '2022-04-20 17:03:10', 0, NULL, '1'); | 2749 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1097, '短信渠道更新', 'system:sms-channel:update', 3, 3, 1094, '', '', '', 0, 't', 't', '', '2021-04-01 11:07:15', '', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2745 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1098, '短信渠道删除', 'system:sms-channel:delete', 3, 4, 1094, '', '', '', 0, 't', 't', '', '2021-04-01 11:07:15', '', '2022-04-20 17:03:10', 0, NULL, '1'); | 2750 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1098, '短信渠道删除', 'system:sms-channel:delete', 3, 4, 1094, '', '', '', 0, 't', 't', '', '2021-04-01 11:07:15', '', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2746 | -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1100, '短信模板', '', 2, 1, 1093, 'sms-template', 'phone', 'system/sms/smsTemplate', 0, 't', 't', '', '2021-04-01 17:35:17', '1', '2022-04-20 17:03:10', 0, NULL, '1'); | 2751 | +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1100, '短信模板', '', 2, 1, 1093, 'sms-template', 'phone', 'system/sms/template', 0, 't', 't', '', '2021-04-01 17:35:17', '1', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2747 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1101, '短信模板查询', 'system:sms-template:query', 3, 1, 1100, '', '', '', 0, 't', 't', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0, NULL, '1'); | 2752 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1101, '短信模板查询', 'system:sms-template:query', 3, 1, 1100, '', '', '', 0, 't', 't', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2748 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1102, '短信模板创建', 'system:sms-template:create', 3, 2, 1100, '', '', '', 0, 't', 't', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0, NULL, '1'); | 2753 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1102, '短信模板创建', 'system:sms-template:create', 3, 2, 1100, '', '', '', 0, 't', 't', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2749 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1103, '短信模板更新', 'system:sms-template:update', 3, 3, 1100, '', '', '', 0, 't', 't', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0, NULL, '1'); | 2754 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1103, '短信模板更新', 'system:sms-template:update', 3, 3, 1100, '', '', '', 0, 't', 't', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2750 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1104, '短信模板删除', 'system:sms-template:delete', 3, 4, 1100, '', '', '', 0, 't', 't', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0, NULL, '1'); | 2755 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1104, '短信模板删除', 'system:sms-template:delete', 3, 4, 1100, '', '', '', 0, 't', 't', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2751 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1105, '短信模板导出', 'system:sms-template:export', 3, 5, 1100, '', '', '', 0, 't', 't', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0, NULL, '1'); | 2756 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1105, '短信模板导出', 'system:sms-template:export', 3, 5, 1100, '', '', '', 0, 't', 't', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2752 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1106, '发送测试短信', 'system:sms-template:send-sms', 3, 6, 1100, '', '', '', 0, 't', 't', '1', '2021-04-11 00:26:40', '1', '2022-04-20 17:03:10', 0, NULL, '1'); | 2757 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1106, '发送测试短信', 'system:sms-template:send-sms', 3, 6, 1100, '', '', '', 0, 't', 't', '1', '2021-04-11 00:26:40', '1', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2753 | -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1107, '短信日志', '', 2, 2, 1093, 'sms-log', 'phone', 'system/sms/smsLog', 0, 't', 't', '', '2021-04-11 08:37:05', '1', '2022-04-20 17:03:10', 0, NULL, '1'); | 2758 | +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1107, '短信日志', '', 2, 2, 1093, 'sms-log', 'phone', 'system/sms/log', 0, 't', 't', '', '2021-04-11 08:37:05', '1', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2754 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1108, '短信日志查询', 'system:sms-log:query', 3, 1, 1107, '', '', '', 0, 't', 't', '', '2021-04-11 08:37:05', '', '2022-04-20 17:03:10', 0, NULL, '1'); | 2759 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1108, '短信日志查询', 'system:sms-log:query', 3, 1, 1107, '', '', '', 0, 't', 't', '', '2021-04-11 08:37:05', '', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2755 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1109, '短信日志导出', 'system:sms-log:export', 3, 5, 1107, '', '', '', 0, 't', 't', '', '2021-04-11 08:37:05', '', '2022-04-20 17:03:10', 0, NULL, '1'); | 2760 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1109, '短信日志导出', 'system:sms-log:export', 3, 5, 1107, '', '', '', 0, 't', 't', '', '2021-04-11 08:37:05', '', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2756 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1110, '错误码管理', '', 2, 12, 1, 'error-code', 'code', 'system/errorCode/index', 0, 't', 't', '', '2021-04-13 21:46:42', '1', '2022-04-20 17:03:10', 0, NULL, '1'); | 2761 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1110, '错误码管理', '', 2, 12, 1, 'error-code', 'code', 'system/errorCode/index', 0, 't', 't', '', '2021-04-13 21:46:42', '1', '2022-04-20 17:03:10', 0, NULL, '1'); |
| @@ -4239,7 +4244,7 @@ CREATE TABLE "system_notify_message" ( | @@ -4239,7 +4244,7 @@ CREATE TABLE "system_notify_message" ( | ||
| 4239 | "template_content" varchar(1024) COLLATE "pg_catalog"."default" NOT NULL, | 4244 | "template_content" varchar(1024) COLLATE "pg_catalog"."default" NOT NULL, |
| 4240 | "template_type" int4 NOT NULL, | 4245 | "template_type" int4 NOT NULL, |
| 4241 | "template_params" varchar(255) COLLATE "pg_catalog"."default" NOT NULL, | 4246 | "template_params" varchar(255) COLLATE "pg_catalog"."default" NOT NULL, |
| 4242 | - "read_status" varchar(1) COLLATE "pg_catalog"."default" NOT NULL, | 4247 | + "read_status" bool NOT NULL DEFAULT false, |
| 4243 | "read_time" timestamp(6), | 4248 | "read_time" timestamp(6), |
| 4244 | "creator" varchar(64) COLLATE "pg_catalog"."default", | 4249 | "creator" varchar(64) COLLATE "pg_catalog"."default", |
| 4245 | "create_time" timestamp(6) NOT NULL, | 4250 | "create_time" timestamp(6) NOT NULL, |
yudao-dependencies/pom.xml
| @@ -16,7 +16,7 @@ | @@ -16,7 +16,7 @@ | ||
| 16 | <properties> | 16 | <properties> |
| 17 | <revision>1.7.3-snapshot</revision> | 17 | <revision>1.7.3-snapshot</revision> |
| 18 | <!-- 统一依赖管理 --> | 18 | <!-- 统一依赖管理 --> |
| 19 | - <spring.boot.version>2.7.11</spring.boot.version> | 19 | + <spring.boot.version>2.7.12</spring.boot.version> |
| 20 | <!-- Web 相关 --> | 20 | <!-- Web 相关 --> |
| 21 | <springdoc.version>1.6.15</springdoc.version> | 21 | <springdoc.version>1.6.15</springdoc.version> |
| 22 | <knife4j.version>4.1.0</knife4j.version> | 22 | <knife4j.version>4.1.0</knife4j.version> |
| @@ -52,10 +52,10 @@ | @@ -52,10 +52,10 @@ | ||
| 52 | <velocity.version>2.3</velocity.version> | 52 | <velocity.version>2.3</velocity.version> |
| 53 | <screw.version>1.0.5</screw.version> | 53 | <screw.version>1.0.5</screw.version> |
| 54 | <fastjson.version>1.2.83</fastjson.version> | 54 | <fastjson.version>1.2.83</fastjson.version> |
| 55 | - <guava.version>31.1-jre</guava.version> | 55 | + <guava.version>32.0.0-jre</guava.version> |
| 56 | <guice.version>5.1.0</guice.version> | 56 | <guice.version>5.1.0</guice.version> |
| 57 | <transmittable-thread-local.version>2.14.2</transmittable-thread-local.version> | 57 | <transmittable-thread-local.version>2.14.2</transmittable-thread-local.version> |
| 58 | - <commons-net.version>3.8.0</commons-net.version> | 58 | + <commons-net.version>3.9.0</commons-net.version> |
| 59 | <jsch.version>0.1.55</jsch.version> | 59 | <jsch.version>0.1.55</jsch.version> |
| 60 | <tika-core.version>2.7.0</tika-core.version> | 60 | <tika-core.version>2.7.0</tika-core.version> |
| 61 | <netty-all.version>4.1.90.Final</netty-all.version> | 61 | <netty-all.version>4.1.90.Final</netty-all.version> |
| @@ -67,7 +67,7 @@ | @@ -67,7 +67,7 @@ | ||
| 67 | <minio.version>8.5.2</minio.version> | 67 | <minio.version>8.5.2</minio.version> |
| 68 | <aliyun-java-sdk-core.version>4.6.3</aliyun-java-sdk-core.version> | 68 | <aliyun-java-sdk-core.version>4.6.3</aliyun-java-sdk-core.version> |
| 69 | <aliyun-java-sdk-dysmsapi.version>2.2.1</aliyun-java-sdk-dysmsapi.version> | 69 | <aliyun-java-sdk-dysmsapi.version>2.2.1</aliyun-java-sdk-dysmsapi.version> |
| 70 | - <tencentcloud-sdk-java.version>3.1.715</tencentcloud-sdk-java.version> | 70 | + <tencentcloud-sdk-java.version>3.1.758</tencentcloud-sdk-java.version> |
| 71 | <justauth.version>1.4.0</justauth.version> | 71 | <justauth.version>1.4.0</justauth.version> |
| 72 | <jimureport.version>1.5.6</jimureport.version> | 72 | <jimureport.version>1.5.6</jimureport.version> |
| 73 | <xercesImpl.version>2.12.2</xercesImpl.version> | 73 | <xercesImpl.version>2.12.2</xercesImpl.version> |
yudao-example/yudao-sso-demo-by-code/pom.xml
| @@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
| 21 | <maven.compiler.target>8</maven.compiler.target> | 21 | <maven.compiler.target>8</maven.compiler.target> |
| 22 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | 22 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| 23 | <!-- 统一依赖管理 --> | 23 | <!-- 统一依赖管理 --> |
| 24 | - <spring.boot.version>2.7.11</spring.boot.version> | 24 | + <spring.boot.version>2.7.12</spring.boot.version> |
| 25 | </properties> | 25 | </properties> |
| 26 | 26 | ||
| 27 | <dependencyManagement> | 27 | <dependencyManagement> |
yudao-example/yudao-sso-demo-by-password/pom.xml
| @@ -21,7 +21,7 @@ | @@ -21,7 +21,7 @@ | ||
| 21 | <maven.compiler.target>8</maven.compiler.target> | 21 | <maven.compiler.target>8</maven.compiler.target> |
| 22 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | 22 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| 23 | <!-- 统一依赖管理 --> | 23 | <!-- 统一依赖管理 --> |
| 24 | - <spring.boot.version>2.7.11</spring.boot.version> | 24 | + <spring.boot.version>2.7.12</spring.boot.version> |
| 25 | </properties> | 25 | </properties> |
| 26 | 26 | ||
| 27 | <dependencyManagement> | 27 | <dependencyManagement> |
yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/rule/dept/DeptDataPermissionRule.java
| @@ -36,7 +36,7 @@ import java.util.Set; | @@ -36,7 +36,7 @@ import java.util.Set; | ||
| 36 | * 注意,使用 DeptDataPermissionRule 时,需要保证表中有 dept_id 部门编号的字段,可自定义。 | 36 | * 注意,使用 DeptDataPermissionRule 时,需要保证表中有 dept_id 部门编号的字段,可自定义。 |
| 37 | * | 37 | * |
| 38 | * 实际业务场景下,会存在一个经典的问题?当用户修改部门时,冗余的 dept_id 是否需要修改? | 38 | * 实际业务场景下,会存在一个经典的问题?当用户修改部门时,冗余的 dept_id 是否需要修改? |
| 39 | - * 1. 一般情况下,dept_id 不进行修改,则会导致用户看到之前的数据。【yudao-server 采用该方案】 | 39 | + * 1. 一般情况下,dept_id 不进行修改,则会导致用户看不到之前的数据。【yudao-server 采用该方案】 |
| 40 | * 2. 部分情况下,希望该用户还是能看到之前的数据,则有两种方式解决:【需要你改造该 DeptDataPermissionRule 的实现代码】 | 40 | * 2. 部分情况下,希望该用户还是能看到之前的数据,则有两种方式解决:【需要你改造该 DeptDataPermissionRule 的实现代码】 |
| 41 | * 1)编写洗数据的脚本,将 dept_id 修改成新部门的编号;【建议】 | 41 | * 1)编写洗数据的脚本,将 dept_id 修改成新部门的编号;【建议】 |
| 42 | * 最终过滤条件是 WHERE dept_id = ? | 42 | * 最终过滤条件是 WHERE dept_id = ? |
yudao-framework/yudao-spring-boot-starter-captcha/src/main/java/cn/iocoder/yudao/framework/captcha/config/YudaoCaptchaConfiguration.java
| @@ -3,11 +3,15 @@ package cn.iocoder.yudao.framework.captcha.config; | @@ -3,11 +3,15 @@ package cn.iocoder.yudao.framework.captcha.config; | ||
| 3 | import cn.hutool.core.util.ClassUtil; | 3 | import cn.hutool.core.util.ClassUtil; |
| 4 | import cn.iocoder.yudao.framework.captcha.core.enums.CaptchaRedisKeyConstants; | 4 | import cn.iocoder.yudao.framework.captcha.core.enums.CaptchaRedisKeyConstants; |
| 5 | import cn.iocoder.yudao.framework.captcha.core.service.RedisCaptchaServiceImpl; | 5 | import cn.iocoder.yudao.framework.captcha.core.service.RedisCaptchaServiceImpl; |
| 6 | +import com.xingyuv.captcha.properties.AjCaptchaProperties; | ||
| 6 | import com.xingyuv.captcha.service.CaptchaCacheService; | 7 | import com.xingyuv.captcha.service.CaptchaCacheService; |
| 8 | +import com.xingyuv.captcha.service.impl.CaptchaServiceFactory; | ||
| 7 | import org.springframework.boot.autoconfigure.AutoConfiguration; | 9 | import org.springframework.boot.autoconfigure.AutoConfiguration; |
| 8 | import org.springframework.context.annotation.Bean; | 10 | import org.springframework.context.annotation.Bean; |
| 9 | import org.springframework.data.redis.core.StringRedisTemplate; | 11 | import org.springframework.data.redis.core.StringRedisTemplate; |
| 10 | 12 | ||
| 13 | +import javax.annotation.Resource; | ||
| 14 | + | ||
| 11 | @AutoConfiguration | 15 | @AutoConfiguration |
| 12 | public class YudaoCaptchaConfiguration { | 16 | public class YudaoCaptchaConfiguration { |
| 13 | 17 | ||
| @@ -17,9 +21,17 @@ public class YudaoCaptchaConfiguration { | @@ -17,9 +21,17 @@ public class YudaoCaptchaConfiguration { | ||
| 17 | ClassUtil.loadClass(CaptchaRedisKeyConstants.class.getName()); | 21 | ClassUtil.loadClass(CaptchaRedisKeyConstants.class.getName()); |
| 18 | } | 22 | } |
| 19 | 23 | ||
| 24 | + @Resource | ||
| 25 | + private StringRedisTemplate stringRedisTemplate; | ||
| 26 | + | ||
| 20 | @Bean | 27 | @Bean |
| 21 | - public CaptchaCacheService captchaCacheService(StringRedisTemplate stringRedisTemplate) { | ||
| 22 | - return new RedisCaptchaServiceImpl(stringRedisTemplate); | 28 | + public CaptchaCacheService captchaCacheService(AjCaptchaProperties config) { |
| 29 | + // 缓存类型 redis/local/.... | ||
| 30 | + CaptchaCacheService ret = CaptchaServiceFactory.getCache(config.getCacheType().name()); | ||
| 31 | + if (ret instanceof RedisCaptchaServiceImpl) { | ||
| 32 | + ((RedisCaptchaServiceImpl) ret).setStringRedisTemplate(stringRedisTemplate); | ||
| 33 | + } | ||
| 34 | + return ret; | ||
| 23 | } | 35 | } |
| 24 | 36 | ||
| 25 | } | 37 | } |
yudao-framework/yudao-spring-boot-starter-captcha/src/main/java/cn/iocoder/yudao/framework/captcha/core/service/RedisCaptchaServiceImpl.java
| @@ -25,6 +25,10 @@ public class RedisCaptchaServiceImpl implements CaptchaCacheService { | @@ -25,6 +25,10 @@ public class RedisCaptchaServiceImpl implements CaptchaCacheService { | ||
| 25 | return "redis"; | 25 | return "redis"; |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | + public void setStringRedisTemplate(StringRedisTemplate stringRedisTemplate) { | ||
| 29 | + this.stringRedisTemplate = stringRedisTemplate; | ||
| 30 | + } | ||
| 31 | + | ||
| 28 | @Override | 32 | @Override |
| 29 | public void set(String key, String value, long expiresInSeconds) { | 33 | public void set(String key, String value, long expiresInSeconds) { |
| 30 | stringRedisTemplate.opsForValue().set(key, value, expiresInSeconds, TimeUnit.SECONDS); | 34 | stringRedisTemplate.opsForValue().set(key, value, expiresInSeconds, TimeUnit.SECONDS); |
yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/job/RedisPendingMessageResendJob.java
| @@ -7,17 +7,14 @@ import lombok.AllArgsConstructor; | @@ -7,17 +7,14 @@ import lombok.AllArgsConstructor; | ||
| 7 | import lombok.extern.slf4j.Slf4j; | 7 | import lombok.extern.slf4j.Slf4j; |
| 8 | import org.redisson.api.RLock; | 8 | import org.redisson.api.RLock; |
| 9 | import org.redisson.api.RedissonClient; | 9 | import org.redisson.api.RedissonClient; |
| 10 | -import org.springframework.data.redis.connection.stream.Consumer; | ||
| 11 | -import org.springframework.data.redis.connection.stream.MapRecord; | ||
| 12 | -import org.springframework.data.redis.connection.stream.PendingMessagesSummary; | ||
| 13 | -import org.springframework.data.redis.connection.stream.ReadOffset; | ||
| 14 | -import org.springframework.data.redis.connection.stream.StreamOffset; | ||
| 15 | -import org.springframework.data.redis.connection.stream.StreamRecords; | 10 | +import org.springframework.data.domain.Range; |
| 11 | +import org.springframework.data.redis.connection.stream.*; | ||
| 16 | import org.springframework.data.redis.core.StreamOperations; | 12 | import org.springframework.data.redis.core.StreamOperations; |
| 17 | import org.springframework.scheduling.annotation.Scheduled; | 13 | import org.springframework.scheduling.annotation.Scheduled; |
| 18 | 14 | ||
| 19 | import java.util.List; | 15 | import java.util.List; |
| 20 | import java.util.Map; | 16 | import java.util.Map; |
| 17 | +import java.util.Objects; | ||
| 21 | 18 | ||
| 22 | /** | 19 | /** |
| 23 | * 这个任务用于处理,crash 之后的消费者未消费完的消息 | 20 | * 这个任务用于处理,crash 之后的消费者未消费完的消息 |
| @@ -28,6 +25,14 @@ public class RedisPendingMessageResendJob { | @@ -28,6 +25,14 @@ public class RedisPendingMessageResendJob { | ||
| 28 | 25 | ||
| 29 | private static final String LOCK_KEY = "redis:pending:msg:lock"; | 26 | private static final String LOCK_KEY = "redis:pending:msg:lock"; |
| 30 | 27 | ||
| 28 | + /** | ||
| 29 | + * 消息超时时间,默认 5 分钟 | ||
| 30 | + * | ||
| 31 | + * 1. 超时的消息才会被重新投递 | ||
| 32 | + * 2. 由于定时任务 1 分钟一次,消息超时后不会被立即重投,极端情况下消息5分钟过期后,再等 1 分钟才会被扫瞄到 | ||
| 33 | + */ | ||
| 34 | + private static final int EXPIRE_TIME = 5 * 60; | ||
| 35 | + | ||
| 31 | private final List<AbstractStreamMessageListener<?>> listeners; | 36 | private final List<AbstractStreamMessageListener<?>> listeners; |
| 32 | private final RedisMQTemplate redisTemplate; | 37 | private final RedisMQTemplate redisTemplate; |
| 33 | private final String groupName; | 38 | private final String groupName; |
| @@ -51,29 +56,44 @@ public class RedisPendingMessageResendJob { | @@ -51,29 +56,44 @@ public class RedisPendingMessageResendJob { | ||
| 51 | } | 56 | } |
| 52 | } | 57 | } |
| 53 | 58 | ||
| 59 | + /** | ||
| 60 | + * 执行清理逻辑 | ||
| 61 | + * | ||
| 62 | + * @see <a href="https://gitee.com/zhijiantianya/ruoyi-vue-pro/pulls/480/files">讨论</a> | ||
| 63 | + */ | ||
| 54 | private void execute() { | 64 | private void execute() { |
| 55 | StreamOperations<String, Object, Object> ops = redisTemplate.getRedisTemplate().opsForStream(); | 65 | StreamOperations<String, Object, Object> ops = redisTemplate.getRedisTemplate().opsForStream(); |
| 56 | listeners.forEach(listener -> { | 66 | listeners.forEach(listener -> { |
| 57 | - PendingMessagesSummary pendingMessagesSummary = ops.pending(listener.getStreamKey(), groupName); | 67 | + PendingMessagesSummary pendingMessagesSummary = Objects.requireNonNull(ops.pending(listener.getStreamKey(), groupName)); |
| 58 | // 每个消费者的 pending 队列消息数量 | 68 | // 每个消费者的 pending 队列消息数量 |
| 59 | Map<String, Long> pendingMessagesPerConsumer = pendingMessagesSummary.getPendingMessagesPerConsumer(); | 69 | Map<String, Long> pendingMessagesPerConsumer = pendingMessagesSummary.getPendingMessagesPerConsumer(); |
| 60 | pendingMessagesPerConsumer.forEach((consumerName, pendingMessageCount) -> { | 70 | pendingMessagesPerConsumer.forEach((consumerName, pendingMessageCount) -> { |
| 61 | log.info("[processPendingMessage][消费者({}) 消息数量({})]", consumerName, pendingMessageCount); | 71 | log.info("[processPendingMessage][消费者({}) 消息数量({})]", consumerName, pendingMessageCount); |
| 62 | - | ||
| 63 | - // 从消费者的 pending 队列中读取消息 | ||
| 64 | - List<MapRecord<String, Object, Object>> records = ops.read(Consumer.from(groupName, consumerName), StreamOffset.create(listener.getStreamKey(), ReadOffset.from("0"))); | ||
| 65 | - if (CollUtil.isEmpty(records)) { | 72 | + // 每个消费者的 pending消息的详情信息 |
| 73 | + PendingMessages pendingMessages = ops.pending(listener.getStreamKey(), Consumer.from(groupName, consumerName), Range.unbounded(), pendingMessageCount); | ||
| 74 | + if (pendingMessages.isEmpty()) { | ||
| 66 | return; | 75 | return; |
| 67 | } | 76 | } |
| 68 | - for (MapRecord<String, Object, Object> record : records) { | 77 | + pendingMessages.forEach(pendingMessage -> { |
| 78 | + // 获取消息上一次传递到 consumer 的时间, | ||
| 79 | + long lastDelivery = pendingMessage.getElapsedTimeSinceLastDelivery().getSeconds(); | ||
| 80 | + if (lastDelivery < EXPIRE_TIME){ | ||
| 81 | + return; | ||
| 82 | + } | ||
| 83 | + // 获取指定 id 的消息体 | ||
| 84 | + List<MapRecord<String, Object, Object>> records = ops.range(listener.getStreamKey(), | ||
| 85 | + Range.of(Range.Bound.inclusive(pendingMessage.getIdAsString()), Range.Bound.inclusive(pendingMessage.getIdAsString()))); | ||
| 86 | + if (CollUtil.isEmpty(records)) { | ||
| 87 | + return; | ||
| 88 | + } | ||
| 69 | // 重新投递消息 | 89 | // 重新投递消息 |
| 70 | redisTemplate.getRedisTemplate().opsForStream().add(StreamRecords.newRecord() | 90 | redisTemplate.getRedisTemplate().opsForStream().add(StreamRecords.newRecord() |
| 71 | - .ofObject(record.getValue()) // 设置内容 | 91 | + .ofObject(records.get(0).getValue()) // 设置内容 |
| 72 | .withStreamKey(listener.getStreamKey())); | 92 | .withStreamKey(listener.getStreamKey())); |
| 73 | - | ||
| 74 | // ack 消息消费完成 | 93 | // ack 消息消费完成 |
| 75 | - redisTemplate.getRedisTemplate().opsForStream().acknowledge(groupName, record); | ||
| 76 | - } | 94 | + redisTemplate.getRedisTemplate().opsForStream().acknowledge(groupName, records.get(0)); |
| 95 | + log.info("[processPendingMessage][消息({})重新投递成功]", records.get(0).getId()); | ||
| 96 | + }); | ||
| 77 | }); | 97 | }); |
| 78 | }); | 98 | }); |
| 79 | } | 99 | } |
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben/views/data.ts.vm
| @@ -122,7 +122,7 @@ export const createFormSchema: FormSchema[] = [ | @@ -122,7 +122,7 @@ export const createFormSchema: FormSchema[] = [ | ||
| 122 | #end | 122 | #end |
| 123 | } | 123 | } |
| 124 | #elseif($column.htmlType == "radio")## 单选框 | 124 | #elseif($column.htmlType == "radio")## 单选框 |
| 125 | - component: 'Radio', | 125 | + component: 'RadioButtonGroup', |
| 126 | componentProps: { | 126 | componentProps: { |
| 127 | #if ("" != $dictType)## 有数据字典 | 127 | #if ("" != $dictType)## 有数据字典 |
| 128 | options: getDictOptions(DICT_TYPE.$dictType.toUpperCase(), 'number') | 128 | options: getDictOptions(DICT_TYPE.$dictType.toUpperCase(), 'number') |
| @@ -188,7 +188,7 @@ export const updateFormSchema: FormSchema[] = [ | @@ -188,7 +188,7 @@ export const updateFormSchema: FormSchema[] = [ | ||
| 188 | #end | 188 | #end |
| 189 | } | 189 | } |
| 190 | #elseif($column.htmlType == "radio")## 单选框 | 190 | #elseif($column.htmlType == "radio")## 单选框 |
| 191 | - component: 'Radio', | 191 | + component: 'RadioButtonGroup', |
| 192 | componentProps: { | 192 | componentProps: { |
| 193 | #if ("" != $dictType)## 有数据字典 | 193 | #if ("" != $dictType)## 有数据字典 |
| 194 | options: getDictOptions(DICT_TYPE.$dictType.toUpperCase(), 'number') | 194 | options: getDictOptions(DICT_TYPE.$dictType.toUpperCase(), 'number') |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/MpTagController.java
| @@ -52,6 +52,14 @@ public class MpTagController { | @@ -52,6 +52,14 @@ public class MpTagController { | ||
| 52 | return success(true); | 52 | return success(true); |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | + @GetMapping("/get") | ||
| 56 | + @Operation(summary = "获取公众号标签详情") | ||
| 57 | + @PreAuthorize("@ss.hasPermission('mp:tag:query')") | ||
| 58 | + public CommonResult<MpTagRespVO> get(@RequestParam("id") Long id) { | ||
| 59 | + MpTagDO mpTagDO = mpTagService.get(id); | ||
| 60 | + return success(MpTagConvert.INSTANCE.convert(mpTagDO)); | ||
| 61 | + } | ||
| 62 | + | ||
| 55 | @GetMapping("/page") | 63 | @GetMapping("/page") |
| 56 | @Operation(summary = "获取公众号标签分页") | 64 | @Operation(summary = "获取公众号标签分页") |
| 57 | @PreAuthorize("@ss.hasPermission('mp:tag:query')") | 65 | @PreAuthorize("@ss.hasPermission('mp:tag:query')") |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/tag/MpTagConvert.java
| @@ -37,6 +37,8 @@ public interface MpTagConvert { | @@ -37,6 +37,8 @@ public interface MpTagConvert { | ||
| 37 | }) | 37 | }) |
| 38 | MpTagDO convert(WxUserTag tag, MpAccountDO account); | 38 | MpTagDO convert(WxUserTag tag, MpAccountDO account); |
| 39 | 39 | ||
| 40 | + MpTagRespVO convert(MpTagDO mpTagDO); | ||
| 41 | + | ||
| 40 | List<MpTagSimpleRespVO> convertList02(List<MpTagDO> list); | 42 | List<MpTagSimpleRespVO> convertList02(List<MpTagDO> list); |
| 41 | 43 | ||
| 42 | } | 44 | } |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/MpTagService.java
| @@ -46,6 +46,13 @@ public interface MpTagService { | @@ -46,6 +46,13 @@ public interface MpTagService { | ||
| 46 | */ | 46 | */ |
| 47 | PageResult<MpTagDO> getTagPage(MpTagPageReqVO pageReqVO); | 47 | PageResult<MpTagDO> getTagPage(MpTagPageReqVO pageReqVO); |
| 48 | 48 | ||
| 49 | + /** | ||
| 50 | + * 获得公众号标签详情 | ||
| 51 | + * @param id id查询 | ||
| 52 | + * @return 公众号标签详情 | ||
| 53 | + */ | ||
| 54 | + MpTagDO get(Long id); | ||
| 55 | + | ||
| 49 | List<MpTagDO> getTagList(); | 56 | List<MpTagDO> getTagList(); |
| 50 | 57 | ||
| 51 | /** | 58 | /** |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/MpTagServiceImpl.java
| @@ -117,6 +117,11 @@ public class MpTagServiceImpl implements MpTagService { | @@ -117,6 +117,11 @@ public class MpTagServiceImpl implements MpTagService { | ||
| 117 | } | 117 | } |
| 118 | 118 | ||
| 119 | @Override | 119 | @Override |
| 120 | + public MpTagDO get(Long id) { | ||
| 121 | + return mpTagMapper.selectById(id); | ||
| 122 | + } | ||
| 123 | + | ||
| 124 | + @Override | ||
| 120 | public List<MpTagDO> getTagList() { | 125 | public List<MpTagDO> getTagList() { |
| 121 | return mpTagMapper.selectList(); | 126 | return mpTagMapper.selectList(); |
| 122 | } | 127 | } |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailTemplateController.java
| @@ -18,6 +18,7 @@ import javax.validation.Valid; | @@ -18,6 +18,7 @@ import javax.validation.Valid; | ||
| 18 | import java.util.List; | 18 | import java.util.List; |
| 19 | 19 | ||
| 20 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | 20 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 21 | +import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; | ||
| 21 | 22 | ||
| 22 | @Tag(name = "管理后台 - 邮件模版") | 23 | @Tag(name = "管理后台 - 邮件模版") |
| 23 | @RestController | 24 | @RestController |
| @@ -81,7 +82,7 @@ public class MailTemplateController { | @@ -81,7 +82,7 @@ public class MailTemplateController { | ||
| 81 | @Operation(summary = "发送短信") | 82 | @Operation(summary = "发送短信") |
| 82 | @PreAuthorize("@ss.hasPermission('system:mail-template:send-mail')") | 83 | @PreAuthorize("@ss.hasPermission('system:mail-template:send-mail')") |
| 83 | public CommonResult<Long> sendMail(@Valid @RequestBody MailTemplateSendReqVO sendReqVO) { | 84 | public CommonResult<Long> sendMail(@Valid @RequestBody MailTemplateSendReqVO sendReqVO) { |
| 84 | - return success(mailSendService.sendSingleMailToAdmin(sendReqVO.getMail(), null, | 85 | + return success(mailSendService.sendSingleMailToAdmin(sendReqVO.getMail(), getLoginUserId(), |
| 85 | sendReqVO.getTemplateCode(), sendReqVO.getTemplateParams())); | 86 | sendReqVO.getTemplateCode(), sendReqVO.getTemplateParams())); |
| 86 | } | 87 | } |
| 87 | 88 |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/redis/oauth2/OAuth2AccessTokenRedisDAO.java
| @@ -37,7 +37,9 @@ public class OAuth2AccessTokenRedisDAO { | @@ -37,7 +37,9 @@ public class OAuth2AccessTokenRedisDAO { | ||
| 37 | // 清理多余字段,避免缓存 | 37 | // 清理多余字段,避免缓存 |
| 38 | accessTokenDO.setUpdater(null).setUpdateTime(null).setCreateTime(null).setCreator(null).setDeleted(null); | 38 | accessTokenDO.setUpdater(null).setUpdateTime(null).setCreateTime(null).setCreator(null).setDeleted(null); |
| 39 | long time = LocalDateTimeUtil.between(LocalDateTime.now(), accessTokenDO.getExpiresTime(), ChronoUnit.SECONDS); | 39 | long time = LocalDateTimeUtil.between(LocalDateTime.now(), accessTokenDO.getExpiresTime(), ChronoUnit.SECONDS); |
| 40 | - stringRedisTemplate.opsForValue().set(redisKey, JsonUtils.toJsonString(accessTokenDO), time, TimeUnit.SECONDS); | 40 | + if (time > 0) { |
| 41 | + stringRedisTemplate.opsForValue().set(redisKey, JsonUtils.toJsonString(accessTokenDO), time, TimeUnit.SECONDS); | ||
| 42 | + } | ||
| 41 | } | 43 | } |
| 42 | 44 | ||
| 43 | public void delete(String accessToken) { | 45 | public void delete(String accessToken) { |
yudao-server/pom.xml
| @@ -111,7 +111,7 @@ | @@ -111,7 +111,7 @@ | ||
| 111 | <plugin> | 111 | <plugin> |
| 112 | <groupId>org.springframework.boot</groupId> | 112 | <groupId>org.springframework.boot</groupId> |
| 113 | <artifactId>spring-boot-maven-plugin</artifactId> | 113 | <artifactId>spring-boot-maven-plugin</artifactId> |
| 114 | - <version>2.7.11</version> <!-- 如果 spring.boot.version 版本修改,则这里也要跟着修改 --> | 114 | + <version>2.7.12</version> <!-- 如果 spring.boot.version 版本修改,则这里也要跟着修改 --> |
| 115 | <configuration> | 115 | <configuration> |
| 116 | <fork>true</fork> | 116 | <fork>true</fork> |
| 117 | </configuration> | 117 | </configuration> |