Commit c04ef59e81adfa519dbea7b401e1de47bc2cfcb7
Merge branch 'master' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into feature/vue3-bpm
Showing
244 changed files
with
10562 additions
and
897 deletions
Too many changes.
To preserve performance only 100 of 244 files are displayed.
README.md
| ... | ... | @@ -41,7 +41,20 @@ |
| 41 | 41 | | `ruoyi-vue-pro` | Spring Boot 多模块 | **[Gitee](https://gitee.com/zhijiantianya/ruoyi-vue-pro)** [Github](https://github.com/YunaiV/ruoyi-vue-pro) | |
| 42 | 42 | | `yudao-cloud` | Spring Cloud 微服务 | **[Gitee](https://gitee.com/zhijiantianya/yudao-cloud)** [Github](https://github.com/YunaiV/yudao-cloud) | |
| 43 | 43 | | `Spring-Boot-Labs` | Spring Boot & Cloud 入门 | **[Gitee](https://gitee.com/zhijiantianya/SpringBoot-Labs)** [Github](https://github.com/YunaiV/SpringBoot-Labs) | |
| 44 | - | `ruoyi-vue-pro-mini` | 精简版:移除工作流、支付等模块 | **[Gitee](https://gitee.com/zhijiantianya/ruoyi-vue-pro/tree/mini)** | | |
| 44 | + | |
| 45 | +## 🐰 分支说明 | |
| 46 | + | |
| 47 | +| | JDK 8 完整版 | JDK 8 精简版 | JDK 17 完整版 | | |
| 48 | +|-------|-----------------------------------------------------------|--------------------------------------------------------------------|-----------------------------------------------------------------------------| | |
| 49 | +| 分支 | [`master`](https://gitee.com/zhijiantianya/ruoyi-vue-pro) | [`mini`](https://gitee.com/zhijiantianya/ruoyi-vue-pro/tree/mini/) | [`boot-dev`](https://gitee.com/zhijiantianya/ruoyi-vue-pro/tree/boot3-dev/) | | |
| 50 | +| 说明 | 包括所有功能 | 只保留核心功能 | 适配 Spring Boot 3.X | | |
| 51 | +| 系统功能 | √ | √ | √ | | |
| 52 | +| 基础设施 | √ | √ | √ | | |
| 53 | +| 会员中心 | √ | √ | √ | | |
| 54 | +| 工作流程 | √ | x | 适配中 | | |
| 55 | +| 数据报表 | √ | x | 适配中 | | |
| 56 | +| 商城系统 | √ | x | √ | | |
| 57 | +| 微信公众号 | √ | x | √ | | |
| 45 | 58 | |
| 46 | 59 | ## 😎 开源协议 |
| 47 | 60 | |
| ... | ... | @@ -55,6 +68,14 @@ |
| 55 | 68 | |
| 56 | 69 | ③ 代码整洁、架构整洁,遵循《阿里巴巴 Java 开发手册》规范,代码注释详细,57000 行 Java 代码,22000 行代码注释。 |
| 57 | 70 | |
| 71 | +## 🤝 项目外包 | |
| 72 | + | |
| 73 | +我们也是接外包滴,如果你有项目想要外包,可以微信联系【**Aix9975**】。 | |
| 74 | + | |
| 75 | +团队包含专业的项目经理、架构师、前端工程师、后端工程师、测试工程师、运维工程师,可以提供全流程的外包服务。 | |
| 76 | + | |
| 77 | +项目可以是商城、SCRM 系统、OA 系统、物流系统、ERP 系统、CMS 系统、HIS 系统、支付系统、IM 聊天、微信公众号、微信小程序等等。 | |
| 78 | + | |
| 58 | 79 | ## 🐼 内置功能 |
| 59 | 80 | |
| 60 | 81 | 系统内置多种多种业务功能,可以用于快速你的业务系统: |
| ... | ... | @@ -91,6 +112,8 @@ |
| 91 | 112 | | 🚀 | 租户套餐 | 配置租户套餐,自定每个租户的菜单、操作、按钮的权限 | |
| 92 | 113 | | | 字典管理 | 对系统中经常使用的一些较为固定的数据进行维护 | |
| 93 | 114 | | 🚀 | 短信管理 | 短信渠道、短息模板、短信日志,对接阿里云、腾讯云等主流短信平台 | |
| 115 | +| 🚀 | 邮件管理 | 邮箱账号、邮件模版、邮件发送日志,支持所有邮件平台 | | |
| 116 | +| 🚀 | 站内信 | 系统内的消息通知,提供站内信模版、站内信消息 | | |
| 94 | 117 | | 🚀 | 操作日志 | 系统正常操作日志记录和查询,集成 Swagger 生成日志内容 | |
| 95 | 118 | | ⭐️ | 登录日志 | 系统登录日志记录查询,包含登录异常 | |
| 96 | 119 | | 🚀 | 错误码管理 | 系统所有错误码的管理,可在线修改错误提示,无需重启服务 | | ... | ... |
pom.xml
| ... | ... | @@ -30,7 +30,7 @@ |
| 30 | 30 | <url>https://github.com/YunaiV/ruoyi-vue-pro</url> |
| 31 | 31 | |
| 32 | 32 | <properties> |
| 33 | - <revision>1.6.6-snapshot</revision> | |
| 33 | + <revision>1.7.0-snapshot</revision> | |
| 34 | 34 | <!-- Maven 相关 --> |
| 35 | 35 | <java.version>1.8</java.version> |
| 36 | 36 | <maven.compiler.source>${java.version}</maven.compiler.source> | ... | ... |
sql/mysql/ruoyi-vue-pro.sql
| ... | ... | @@ -11,7 +11,7 @@ |
| 11 | 11 | Target Server Version : 80026 |
| 12 | 12 | File Encoding : 65001 |
| 13 | 13 | |
| 14 | - Date: 17/01/2023 23:47:35 | |
| 14 | + Date: 27/01/2023 20:57:31 | |
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | 17 | SET NAMES utf8mb4; |
| ... | ... | @@ -300,7 +300,7 @@ CREATE TABLE `bpm_form` ( |
| 300 | 300 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 301 | 301 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 302 | 302 | PRIMARY KEY (`id`) USING BTREE |
| 303 | -) ENGINE = InnoDB AUTO_INCREMENT = 20 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '工作流的表单定义'; | |
| 303 | +) ENGINE = InnoDB AUTO_INCREMENT = 24 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '工作流的表单定义'; | |
| 304 | 304 | |
| 305 | 305 | -- ---------------------------- |
| 306 | 306 | -- Records of bpm_form |
| ... | ... | @@ -329,7 +329,7 @@ CREATE TABLE `bpm_oa_leave` ( |
| 329 | 329 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 330 | 330 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 331 | 331 | PRIMARY KEY (`id`) USING BTREE |
| 332 | -) ENGINE = InnoDB AUTO_INCREMENT = 33 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OA 请假申请表'; | |
| 332 | +) ENGINE = InnoDB AUTO_INCREMENT = 35 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OA 请假申请表'; | |
| 333 | 333 | |
| 334 | 334 | -- ---------------------------- |
| 335 | 335 | -- Records of bpm_oa_leave |
| ... | ... | @@ -359,7 +359,7 @@ CREATE TABLE `bpm_process_definition_ext` ( |
| 359 | 359 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 360 | 360 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 361 | 361 | PRIMARY KEY (`id`) USING BTREE |
| 362 | -) ENGINE = InnoDB AUTO_INCREMENT = 135 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'Bpm 流程定义的拓展表\n'; | |
| 362 | +) ENGINE = InnoDB AUTO_INCREMENT = 140 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'Bpm 流程定义的拓展表\n'; | |
| 363 | 363 | |
| 364 | 364 | -- ---------------------------- |
| 365 | 365 | -- Records of bpm_process_definition_ext |
| ... | ... | @@ -389,7 +389,7 @@ CREATE TABLE `bpm_process_instance_ext` ( |
| 389 | 389 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 390 | 390 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 391 | 391 | PRIMARY KEY (`id`) USING BTREE |
| 392 | -) ENGINE = InnoDB AUTO_INCREMENT = 290 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '工作流的流程实例的拓展'; | |
| 392 | +) ENGINE = InnoDB AUTO_INCREMENT = 295 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '工作流的流程实例的拓展'; | |
| 393 | 393 | |
| 394 | 394 | -- ---------------------------- |
| 395 | 395 | -- Records of bpm_process_instance_ext |
| ... | ... | @@ -415,7 +415,7 @@ CREATE TABLE `bpm_task_assign_rule` ( |
| 415 | 415 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 416 | 416 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 417 | 417 | PRIMARY KEY (`id`) USING BTREE |
| 418 | -) ENGINE = InnoDB AUTO_INCREMENT = 265 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'Bpm 任务规则表'; | |
| 418 | +) ENGINE = InnoDB AUTO_INCREMENT = 274 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'Bpm 任务规则表'; | |
| 419 | 419 | |
| 420 | 420 | -- ---------------------------- |
| 421 | 421 | -- Records of bpm_task_assign_rule |
| ... | ... | @@ -444,7 +444,7 @@ CREATE TABLE `bpm_task_ext` ( |
| 444 | 444 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 445 | 445 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 446 | 446 | PRIMARY KEY (`id`) USING BTREE |
| 447 | -) ENGINE = InnoDB AUTO_INCREMENT = 341 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '工作流的流程任务的拓展表'; | |
| 447 | +) ENGINE = InnoDB AUTO_INCREMENT = 350 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '工作流的流程任务的拓展表'; | |
| 448 | 448 | |
| 449 | 449 | -- ---------------------------- |
| 450 | 450 | -- Records of bpm_task_ext |
| ... | ... | @@ -469,7 +469,7 @@ CREATE TABLE `bpm_user_group` ( |
| 469 | 469 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 470 | 470 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 471 | 471 | PRIMARY KEY (`id`) USING BTREE |
| 472 | -) ENGINE = InnoDB AUTO_INCREMENT = 111 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户组'; | |
| 472 | +) ENGINE = InnoDB AUTO_INCREMENT = 113 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '用户组'; | |
| 473 | 473 | |
| 474 | 474 | -- ---------------------------- |
| 475 | 475 | -- Records of bpm_user_group |
| ... | ... | @@ -546,7 +546,7 @@ CREATE TABLE `infra_api_error_log` ( |
| 546 | 546 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 547 | 547 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 548 | 548 | PRIMARY KEY (`id`) USING BTREE |
| 549 | -) ENGINE = InnoDB AUTO_INCREMENT = 931 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统异常日志'; | |
| 549 | +) ENGINE = InnoDB AUTO_INCREMENT = 965 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统异常日志'; | |
| 550 | 550 | |
| 551 | 551 | -- ---------------------------- |
| 552 | 552 | -- Records of infra_api_error_log |
| ... | ... | @@ -584,7 +584,7 @@ CREATE TABLE `infra_codegen_column` ( |
| 584 | 584 | `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', |
| 585 | 585 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 586 | 586 | PRIMARY KEY (`id`) USING BTREE |
| 587 | -) ENGINE = InnoDB AUTO_INCREMENT = 1533 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '代码生成表字段定义'; | |
| 587 | +) ENGINE = InnoDB AUTO_INCREMENT = 1612 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '代码生成表字段定义'; | |
| 588 | 588 | |
| 589 | 589 | -- ---------------------------- |
| 590 | 590 | -- Records of infra_codegen_column |
| ... | ... | @@ -616,7 +616,7 @@ CREATE TABLE `infra_codegen_table` ( |
| 616 | 616 | `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', |
| 617 | 617 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 618 | 618 | PRIMARY KEY (`id`) USING BTREE |
| 619 | -) ENGINE = InnoDB AUTO_INCREMENT = 119 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '代码生成表定义'; | |
| 619 | +) ENGINE = InnoDB AUTO_INCREMENT = 124 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '代码生成表定义'; | |
| 620 | 620 | |
| 621 | 621 | -- ---------------------------- |
| 622 | 622 | -- Records of infra_codegen_table |
| ... | ... | @@ -699,7 +699,7 @@ CREATE TABLE `infra_file` ( |
| 699 | 699 | `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', |
| 700 | 700 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 701 | 701 | PRIMARY KEY (`id`) USING BTREE |
| 702 | -) ENGINE = InnoDB AUTO_INCREMENT = 355 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表'; | |
| 702 | +) ENGINE = InnoDB AUTO_INCREMENT = 356 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '文件表'; | |
| 703 | 703 | |
| 704 | 704 | -- ---------------------------- |
| 705 | 705 | -- Records of infra_file |
| ... | ... | @@ -1191,7 +1191,7 @@ CREATE TABLE `system_dict_data` ( |
| 1191 | 1191 | `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', |
| 1192 | 1192 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 1193 | 1193 | PRIMARY KEY (`id`) USING BTREE |
| 1194 | -) ENGINE = InnoDB AUTO_INCREMENT = 1213 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典数据表'; | |
| 1194 | +) ENGINE = InnoDB AUTO_INCREMENT = 1229 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典数据表'; | |
| 1195 | 1195 | |
| 1196 | 1196 | -- ---------------------------- |
| 1197 | 1197 | -- Records of system_dict_data |
| ... | ... | @@ -1391,6 +1391,12 @@ INSERT INTO `system_dict_data` (`id`, `sort`, `label`, `value`, `dict_type`, `st |
| 1391 | 1391 | 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 (1220, 8, '地理位置', 'location', 'mp_message_type', 0, 'default', '', '公众号的消息类型 - 地理位置', '1', '2023-01-17 22:17:32', '1', '2023-01-17 14:23:51', b'0'); |
| 1392 | 1392 | 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 (1221, 9, '链接', 'link', 'mp_message_type', 0, 'default', '', '公众号的消息类型 - 链接', '1', '2023-01-17 22:17:32', '1', '2023-01-17 14:24:49', b'0'); |
| 1393 | 1393 | 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 (1222, 10, '事件', 'event', 'mp_message_type', 0, 'default', '', '公众号的消息类型 - 事件', '1', '2023-01-17 22:17:32', '1', '2023-01-17 14:24:49', b'0'); |
| 1394 | +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 (1223, 0, '初始化', '0', 'system_mail_send_status', 0, 'primary', '', '邮件发送状态 - 初始化\n', '1', '2023-01-26 09:53:49', '1', '2023-01-26 16:36:14', b'0'); | |
| 1395 | +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 (1224, 10, '发送成功', '10', 'system_mail_send_status', 0, 'success', '', '邮件发送状态 - 发送成功', '1', '2023-01-26 09:54:28', '1', '2023-01-26 16:36:22', b'0'); | |
| 1396 | +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 (1225, 20, '发送失败', '20', 'system_mail_send_status', 0, 'danger', '', '邮件发送状态 - 发送失败', '1', '2023-01-26 09:54:50', '1', '2023-01-26 16:36:26', b'0'); | |
| 1397 | +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 (1226, 30, '不发送', '30', 'system_mail_send_status', 0, 'info', '', '邮件发送状态 - 不发送', '1', '2023-01-26 09:55:06', '1', '2023-01-26 16:36:36', b'0'); | |
| 1398 | +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 (1227, 1, '通知公告', '1', 'system_notify_template_type', 0, 'primary', '', '站内信模版的类型 - 通知公告', '1', '2023-01-28 10:35:59', '1', '2023-01-28 10:35:59', b'0'); | |
| 1399 | +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 (1228, 2, '系统消息', '2', 'system_notify_template_type', 0, 'success', '', '站内信模版的类型 - 系统消息', '1', '2023-01-28 10:36:20', '1', '2023-01-28 10:36:25', b'0'); | |
| 1394 | 1400 | COMMIT; |
| 1395 | 1401 | |
| 1396 | 1402 | -- ---------------------------- |
| ... | ... | @@ -1411,7 +1417,7 @@ CREATE TABLE `system_dict_type` ( |
| 1411 | 1417 | `deleted_time` datetime NULL DEFAULT NULL COMMENT '删除时间', |
| 1412 | 1418 | PRIMARY KEY (`id`) USING BTREE, |
| 1413 | 1419 | UNIQUE INDEX `dict_type`(`type` ASC) USING BTREE |
| 1414 | -) ENGINE = InnoDB AUTO_INCREMENT = 165 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典类型表'; | |
| 1420 | +) ENGINE = InnoDB AUTO_INCREMENT = 168 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '字典类型表'; | |
| 1415 | 1421 | |
| 1416 | 1422 | -- ---------------------------- |
| 1417 | 1423 | -- Records of system_dict_type |
| ... | ... | @@ -1474,6 +1480,8 @@ INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creat |
| 1474 | 1480 | INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (163, '交易订单项的售后状态', 'trade_order_item_after_sale_status', 0, '交易订单项的售后状态', '1', '2022-12-10 20:58:08', '1', '2022-12-10 20:58:08', b'0', NULL); |
| 1475 | 1481 | INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (164, '公众号自动回复的请求关键字匹配模式', 'mp_auto_reply_request_match', 0, '公众号自动回复的请求关键字匹配模式', '1', '2023-01-16 23:29:56', '1', '2023-01-16 23:29:56', b'0', '1970-01-01 00:00:00'); |
| 1476 | 1482 | INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (165, '公众号的消息类型', 'mp_message_type', 0, '公众号的消息类型', '1', '2023-01-17 22:17:09', '1', '2023-01-17 22:17:09', b'0', '1970-01-01 00:00:00'); |
| 1483 | +INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (166, '邮件发送状态', 'system_mail_send_status', 0, '邮件发送状态', '1', '2023-01-26 09:53:13', '1', '2023-01-26 09:53:13', b'0', '1970-01-01 00:00:00'); | |
| 1484 | +INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (167, '站内信模版的类型', 'system_notify_template_type', 0, '站内信模版的类型', '1', '2023-01-28 10:35:10', '1', '2023-01-28 10:35:10', b'0', '1970-01-01 00:00:00'); | |
| 1477 | 1485 | COMMIT; |
| 1478 | 1486 | |
| 1479 | 1487 | -- ---------------------------- |
| ... | ... | @@ -1522,7 +1530,7 @@ CREATE TABLE `system_login_log` ( |
| 1522 | 1530 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 1523 | 1531 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 1524 | 1532 | PRIMARY KEY (`id`) USING BTREE |
| 1525 | -) ENGINE = InnoDB AUTO_INCREMENT = 1963 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统访问记录'; | |
| 1533 | +) ENGINE = InnoDB AUTO_INCREMENT = 1985 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '系统访问记录'; | |
| 1526 | 1534 | |
| 1527 | 1535 | -- ---------------------------- |
| 1528 | 1536 | -- Records of system_login_log |
| ... | ... | @@ -1531,6 +1539,102 @@ BEGIN; |
| 1531 | 1539 | COMMIT; |
| 1532 | 1540 | |
| 1533 | 1541 | -- ---------------------------- |
| 1542 | +-- Table structure for system_mail_account | |
| 1543 | +-- ---------------------------- | |
| 1544 | +DROP TABLE IF EXISTS `system_mail_account`; | |
| 1545 | +CREATE TABLE `system_mail_account` ( | |
| 1546 | + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键', | |
| 1547 | + `mail` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '邮箱', | |
| 1548 | + `username` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '用户名', | |
| 1549 | + `password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '密码', | |
| 1550 | + `host` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'SMTP 服务器域名', | |
| 1551 | + `port` int NOT NULL COMMENT 'SMTP 服务器端口', | |
| 1552 | + `ssl_enable` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否开启 SSL', | |
| 1553 | + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者', | |
| 1554 | + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |
| 1555 | + `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者', | |
| 1556 | + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', | |
| 1557 | + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', | |
| 1558 | + PRIMARY KEY (`id`) USING BTREE | |
| 1559 | +) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '邮箱账号表'; | |
| 1560 | + | |
| 1561 | +-- ---------------------------- | |
| 1562 | +-- Records of system_mail_account | |
| 1563 | +-- ---------------------------- | |
| 1564 | +BEGIN; | |
| 1565 | +INSERT INTO `system_mail_account` (`id`, `mail`, `username`, `password`, `host`, `port`, `ssl_enable`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (1, '7684413@qq.com', '7684413@qq.com', '123457', '127.0.0.1', 8080, b'0', '1', '2023-01-25 17:39:52', '1', '2023-01-26 22:59:04', b'0'); | |
| 1566 | +INSERT INTO `system_mail_account` (`id`, `mail`, `username`, `password`, `host`, `port`, `ssl_enable`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2, 'ydym_test@163.com', 'ydym_test@163.com', 'WBZTEINMIFVRYSOE', 'smtp.163.com', 465, b'1', '1', '2023-01-26 01:26:03', '1', '2023-01-26 01:26:03', b'0'); | |
| 1567 | +INSERT INTO `system_mail_account` (`id`, `mail`, `username`, `password`, `host`, `port`, `ssl_enable`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (3, '76854114@qq.com', '3335', '11234', 'yunai1.cn', 466, b'0', '1', '2023-01-27 15:06:38', '1', '2023-01-27 07:08:36', b'1'); | |
| 1568 | +COMMIT; | |
| 1569 | + | |
| 1570 | +-- ---------------------------- | |
| 1571 | +-- Table structure for system_mail_log | |
| 1572 | +-- ---------------------------- | |
| 1573 | +DROP TABLE IF EXISTS `system_mail_log`; | |
| 1574 | +CREATE TABLE `system_mail_log` ( | |
| 1575 | + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号', | |
| 1576 | + `user_id` bigint NULL DEFAULT NULL COMMENT '用户编号', | |
| 1577 | + `user_type` tinyint NULL DEFAULT NULL COMMENT '用户类型', | |
| 1578 | + `to_mail` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '接收邮箱地址', | |
| 1579 | + `account_id` bigint NOT NULL COMMENT '邮箱账号编号', | |
| 1580 | + `from_mail` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '发送邮箱地址', | |
| 1581 | + `template_id` bigint NOT NULL COMMENT '模板编号', | |
| 1582 | + `template_code` varchar(63) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '模板编码', | |
| 1583 | + `template_nickname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '模版发送人名称', | |
| 1584 | + `template_title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '邮件标题', | |
| 1585 | + `template_content` varchar(10240) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '邮件内容', | |
| 1586 | + `template_params` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '邮件参数', | |
| 1587 | + `send_status` tinyint NOT NULL DEFAULT 0 COMMENT '发送状态', | |
| 1588 | + `send_time` datetime NULL DEFAULT NULL COMMENT '发送时间', | |
| 1589 | + `send_message_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '发送返回的消息 ID', | |
| 1590 | + `send_exception` varchar(4096) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '发送异常', | |
| 1591 | + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者', | |
| 1592 | + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |
| 1593 | + `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者', | |
| 1594 | + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', | |
| 1595 | + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', | |
| 1596 | + PRIMARY KEY (`id`) USING BTREE | |
| 1597 | +) ENGINE = InnoDB AUTO_INCREMENT = 354 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '邮件日志表'; | |
| 1598 | + | |
| 1599 | +-- ---------------------------- | |
| 1600 | +-- Records of system_mail_log | |
| 1601 | +-- ---------------------------- | |
| 1602 | +BEGIN; | |
| 1603 | +COMMIT; | |
| 1604 | + | |
| 1605 | +-- ---------------------------- | |
| 1606 | +-- Table structure for system_mail_template | |
| 1607 | +-- ---------------------------- | |
| 1608 | +DROP TABLE IF EXISTS `system_mail_template`; | |
| 1609 | +CREATE TABLE `system_mail_template` ( | |
| 1610 | + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '编号', | |
| 1611 | + `name` varchar(63) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '模板名称', | |
| 1612 | + `code` varchar(63) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '模板编码', | |
| 1613 | + `account_id` bigint NOT NULL COMMENT '发送的邮箱账号编号', | |
| 1614 | + `nickname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '发送人名称', | |
| 1615 | + `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '模板标题', | |
| 1616 | + `content` varchar(10240) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '模板内容', | |
| 1617 | + `params` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '参数数组', | |
| 1618 | + `status` tinyint NOT NULL COMMENT '开启状态', | |
| 1619 | + `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注', | |
| 1620 | + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者', | |
| 1621 | + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |
| 1622 | + `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者', | |
| 1623 | + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', | |
| 1624 | + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', | |
| 1625 | + PRIMARY KEY (`id`) USING BTREE | |
| 1626 | +) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '邮件模版表'; | |
| 1627 | + | |
| 1628 | +-- ---------------------------- | |
| 1629 | +-- Records of system_mail_template | |
| 1630 | +-- ---------------------------- | |
| 1631 | +BEGIN; | |
| 1632 | +INSERT INTO `system_mail_template` (`id`, `name`, `code`, `account_id`, `nickname`, `title`, `content`, `params`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (13, '后台用户短信登录', 'admin-sms-login', 1, '奥特曼', '你猜我猜', '<p>您的验证码是{code},名字是{name}</p>', '[\"code\",\"name\"]', 0, '3', '1', '2021-10-11 08:10:00', '1', '2023-01-26 23:22:05', b'0'); | |
| 1633 | +INSERT INTO `system_mail_template` (`id`, `name`, `code`, `account_id`, `nickname`, `title`, `content`, `params`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (14, '测试模版', 'test_01', 2, '芋艿', '一个标题', '<p>你是 {key01} 吗?</p><p><br></p><p>是的话,赶紧 {key02} 一下!</p>', '[\"key01\",\"key02\"]', 0, NULL, '1', '2023-01-26 01:27:40', '1', '2023-01-27 10:32:16', b'0'); | |
| 1634 | +INSERT INTO `system_mail_template` (`id`, `name`, `code`, `account_id`, `nickname`, `title`, `content`, `params`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (15, '3', '2', 2, '7', '4', '<p>45</p>', '[]', 1, '80', '1', '2023-01-27 15:50:35', '1', '2023-01-27 16:34:49', b'0'); | |
| 1635 | +COMMIT; | |
| 1636 | + | |
| 1637 | +-- ---------------------------- | |
| 1534 | 1638 | -- Table structure for system_menu |
| 1535 | 1639 | -- ---------------------------- |
| 1536 | 1640 | DROP TABLE IF EXISTS `system_menu`; |
| ... | ... | @@ -1553,7 +1657,7 @@ CREATE TABLE `system_menu` ( |
| 1553 | 1657 | `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', |
| 1554 | 1658 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 1555 | 1659 | PRIMARY KEY (`id`) USING BTREE |
| 1556 | -) ENGINE = InnoDB AUTO_INCREMENT = 2125 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '菜单权限表'; | |
| 1660 | +) ENGINE = InnoDB AUTO_INCREMENT = 2153 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '菜单权限表'; | |
| 1557 | 1661 | |
| 1558 | 1662 | -- ---------------------------- |
| 1559 | 1663 | -- Records of system_menu |
| ... | ... | @@ -1776,7 +1880,7 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i |
| 1776 | 1880 | 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`) VALUES (1250, '敏感词更新', 'system:sensitive-word:update', 3, 3, 1247, '', '', '', 0, b'1', b'1', '', '2022-04-07 16:55:03', '', '2022-04-20 17:03:10', b'0'); |
| 1777 | 1881 | 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`) VALUES (1251, '敏感词删除', 'system:sensitive-word:delete', 3, 4, 1247, '', '', '', 0, b'1', b'1', '', '2022-04-07 16:55:03', '', '2022-04-20 17:03:10', b'0'); |
| 1778 | 1882 | 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`) VALUES (1252, '敏感词导出', 'system:sensitive-word:export', 3, 5, 1247, '', '', '', 0, b'1', b'1', '', '2022-04-07 16:55:03', '', '2022-04-20 17:03:10', b'0'); |
| 1779 | -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`) VALUES (1254, '作者动态', '', 1, 0, 0, 'https://www.iocoder.cn', 'people', NULL, 0, b'1', b'1', '1', '2022-04-23 01:03:15', '1', '2022-06-22 13:35:05', b'0'); | |
| 1883 | +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`) VALUES (1254, '作者动态', '', 1, 0, 0, 'https://www.iocoder.cn', 'people', NULL, 0, b'1', b'1', '1', '2022-04-23 01:03:15', '1', '2023-01-28 12:33:52', b'0'); | |
| 1780 | 1884 | 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`) VALUES (1255, '数据源配置', '', 2, 1, 2, 'data-source-config', 'rate', 'infra/dataSourceConfig/index', 0, b'1', b'1', '', '2022-04-27 14:37:32', '1', '2022-04-27 22:42:06', b'0'); |
| 1781 | 1885 | 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`) VALUES (1256, '数据源配置查询', 'infra:data-source-config:query', 3, 1, 1255, '', '', '', 0, b'1', b'1', '', '2022-04-27 14:37:32', '', '2022-04-27 14:37:32', b'0'); |
| 1782 | 1886 | 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`) VALUES (1257, '数据源配置创建', 'infra:data-source-config:create', 3, 2, 1255, '', '', '', 0, b'1', b'1', '', '2022-04-27 14:37:32', '', '2022-04-27 14:37:32', b'0'); |
| ... | ... | @@ -1908,6 +2012,29 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i |
| 1908 | 2012 | 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`) VALUES (2127, '删除菜单', 'mp:menu:delete', 3, 2, 2119, '', '', '', 0, b'1', b'1', '1', '2023-01-17 23:06:16', '1', '2023-01-17 23:06:16', b'0'); |
| 1909 | 2013 | 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`) VALUES (2128, '查询消息', 'mp:message:query', 3, 0, 2103, '', '', '', 0, b'1', b'1', '1', '2023-01-17 23:07:14', '1', '2023-01-17 23:07:14', b'0'); |
| 1910 | 2014 | 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`) VALUES (2129, '发送消息', 'mp:message:send', 3, 1, 2103, '', '', '', 0, b'1', b'1', '1', '2023-01-17 23:07:26', '1', '2023-01-17 23:07:26', b'0'); |
| 2015 | +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`) VALUES (2130, '邮箱管理', '', 2, 11, 1, 'mail', 'email', NULL, 0, b'1', b'1', '1', '2023-01-25 17:27:44', '1', '2023-01-25 17:27:44', b'0'); | |
| 2016 | +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`) VALUES (2131, '邮箱账号', '', 2, 0, 2130, 'mail-account', 'user', 'system/mail/account/index', 0, b'1', b'1', '', '2023-01-25 09:33:48', '1', '2023-01-26 16:37:37', b'0'); | |
| 2017 | +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`) VALUES (2132, '账号查询', 'system:mail-account:query', 3, 1, 2131, '', '', '', 0, b'1', b'1', '', '2023-01-25 09:33:48', '', '2023-01-25 09:33:48', b'0'); | |
| 2018 | +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`) VALUES (2133, '账号创建', 'system:mail-account:create', 3, 2, 2131, '', '', '', 0, b'1', b'1', '', '2023-01-25 09:33:48', '', '2023-01-25 09:33:48', b'0'); | |
| 2019 | +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`) VALUES (2134, '账号更新', 'system:mail-account:update', 3, 3, 2131, '', '', '', 0, b'1', b'1', '', '2023-01-25 09:33:48', '', '2023-01-25 09:33:48', b'0'); | |
| 2020 | +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`) VALUES (2135, '账号删除', 'system:mail-account:delete', 3, 4, 2131, '', '', '', 0, b'1', b'1', '', '2023-01-25 09:33:48', '', '2023-01-25 09:33:48', b'0'); | |
| 2021 | +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`) VALUES (2136, '邮件模版', '', 2, 0, 2130, 'mail-template', 'education', 'system/mail/template/index', 0, b'1', b'1', '', '2023-01-25 12:05:31', '1', '2023-01-26 16:38:35', b'0'); | |
| 2022 | +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`) VALUES (2137, '模版查询', 'system:mail-template:query', 3, 1, 2136, '', '', '', 0, b'1', b'1', '', '2023-01-25 12:05:31', '', '2023-01-25 12:05:31', b'0'); | |
| 2023 | +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`) VALUES (2138, '模版创建', 'system:mail-template:create', 3, 2, 2136, '', '', '', 0, b'1', b'1', '', '2023-01-25 12:05:31', '', '2023-01-25 12:05:31', b'0'); | |
| 2024 | +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`) VALUES (2139, '模版更新', 'system:mail-template:update', 3, 3, 2136, '', '', '', 0, b'1', b'1', '', '2023-01-25 12:05:31', '', '2023-01-25 12:05:31', b'0'); | |
| 2025 | +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`) VALUES (2140, '模版删除', 'system:mail-template:delete', 3, 4, 2136, '', '', '', 0, b'1', b'1', '', '2023-01-25 12:05:31', '', '2023-01-25 12:05:31', b'0'); | |
| 2026 | +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`) VALUES (2141, '邮件记录', '', 2, 0, 2130, 'mail-log', 'log', 'system/mail/log/index', 0, b'1', b'1', '', '2023-01-26 02:16:50', '1', '2023-01-26 16:38:27', b'0'); | |
| 2027 | +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`) VALUES (2142, '日志查询', 'system:mail-log:query', 3, 1, 2141, '', '', '', 0, b'1', b'1', '', '2023-01-26 02:16:50', '', '2023-01-26 02:16:50', b'0'); | |
| 2028 | +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`) VALUES (2143, '发送测试邮件', 'system:mail-template:send-mail', 3, 5, 2136, '', '', '', 0, b'1', b'1', '1', '2023-01-26 23:29:15', '1', '2023-01-26 23:29:15', b'0'); | |
| 2029 | +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`) VALUES (2144, '站内信管理', '', 1, 11, 1, 'notify', 'message', NULL, 0, b'1', b'1', '1', '2023-01-28 10:25:18', '1', '2023-01-28 10:25:46', b'0'); | |
| 2030 | +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`) VALUES (2145, '模板管理', '', 2, 0, 2144, 'notify-template', 'education', 'system/notify/template/index', 0, b'1', b'1', '', '2023-01-28 02:26:42', '1', '2023-01-28 10:27:47', b'0'); | |
| 2031 | +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`) VALUES (2146, '站内信模板查询', 'system:notify-template:query', 3, 1, 2145, '', '', '', 0, b'1', b'1', '', '2023-01-28 02:26:42', '', '2023-01-28 02:26:42', b'0'); | |
| 2032 | +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`) VALUES (2147, '站内信模板创建', 'system:notify-template:create', 3, 2, 2145, '', '', '', 0, b'1', b'1', '', '2023-01-28 02:26:42', '', '2023-01-28 02:26:42', b'0'); | |
| 2033 | +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`) VALUES (2148, '站内信模板更新', 'system:notify-template:update', 3, 3, 2145, '', '', '', 0, b'1', b'1', '', '2023-01-28 02:26:42', '', '2023-01-28 02:26:42', b'0'); | |
| 2034 | +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`) VALUES (2149, '站内信模板删除', 'system:notify-template:delete', 3, 4, 2145, '', '', '', 0, b'1', b'1', '', '2023-01-28 02:26:42', '', '2023-01-28 02:26:42', b'0'); | |
| 2035 | +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`) VALUES (2150, '发送测试站内信', 'system:notify-template:send-notify', 3, 5, 2145, '', '', '', 0, b'1', b'1', '1', '2023-01-28 10:54:43', '1', '2023-01-28 10:54:43', b'0'); | |
| 2036 | +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`) VALUES (2151, '消息记录', '', 2, 0, 2144, 'notify-message', 'edit', 'system/notify/message/index', 0, b'1', b'1', '', '2023-01-28 04:28:22', '1', '2023-01-28 20:59:53', b'0'); | |
| 2037 | +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`) VALUES (2152, '站内信消息查询', 'system:notify-message:query', 3, 1, 2151, '', '', '', 0, b'1', b'1', '', '2023-01-28 04:28:22', '', '2023-01-28 04:28:22', b'0'); | |
| 1911 | 2038 | COMMIT; |
| 1912 | 2039 | |
| 1913 | 2040 | -- ---------------------------- |
| ... | ... | @@ -1939,6 +2066,72 @@ INSERT INTO `system_notice` (`id`, `title`, `content`, `type`, `status`, `creato |
| 1939 | 2066 | COMMIT; |
| 1940 | 2067 | |
| 1941 | 2068 | -- ---------------------------- |
| 2069 | +-- Table structure for system_notify_message | |
| 2070 | +-- ---------------------------- | |
| 2071 | +DROP TABLE IF EXISTS `system_notify_message`; | |
| 2072 | +CREATE TABLE `system_notify_message` ( | |
| 2073 | + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '用户ID', | |
| 2074 | + `user_id` bigint NOT NULL COMMENT '用户id', | |
| 2075 | + `user_type` tinyint NOT NULL COMMENT '用户类型', | |
| 2076 | + `template_id` bigint NOT NULL COMMENT '模版编号', | |
| 2077 | + `template_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '模板编码', | |
| 2078 | + `template_nickname` varchar(63) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '模版发送人名称', | |
| 2079 | + `template_content` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '模版内容', | |
| 2080 | + `template_type` int NOT NULL COMMENT '模版类型', | |
| 2081 | + `template_params` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '模版参数', | |
| 2082 | + `read_status` bit(1) NOT NULL COMMENT '是否已读', | |
| 2083 | + `read_time` datetime NULL DEFAULT NULL COMMENT '阅读时间', | |
| 2084 | + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者', | |
| 2085 | + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |
| 2086 | + `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者', | |
| 2087 | + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', | |
| 2088 | + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', | |
| 2089 | + `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', | |
| 2090 | + PRIMARY KEY (`id`) USING BTREE | |
| 2091 | +) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '站内信消息表'; | |
| 2092 | + | |
| 2093 | +-- ---------------------------- | |
| 2094 | +-- Records of system_notify_message | |
| 2095 | +-- ---------------------------- | |
| 2096 | +BEGIN; | |
| 2097 | +INSERT INTO `system_notify_message` (`id`, `user_id`, `user_type`, `template_id`, `template_code`, `template_nickname`, `template_content`, `template_type`, `template_params`, `read_status`, `read_time`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2, 1, 2, 1, 'test', '123', '我是 1,我开始 2 了', 1, '{\"name\":\"1\",\"what\":\"2\"}', b'0', '2023-01-28 21:06:10', '1', '2023-01-28 11:44:08', '1', '2023-01-29 02:51:50', b'0', 1); | |
| 2098 | +INSERT INTO `system_notify_message` (`id`, `user_id`, `user_type`, `template_id`, `template_code`, `template_nickname`, `template_content`, `template_type`, `template_params`, `read_status`, `read_time`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (3, 1, 2, 1, 'test', '123', '我是 1,我开始 2 了', 1, '{\"name\":\"1\",\"what\":\"2\"}', b'0', '2023-01-29 10:34:13', '1', '2023-01-28 11:45:04', '1', '2023-01-29 02:51:52', b'0', 1); | |
| 2099 | +INSERT INTO `system_notify_message` (`id`, `user_id`, `user_type`, `template_id`, `template_code`, `template_nickname`, `template_content`, `template_type`, `template_params`, `read_status`, `read_time`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (4, 103, 2, 2, 'register', '系统消息', '你好,欢迎 哈哈 加入大家庭!', 2, '{\"name\":\"哈哈\"}', b'0', NULL, '1', '2023-01-28 21:02:20', '1', '2023-01-28 21:02:20', b'0', 1); | |
| 2100 | +INSERT INTO `system_notify_message` (`id`, `user_id`, `user_type`, `template_id`, `template_code`, `template_nickname`, `template_content`, `template_type`, `template_params`, `read_status`, `read_time`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (5, 1, 2, 1, 'test', '123', '我是 芋艿,我开始 写代码 了', 1, '{\"name\":\"芋艿\",\"what\":\"写代码\"}', b'0', '2023-01-29 10:41:45', '1', '2023-01-28 22:21:42', '1', '2023-01-29 02:51:54', b'0', 1); | |
| 2101 | +INSERT INTO `system_notify_message` (`id`, `user_id`, `user_type`, `template_id`, `template_code`, `template_nickname`, `template_content`, `template_type`, `template_params`, `read_status`, `read_time`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (6, 1, 2, 1, 'test', '123', '我是 芋艿,我开始 写代码 了', 1, '{\"name\":\"芋艿\",\"what\":\"写代码\"}', b'1', '2023-01-29 10:52:06', '1', '2023-01-28 22:22:07', '1', '2023-01-29 10:52:06', b'0', 1); | |
| 2102 | +INSERT INTO `system_notify_message` (`id`, `user_id`, `user_type`, `template_id`, `template_code`, `template_nickname`, `template_content`, `template_type`, `template_params`, `read_status`, `read_time`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (7, 1, 2, 1, 'test', '123', '我是 2,我开始 3 了', 1, '{\"name\":\"2\",\"what\":\"3\"}', b'1', '2023-01-29 10:52:06', '1', '2023-01-28 23:45:21', '1', '2023-01-29 10:52:06', b'0', 1); | |
| 2103 | +INSERT INTO `system_notify_message` (`id`, `user_id`, `user_type`, `template_id`, `template_code`, `template_nickname`, `template_content`, `template_type`, `template_params`, `read_status`, `read_time`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (8, 1, 2, 2, 'register', '系统消息', '你好,欢迎 123 加入大家庭!', 2, '{\"name\":\"123\"}', b'1', '2023-01-29 10:52:06', '1', '2023-01-28 23:50:21', '1', '2023-01-29 10:52:06', b'0', 1); | |
| 2104 | +COMMIT; | |
| 2105 | + | |
| 2106 | +-- ---------------------------- | |
| 2107 | +-- Table structure for system_notify_template | |
| 2108 | +-- ---------------------------- | |
| 2109 | +DROP TABLE IF EXISTS `system_notify_template`; | |
| 2110 | +CREATE TABLE `system_notify_template` ( | |
| 2111 | + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键', | |
| 2112 | + `name` varchar(63) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '模板名称', | |
| 2113 | + `code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '模版编码', | |
| 2114 | + `nickname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '发送人名称', | |
| 2115 | + `content` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '模版内容', | |
| 2116 | + `type` tinyint NOT NULL COMMENT '类型', | |
| 2117 | + `params` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '参数数组', | |
| 2118 | + `status` tinyint NOT NULL COMMENT '状态', | |
| 2119 | + `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '备注', | |
| 2120 | + `creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '创建者', | |
| 2121 | + `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', | |
| 2122 | + `updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '更新者', | |
| 2123 | + `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', | |
| 2124 | + `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', | |
| 2125 | + PRIMARY KEY (`id`) USING BTREE | |
| 2126 | +) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '站内信模板表'; | |
| 2127 | + | |
| 2128 | +-- ---------------------------- | |
| 2129 | +-- Records of system_notify_template | |
| 2130 | +-- ---------------------------- | |
| 2131 | +BEGIN; | |
| 2132 | +COMMIT; | |
| 2133 | + | |
| 2134 | +-- ---------------------------- | |
| 1942 | 2135 | -- Table structure for system_oauth2_access_token |
| 1943 | 2136 | -- ---------------------------- |
| 1944 | 2137 | DROP TABLE IF EXISTS `system_oauth2_access_token`; |
| ... | ... | @@ -1958,7 +2151,7 @@ CREATE TABLE `system_oauth2_access_token` ( |
| 1958 | 2151 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 1959 | 2152 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 1960 | 2153 | PRIMARY KEY (`id`) USING BTREE |
| 1961 | -) ENGINE = InnoDB AUTO_INCREMENT = 1083 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 访问令牌'; | |
| 2154 | +) ENGINE = InnoDB AUTO_INCREMENT = 1249 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 访问令牌'; | |
| 1962 | 2155 | |
| 1963 | 2156 | -- ---------------------------- |
| 1964 | 2157 | -- Records of system_oauth2_access_token |
| ... | ... | @@ -2080,7 +2273,7 @@ CREATE TABLE `system_oauth2_refresh_token` ( |
| 2080 | 2273 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 2081 | 2274 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 2082 | 2275 | PRIMARY KEY (`id`) USING BTREE |
| 2083 | -) ENGINE = InnoDB AUTO_INCREMENT = 571 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 刷新令牌'; | |
| 2276 | +) ENGINE = InnoDB AUTO_INCREMENT = 593 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'OAuth2 刷新令牌'; | |
| 2084 | 2277 | |
| 2085 | 2278 | -- ---------------------------- |
| 2086 | 2279 | -- Records of system_oauth2_refresh_token |
| ... | ... | @@ -2120,7 +2313,7 @@ CREATE TABLE `system_operate_log` ( |
| 2120 | 2313 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 2121 | 2314 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 2122 | 2315 | PRIMARY KEY (`id`) USING BTREE |
| 2123 | -) ENGINE = InnoDB AUTO_INCREMENT = 4018 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '操作日志记录'; | |
| 2316 | +) ENGINE = InnoDB AUTO_INCREMENT = 4245 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '操作日志记录'; | |
| 2124 | 2317 | |
| 2125 | 2318 | -- ---------------------------- |
| 2126 | 2319 | -- Records of system_operate_log |
| ... | ... | @@ -2212,7 +2405,7 @@ CREATE TABLE `system_role_menu` ( |
| 2212 | 2405 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 2213 | 2406 | `tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '租户编号', |
| 2214 | 2407 | PRIMARY KEY (`id`) USING BTREE |
| 2215 | -) ENGINE = InnoDB AUTO_INCREMENT = 1991 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '角色和菜单关联表'; | |
| 2408 | +) ENGINE = InnoDB AUTO_INCREMENT = 2185 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '角色和菜单关联表'; | |
| 2216 | 2409 | |
| 2217 | 2410 | -- ---------------------------- |
| 2218 | 2411 | -- Records of system_role_menu |
| ... | ... | @@ -2628,6 +2821,194 @@ INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_t |
| 2628 | 2821 | INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1988, 118, 1018, '1', '2022-12-30 11:47:52', '1', '2022-12-30 11:47:52', b'0', 129); |
| 2629 | 2822 | INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1989, 118, 1019, '1', '2022-12-30 11:47:52', '1', '2022-12-30 11:47:52', b'0', 129); |
| 2630 | 2823 | INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1990, 118, 1020, '1', '2022-12-30 11:47:52', '1', '2022-12-30 11:47:52', b'0', 129); |
| 2824 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1991, 2, 1024, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2825 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1992, 2, 1025, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2826 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1993, 2, 1026, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2827 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1994, 2, 1027, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2828 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1995, 2, 1028, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2829 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1996, 2, 1029, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2830 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1997, 2, 1030, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2831 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1998, 2, 1031, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2832 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1999, 2, 1032, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2833 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2000, 2, 1033, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2834 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2001, 2, 1034, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2835 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2002, 2, 1035, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2836 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2003, 2, 1036, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2837 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2004, 2, 1037, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2838 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2005, 2, 1038, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2839 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2006, 2, 1039, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2840 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2007, 2, 1040, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2841 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2008, 2, 1042, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2842 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2009, 2, 1043, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2843 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2010, 2, 1045, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2844 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2011, 2, 1046, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2845 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2012, 2, 1048, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2846 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2013, 2, 1050, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2847 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2014, 2, 1051, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2848 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2015, 2, 1052, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2849 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2016, 2, 1053, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2850 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2017, 2, 1054, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2851 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2018, 2, 1056, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2852 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2019, 2, 1057, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2853 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2020, 2, 1058, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2854 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2021, 2, 2083, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2855 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2022, 2, 1059, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2856 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2023, 2, 1060, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2857 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2024, 2, 1063, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2858 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2025, 2, 1064, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2859 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2026, 2, 1065, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2860 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2027, 2, 1066, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2861 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2028, 2, 1067, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2862 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2029, 2, 1070, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2863 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2030, 2, 1071, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2864 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2031, 2, 1072, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2865 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2032, 2, 1073, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2866 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2033, 2, 1074, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2867 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2034, 2, 1075, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2868 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2035, 2, 1076, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2869 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2036, 2, 1082, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2870 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2037, 2, 1085, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2871 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2038, 2, 1086, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2872 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2039, 2, 1087, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2873 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2040, 2, 1088, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2874 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2041, 2, 1089, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2875 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2042, 2, 1091, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2876 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2043, 2, 1092, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2877 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2044, 2, 1095, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2878 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2045, 2, 1096, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2879 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2046, 2, 1097, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2880 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2047, 2, 1098, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2881 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2048, 2, 1101, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2882 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2049, 2, 1102, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2883 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2050, 2, 1103, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2884 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2051, 2, 1104, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2885 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2052, 2, 1105, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2886 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2053, 2, 1106, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2887 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2054, 2, 1108, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2888 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2055, 2, 1109, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2889 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2056, 2, 1111, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2890 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2057, 2, 1112, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2891 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2058, 2, 1113, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2892 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2059, 2, 1114, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2893 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2060, 2, 1115, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2894 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2061, 2, 1127, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2895 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2062, 2, 1128, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2896 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2063, 2, 1129, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2897 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2064, 2, 1130, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2898 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2065, 2, 1131, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2899 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2066, 2, 1132, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2900 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2067, 2, 1133, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2901 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2068, 2, 1134, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2902 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2069, 2, 1135, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2903 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2070, 2, 1136, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2904 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2071, 2, 1137, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2905 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2072, 2, 114, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2906 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2073, 2, 1139, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2907 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2074, 2, 115, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2908 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2075, 2, 1140, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2909 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2076, 2, 116, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2910 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2077, 2, 1141, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2911 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2078, 2, 1142, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2912 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2079, 2, 1143, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2913 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2080, 2, 1150, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2914 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2081, 2, 1161, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2915 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2082, 2, 1162, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2916 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2083, 2, 1163, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2917 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2084, 2, 1164, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2918 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2085, 2, 1165, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2919 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2086, 2, 1166, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2920 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2087, 2, 1173, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2921 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2088, 2, 1174, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2922 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2089, 2, 1175, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2923 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2090, 2, 1176, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2924 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2091, 2, 1177, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2925 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2092, 2, 1178, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2926 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2093, 2, 1179, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2927 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2094, 2, 1180, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2928 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2095, 2, 1181, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2929 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2096, 2, 1182, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2930 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2097, 2, 1183, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2931 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2098, 2, 1184, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2932 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2099, 2, 1226, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2933 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2100, 2, 1227, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2934 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2101, 2, 1228, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2935 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2102, 2, 1229, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2936 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2103, 2, 1237, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2937 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2104, 2, 1238, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2938 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2105, 2, 1239, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2939 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2106, 2, 1240, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2940 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2107, 2, 1241, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2941 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2108, 2, 1242, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2942 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2109, 2, 1243, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2943 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2110, 2, 1247, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2944 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2111, 2, 1248, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2945 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2112, 2, 1249, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2946 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2113, 2, 1250, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2947 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2114, 2, 1251, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2948 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2115, 2, 1252, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2949 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2116, 2, 1254, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2950 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2117, 2, 1255, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2951 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2118, 2, 1256, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2952 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2119, 2, 1257, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2953 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2120, 2, 1258, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2954 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2121, 2, 1259, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2955 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2122, 2, 1260, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2956 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2123, 2, 1261, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2957 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2124, 2, 1263, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2958 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2125, 2, 1264, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2959 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2126, 2, 1265, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2960 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2127, 2, 1266, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2961 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2128, 2, 1267, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2962 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2129, 2, 1001, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2963 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2130, 2, 1002, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2964 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2131, 2, 1003, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2965 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2132, 2, 1004, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2966 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2133, 2, 1005, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2967 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2134, 2, 1006, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2968 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2135, 2, 1007, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2969 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2136, 2, 1008, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2970 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2137, 2, 1009, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2971 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2138, 2, 1010, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2972 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2139, 2, 1011, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2973 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2140, 2, 1012, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2974 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2141, 2, 1013, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2975 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2142, 2, 1014, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2976 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2143, 2, 1015, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2977 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2144, 2, 1016, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2978 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2145, 2, 1017, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2979 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2146, 2, 1018, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2980 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2147, 2, 1019, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2981 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2148, 2, 1020, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2982 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2149, 2, 1021, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2983 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2150, 2, 1022, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2984 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2151, 2, 1023, '1', '2023-01-25 08:42:52', '1', '2023-01-25 08:42:52', b'0', 1); | |
| 2985 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2152, 2, 1281, '1', '2023-01-25 08:42:58', '1', '2023-01-25 08:42:58', b'0', 1); | |
| 2986 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2153, 2, 1282, '1', '2023-01-25 08:42:58', '1', '2023-01-25 08:42:58', b'0', 1); | |
| 2987 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2154, 2, 2000, '1', '2023-01-25 08:42:58', '1', '2023-01-25 08:42:58', b'0', 1); | |
| 2988 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2155, 2, 2002, '1', '2023-01-25 08:42:58', '1', '2023-01-25 08:42:58', b'0', 1); | |
| 2989 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2156, 2, 2003, '1', '2023-01-25 08:42:58', '1', '2023-01-25 08:42:58', b'0', 1); | |
| 2990 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2157, 2, 2004, '1', '2023-01-25 08:42:58', '1', '2023-01-25 08:42:58', b'0', 1); | |
| 2991 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2158, 2, 2005, '1', '2023-01-25 08:42:58', '1', '2023-01-25 08:42:58', b'0', 1); | |
| 2992 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2159, 2, 2006, '1', '2023-01-25 08:42:58', '1', '2023-01-25 08:42:58', b'0', 1); | |
| 2993 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2160, 2, 2008, '1', '2023-01-25 08:42:58', '1', '2023-01-25 08:42:58', b'0', 1); | |
| 2994 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2161, 2, 2009, '1', '2023-01-25 08:42:58', '1', '2023-01-25 08:42:58', b'0', 1); | |
| 2995 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2162, 2, 2010, '1', '2023-01-25 08:42:58', '1', '2023-01-25 08:42:58', b'0', 1); | |
| 2996 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2163, 2, 2011, '1', '2023-01-25 08:42:58', '1', '2023-01-25 08:42:58', b'0', 1); | |
| 2997 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2164, 2, 2012, '1', '2023-01-25 08:42:58', '1', '2023-01-25 08:42:58', b'0', 1); | |
| 2998 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2170, 2, 2019, '1', '2023-01-25 08:42:58', '1', '2023-01-25 08:42:58', b'0', 1); | |
| 2999 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2171, 2, 2020, '1', '2023-01-25 08:42:58', '1', '2023-01-25 08:42:58', b'0', 1); | |
| 3000 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2172, 2, 2021, '1', '2023-01-25 08:42:58', '1', '2023-01-25 08:42:58', b'0', 1); | |
| 3001 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2173, 2, 2022, '1', '2023-01-25 08:42:58', '1', '2023-01-25 08:42:58', b'0', 1); | |
| 3002 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2174, 2, 2023, '1', '2023-01-25 08:42:58', '1', '2023-01-25 08:42:58', b'0', 1); | |
| 3003 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2175, 2, 2025, '1', '2023-01-25 08:42:58', '1', '2023-01-25 08:42:58', b'0', 1); | |
| 3004 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2177, 2, 2027, '1', '2023-01-25 08:42:58', '1', '2023-01-25 08:42:58', b'0', 1); | |
| 3005 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2178, 2, 2028, '1', '2023-01-25 08:42:58', '1', '2023-01-25 08:42:58', b'0', 1); | |
| 3006 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2179, 2, 2029, '1', '2023-01-25 08:42:58', '1', '2023-01-25 08:42:58', b'0', 1); | |
| 3007 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2180, 2, 2014, '1', '2023-01-25 08:43:12', '1', '2023-01-25 08:43:12', b'0', 1); | |
| 3008 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2181, 2, 2015, '1', '2023-01-25 08:43:12', '1', '2023-01-25 08:43:12', b'0', 1); | |
| 3009 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2182, 2, 2016, '1', '2023-01-25 08:43:12', '1', '2023-01-25 08:43:12', b'0', 1); | |
| 3010 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2183, 2, 2017, '1', '2023-01-25 08:43:12', '1', '2023-01-25 08:43:12', b'0', 1); | |
| 3011 | +INSERT INTO `system_role_menu` (`id`, `role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (2184, 2, 2018, '1', '2023-01-25 08:43:12', '1', '2023-01-25 08:43:12', b'0', 1); | |
| 2631 | 3012 | COMMIT; |
| 2632 | 3013 | |
| 2633 | 3014 | -- ---------------------------- |
| ... | ... | @@ -2752,7 +3133,7 @@ CREATE TABLE `system_sms_log` ( |
| 2752 | 3133 | `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', |
| 2753 | 3134 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 2754 | 3135 | PRIMARY KEY (`id`) USING BTREE |
| 2755 | -) ENGINE = InnoDB AUTO_INCREMENT = 339 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '短信日志'; | |
| 3136 | +) ENGINE = InnoDB AUTO_INCREMENT = 347 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = '短信日志'; | |
| 2756 | 3137 | |
| 2757 | 3138 | -- ---------------------------- |
| 2758 | 3139 | -- Records of system_sms_log |
| ... | ... | @@ -3050,7 +3431,7 @@ CREATE TABLE `system_users` ( |
| 3050 | 3431 | -- Records of system_users |
| 3051 | 3432 | -- ---------------------------- |
| 3052 | 3433 | BEGIN; |
| 3053 | -INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1, 'admin', '$2a$10$mRMIYLDtRHlf6.9ipiqH1.Z.bh/R9dO9d5iHiGYPigi6r5KOoR2Wm', '芋道源码', '管理员', 103, '[1]', 'aoteman@126.com', '15612345678', 1, 'http://test.yudao.iocoder.cn/e1fdd7271685ec143a0900681606406621717a666ad0b2798b096df41422b32f.png', 0, '127.0.0.1', '2023-01-17 12:33:07', 'admin', '2021-01-05 17:03:47', NULL, '2023-01-17 12:33:07', b'0', 1); | |
| 3434 | +INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (1, 'admin', '$2a$10$mRMIYLDtRHlf6.9ipiqH1.Z.bh/R9dO9d5iHiGYPigi6r5KOoR2Wm', '芋道源码', '管理员', 103, '[1]', 'aoteman@126.com', '15612345678', 1, 'http://test.yudao.iocoder.cn/e1fdd7271685ec143a0900681606406621717a666ad0b2798b096df41422b32f.png', 0, '127.0.0.1', '2023-01-29 10:05:18', 'admin', '2021-01-05 17:03:47', NULL, '2023-01-29 10:05:18', b'0', 1); | |
| 3054 | 3435 | INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (100, 'yudao', '$2a$10$11U48RhyJ5pSBYWSn12AD./ld671.ycSzJHbyrtpeoMeYiw31eo8a', '芋道', '不要吓我', 104, '[1]', 'yudao@iocoder.cn', '15601691300', 1, '', 1, '127.0.0.1', '2022-07-09 23:03:33', '', '2021-01-07 09:07:17', NULL, '2022-07-09 23:03:33', b'0', 1); |
| 3055 | 3436 | INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (103, 'yuanma', '$2a$10$YMpimV4T6BtDhIaA8jSW.u8UTGBeGhc/qwXP4oxoMr4mOw9.qttt6', '源码', NULL, 106, NULL, 'yuanma@iocoder.cn', '15601701300', 0, '', 0, '127.0.0.1', '2022-07-08 01:26:27', '', '2021-01-13 23:50:35', NULL, '2022-07-08 01:26:27', b'0', 1); |
| 3056 | 3437 | INSERT INTO `system_users` (`id`, `username`, `password`, `nickname`, `remark`, `dept_id`, `post_ids`, `email`, `mobile`, `sex`, `avatar`, `status`, `login_ip`, `login_date`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) VALUES (104, 'test', '$2a$10$GP8zvqHB//TekuzYZSBYAuBQJiNq1.fxQVDYJ.uBCOnWCtDVKE4H6', '测试号', NULL, 107, '[1,2]', '111@qq.com', '15601691200', 1, '', 0, '127.0.0.1', '2022-05-28 15:43:17', '', '2021-01-21 02:13:53', NULL, '2022-07-09 09:00:33', b'0', 1); | ... | ... |
yudao-dependencies/pom.xml
| ... | ... | @@ -14,7 +14,7 @@ |
| 14 | 14 | <url>https://github.com/YunaiV/ruoyi-vue-pro</url> |
| 15 | 15 | |
| 16 | 16 | <properties> |
| 17 | - <revision>1.6.6-snapshot</revision> | |
| 17 | + <revision>1.7.0-snapshot</revision> | |
| 18 | 18 | <!-- 统一依赖管理 --> |
| 19 | 19 | <spring.boot.version>2.7.8</spring.boot.version> |
| 20 | 20 | <!-- Web 相关 --> |
| ... | ... | @@ -143,6 +143,11 @@ |
| 143 | 143 | <artifactId>yudao-spring-boot-starter-captcha</artifactId> |
| 144 | 144 | <version>${revision}</version> |
| 145 | 145 | </dependency> |
| 146 | + <dependency> | |
| 147 | + <groupId>cn.iocoder.boot</groupId> | |
| 148 | + <artifactId>yudao-spring-boot-starter-desensitize</artifactId> | |
| 149 | + <version>${revision}</version> | |
| 150 | + </dependency> | |
| 146 | 151 | |
| 147 | 152 | <!-- Spring 核心 --> |
| 148 | 153 | <dependency> | ... | ... |
yudao-framework/pom.xml
| ... | ... | @@ -41,6 +41,7 @@ |
| 41 | 41 | <module>yudao-spring-boot-starter-flowable</module> |
| 42 | 42 | <module>yudao-spring-boot-starter-captcha</module> |
| 43 | 43 | <module>yudao-spring-boot-starter-websocket</module> |
| 44 | + <module>yudao-spring-boot-starter-desensitize</module> | |
| 44 | 45 | </modules> |
| 45 | 46 | |
| 46 | 47 | <artifactId>yudao-framework</artifactId> | ... | ... |
yudao-framework/yudao-common/src/main/java/cn/iocoder/yudao/framework/common/util/date/LocalDateTimeUtils.java
| ... | ... | @@ -41,6 +41,11 @@ public class LocalDateTimeUtils { |
| 41 | 41 | return LocalDateTime.of(year, mouth, day, 0, 0, 0); |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | + public static LocalDateTime[] buildBetweenTime(int year1, int mouth1, int day1, | |
| 45 | + int year2, int mouth2, int day2) { | |
| 46 | + return new LocalDateTime[]{buildTime(year1, mouth1, day1), buildTime(year2, mouth2, day2)}; | |
| 47 | + } | |
| 48 | + | |
| 44 | 49 | /** |
| 45 | 50 | * 判断当前时间是否在该时间范围内 |
| 46 | 51 | * | ... | ... |
yudao-framework/yudao-spring-boot-starter-banner/src/main/java/cn/iocoder/yudao/framework/banner/core/BannerApplicationRunner.java
| ... | ... | @@ -40,6 +40,10 @@ public class BannerApplicationRunner implements ApplicationRunner { |
| 40 | 40 | if (isNotPresent("cn.iocoder.yudao.framework.flowable.config.YudaoFlowableConfiguration")) { |
| 41 | 41 | System.out.println("[工作流模块 yudao-module-bpm - 已禁用][参考 https://doc.iocoder.cn/bpm/ 开启]"); |
| 42 | 42 | } |
| 43 | + // 微信公众号 | |
| 44 | + if (isNotPresent("cn.iocoder.yudao.module.mp.framework.mp.config.MpConfiguration")) { | |
| 45 | + System.out.println("[微信公众号 yudao-module-mp - 已禁用][参考 https://doc.iocoder.cn/mp/build/ 开启]"); | |
| 46 | + } | |
| 43 | 47 | }); |
| 44 | 48 | } |
| 45 | 49 | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/pom.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<project xmlns="http://maven.apache.org/POM/4.0.0" | |
| 3 | + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| 4 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
| 5 | + <modelVersion>4.0.0</modelVersion> | |
| 6 | + <parent> | |
| 7 | + <artifactId>yudao-framework</artifactId> | |
| 8 | + <groupId>cn.iocoder.boot</groupId> | |
| 9 | + <version>${revision}</version> | |
| 10 | + </parent> | |
| 11 | + | |
| 12 | + <artifactId>yudao-spring-boot-starter-desensitize</artifactId> | |
| 13 | + <description>脱敏组件:支持 JSON 返回数据时,将邮箱、手机等字段进行脱敏</description> | |
| 14 | + | |
| 15 | + <dependencies> | |
| 16 | + <dependency> | |
| 17 | + <groupId>cn.iocoder.boot</groupId> | |
| 18 | + <artifactId>yudao-common</artifactId> | |
| 19 | + </dependency> | |
| 20 | + | |
| 21 | + <!-- jackson --> | |
| 22 | + <dependency> | |
| 23 | + <groupId>com.fasterxml.jackson.core</groupId> | |
| 24 | + <artifactId>jackson-annotations</artifactId> | |
| 25 | + </dependency> | |
| 26 | + <dependency> | |
| 27 | + <groupId>com.fasterxml.jackson.core</groupId> | |
| 28 | + <artifactId>jackson-databind</artifactId> | |
| 29 | + </dependency> | |
| 30 | + | |
| 31 | + <!-- Test 测试相关 --> | |
| 32 | + <dependency> | |
| 33 | + <groupId>cn.iocoder.boot</groupId> | |
| 34 | + <artifactId>yudao-spring-boot-starter-test</artifactId> | |
| 35 | + <scope>test</scope> | |
| 36 | + </dependency> | |
| 37 | + </dependencies> | |
| 38 | +</project> | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/base/annotation/DesensitizeBy.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.desensitize.core.base.annotation; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.desensitize.core.base.handler.DesensitizationHandler; | |
| 4 | +import cn.iocoder.yudao.framework.desensitize.core.base.serializer.StringDesensitizeSerializer; | |
| 5 | +import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; | |
| 6 | +import com.fasterxml.jackson.databind.annotation.JsonSerialize; | |
| 7 | + | |
| 8 | +import java.lang.annotation.Documented; | |
| 9 | +import java.lang.annotation.ElementType; | |
| 10 | +import java.lang.annotation.Retention; | |
| 11 | +import java.lang.annotation.RetentionPolicy; | |
| 12 | +import java.lang.annotation.Target; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * 顶级脱敏注解,自定义注解需要使用此注解 | |
| 16 | + * | |
| 17 | + * @author gaibu | |
| 18 | + */ | |
| 19 | +@Documented | |
| 20 | +@Target(ElementType.ANNOTATION_TYPE) | |
| 21 | +@Retention(RetentionPolicy.RUNTIME) | |
| 22 | +@JacksonAnnotationsInside // 此注解是其他所有 jackson 注解的元注解,打上了此注解的注解表明是 jackson 注解的一部分 | |
| 23 | +@JsonSerialize(using = StringDesensitizeSerializer.class) // 指定序列化器 | |
| 24 | +public @interface DesensitizeBy { | |
| 25 | + | |
| 26 | + /** | |
| 27 | + * 脱敏处理器 | |
| 28 | + */ | |
| 29 | + @SuppressWarnings("rawtypes") | |
| 30 | + Class<? extends DesensitizationHandler> handler(); | |
| 31 | + | |
| 32 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/base/handler/DesensitizationHandler.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.desensitize.core.base.handler; | |
| 2 | + | |
| 3 | +import java.lang.annotation.Annotation; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * 脱敏处理器接口 | |
| 7 | + * | |
| 8 | + * @author gaibu | |
| 9 | + */ | |
| 10 | +public interface DesensitizationHandler<T extends Annotation> { | |
| 11 | + | |
| 12 | + /** | |
| 13 | + * 脱敏 | |
| 14 | + * | |
| 15 | + * @param origin 原始字符串 | |
| 16 | + * @param annotation 注解信息 | |
| 17 | + * @return 脱敏后的字符串 | |
| 18 | + */ | |
| 19 | + String desensitize(String origin, T annotation); | |
| 20 | + | |
| 21 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/base/serializer/StringDesensitizeSerializer.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.desensitize.core.base.serializer; | |
| 2 | + | |
| 3 | +import cn.hutool.core.annotation.AnnotationUtil; | |
| 4 | +import cn.hutool.core.lang.Singleton; | |
| 5 | +import cn.hutool.core.util.ArrayUtil; | |
| 6 | +import cn.hutool.core.util.ReflectUtil; | |
| 7 | +import cn.hutool.core.util.StrUtil; | |
| 8 | +import cn.iocoder.yudao.framework.desensitize.core.base.annotation.DesensitizeBy; | |
| 9 | +import cn.iocoder.yudao.framework.desensitize.core.base.handler.DesensitizationHandler; | |
| 10 | +import com.fasterxml.jackson.core.JsonGenerator; | |
| 11 | +import com.fasterxml.jackson.databind.BeanProperty; | |
| 12 | +import com.fasterxml.jackson.databind.JsonSerializer; | |
| 13 | +import com.fasterxml.jackson.databind.SerializerProvider; | |
| 14 | +import com.fasterxml.jackson.databind.ser.ContextualSerializer; | |
| 15 | +import com.fasterxml.jackson.databind.ser.std.StdSerializer; | |
| 16 | +import lombok.Getter; | |
| 17 | +import lombok.Setter; | |
| 18 | + | |
| 19 | +import java.io.IOException; | |
| 20 | +import java.lang.annotation.Annotation; | |
| 21 | +import java.lang.reflect.Field; | |
| 22 | + | |
| 23 | +/** | |
| 24 | + * 脱敏序列化器 | |
| 25 | + * | |
| 26 | + * 实现 JSON 返回数据时,使用 {@link DesensitizationHandler} 对声明脱敏注解的字段,进行脱敏处理。 | |
| 27 | + * | |
| 28 | + * @author gaibu | |
| 29 | + */ | |
| 30 | +@SuppressWarnings("rawtypes") | |
| 31 | +public class StringDesensitizeSerializer extends StdSerializer<String> implements ContextualSerializer { | |
| 32 | + | |
| 33 | + @Getter | |
| 34 | + @Setter | |
| 35 | + private DesensitizationHandler desensitizationHandler; | |
| 36 | + | |
| 37 | + protected StringDesensitizeSerializer() { | |
| 38 | + super(String.class); | |
| 39 | + } | |
| 40 | + | |
| 41 | + @Override | |
| 42 | + public JsonSerializer<?> createContextual(SerializerProvider serializerProvider, BeanProperty beanProperty) { | |
| 43 | + DesensitizeBy annotation = beanProperty.getAnnotation(DesensitizeBy.class); | |
| 44 | + if (annotation == null) { | |
| 45 | + return this; | |
| 46 | + } | |
| 47 | + // 创建一个 StringDesensitizeSerializer 对象,使用 DesensitizeBy 对应的处理器 | |
| 48 | + StringDesensitizeSerializer serializer = new StringDesensitizeSerializer(); | |
| 49 | + serializer.setDesensitizationHandler(Singleton.get(annotation.handler())); | |
| 50 | + return serializer; | |
| 51 | + } | |
| 52 | + | |
| 53 | + @Override | |
| 54 | + @SuppressWarnings("unchecked") | |
| 55 | + public void serialize(String value, JsonGenerator gen, SerializerProvider serializerProvider) throws IOException { | |
| 56 | + if (StrUtil.isBlank(value)) { | |
| 57 | + gen.writeNull(); | |
| 58 | + return; | |
| 59 | + } | |
| 60 | + // 获取序列化字段 | |
| 61 | + Field field = getField(gen); | |
| 62 | + | |
| 63 | + // 自定义处理器 | |
| 64 | + DesensitizeBy[] annotations = AnnotationUtil.getCombinationAnnotations(field, DesensitizeBy.class); | |
| 65 | + if (ArrayUtil.isEmpty(annotations)) { | |
| 66 | + gen.writeString(value); | |
| 67 | + return; | |
| 68 | + } | |
| 69 | + for (Annotation annotation : field.getAnnotations()) { | |
| 70 | + if (AnnotationUtil.hasAnnotation(annotation.annotationType(), DesensitizeBy.class)) { | |
| 71 | + value = this.desensitizationHandler.desensitize(value, annotation); | |
| 72 | + gen.writeString(value); | |
| 73 | + return; | |
| 74 | + } | |
| 75 | + } | |
| 76 | + gen.writeString(value); | |
| 77 | + } | |
| 78 | + | |
| 79 | + /** | |
| 80 | + * 获取字段 | |
| 81 | + * | |
| 82 | + * @param generator JsonGenerator | |
| 83 | + * @return 字段 | |
| 84 | + */ | |
| 85 | + private Field getField(JsonGenerator generator) { | |
| 86 | + String currentName = generator.getOutputContext().getCurrentName(); | |
| 87 | + Object currentValue = generator.getCurrentValue(); | |
| 88 | + Class<?> currentValueClass = currentValue.getClass(); | |
| 89 | + return ReflectUtil.getField(currentValueClass, currentName); | |
| 90 | + } | |
| 91 | + | |
| 92 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/package-info.java
0 → 100644
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/regex/annotation/EmailDesensitize.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.desensitize.core.regex.annotation; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.desensitize.core.base.annotation.DesensitizeBy; | |
| 4 | +import cn.iocoder.yudao.framework.desensitize.core.regex.handler.EmailDesensitizationHandler; | |
| 5 | +import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; | |
| 6 | + | |
| 7 | +import java.lang.annotation.Documented; | |
| 8 | +import java.lang.annotation.ElementType; | |
| 9 | +import java.lang.annotation.Retention; | |
| 10 | +import java.lang.annotation.RetentionPolicy; | |
| 11 | +import java.lang.annotation.Target; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 邮箱脱敏注解 | |
| 15 | + * | |
| 16 | + * @author gaibu | |
| 17 | + */ | |
| 18 | +@Documented | |
| 19 | +@Target({ElementType.FIELD}) | |
| 20 | +@Retention(RetentionPolicy.RUNTIME) | |
| 21 | +@JacksonAnnotationsInside | |
| 22 | +@DesensitizeBy(handler = EmailDesensitizationHandler.class) | |
| 23 | +public @interface EmailDesensitize { | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 匹配的正则表达式 | |
| 27 | + */ | |
| 28 | + String regex() default "(^.)[^@]*(@.*$)"; | |
| 29 | + | |
| 30 | + /** | |
| 31 | + * 替换规则,邮箱; | |
| 32 | + * | |
| 33 | + * 比如:example@gmail.com 脱敏之后为 e****@gmail.com | |
| 34 | + */ | |
| 35 | + String replacer() default "$1****$2"; | |
| 36 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/regex/annotation/RegexDesensitize.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.desensitize.core.regex.annotation; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.desensitize.core.base.annotation.DesensitizeBy; | |
| 4 | +import cn.iocoder.yudao.framework.desensitize.core.regex.handler.DefaultRegexDesensitizationHandler; | |
| 5 | +import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; | |
| 6 | + | |
| 7 | +import java.lang.annotation.Documented; | |
| 8 | +import java.lang.annotation.ElementType; | |
| 9 | +import java.lang.annotation.Retention; | |
| 10 | +import java.lang.annotation.RetentionPolicy; | |
| 11 | +import java.lang.annotation.Target; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 正则脱敏注解 | |
| 15 | + * | |
| 16 | + * @author gaibu | |
| 17 | + */ | |
| 18 | +@Documented | |
| 19 | +@Target({ElementType.FIELD, ElementType.ANNOTATION_TYPE}) | |
| 20 | +@Retention(RetentionPolicy.RUNTIME) | |
| 21 | +@JacksonAnnotationsInside | |
| 22 | +@DesensitizeBy(handler = DefaultRegexDesensitizationHandler.class) | |
| 23 | +public @interface RegexDesensitize { | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 匹配的正则表达式(默认匹配所有) | |
| 27 | + */ | |
| 28 | + String regex() default "^[\\s\\S]*$"; | |
| 29 | + | |
| 30 | + /** | |
| 31 | + * 替换规则,会将匹配到的字符串全部替换成 replacer | |
| 32 | + * | |
| 33 | + * 例如:regex=123; replacer=****** | |
| 34 | + * 原始字符串 123456789 | |
| 35 | + * 脱敏后字符串 ******456789 | |
| 36 | + */ | |
| 37 | + String replacer() default "******"; | |
| 38 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/regex/handler/AbstractRegexDesensitizationHandler.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.desensitize.core.regex.handler; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.desensitize.core.base.handler.DesensitizationHandler; | |
| 4 | + | |
| 5 | +import java.lang.annotation.Annotation; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * 正则表达式脱敏处理器抽象类,已实现通用的方法 | |
| 9 | + * | |
| 10 | + * @author gaibu | |
| 11 | + */ | |
| 12 | +public abstract class AbstractRegexDesensitizationHandler<T extends Annotation> | |
| 13 | + implements DesensitizationHandler<T> { | |
| 14 | + | |
| 15 | + @Override | |
| 16 | + public String desensitize(String origin, T annotation) { | |
| 17 | + String regex = getRegex(annotation); | |
| 18 | + String replacer = getReplacer(annotation); | |
| 19 | + return origin.replaceAll(regex, replacer); | |
| 20 | + } | |
| 21 | + | |
| 22 | + /** | |
| 23 | + * 获取注解上的 regex 参数 | |
| 24 | + * | |
| 25 | + * @param annotation 注解信息 | |
| 26 | + * @return 正则表达式 | |
| 27 | + */ | |
| 28 | + abstract String getRegex(T annotation); | |
| 29 | + | |
| 30 | + /** | |
| 31 | + * 获取注解上的 replacer 参数 | |
| 32 | + * | |
| 33 | + * @param annotation 注解信息 | |
| 34 | + * @return 待替换的字符串 | |
| 35 | + */ | |
| 36 | + abstract String getReplacer(T annotation); | |
| 37 | + | |
| 38 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/regex/handler/DefaultRegexDesensitizationHandler.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.desensitize.core.regex.handler; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.desensitize.core.regex.annotation.RegexDesensitize; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * {@link RegexDesensitize} 的正则脱敏处理器 | |
| 7 | + * | |
| 8 | + * @author gaibu | |
| 9 | + */ | |
| 10 | +public class DefaultRegexDesensitizationHandler extends AbstractRegexDesensitizationHandler<RegexDesensitize> { | |
| 11 | + | |
| 12 | + @Override | |
| 13 | + String getRegex(RegexDesensitize annotation) { | |
| 14 | + return annotation.regex(); | |
| 15 | + } | |
| 16 | + | |
| 17 | + @Override | |
| 18 | + String getReplacer(RegexDesensitize annotation) { | |
| 19 | + return annotation.replacer(); | |
| 20 | + } | |
| 21 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/regex/handler/EmailDesensitizationHandler.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.desensitize.core.regex.handler; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.desensitize.core.regex.annotation.EmailDesensitize; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * {@link EmailDesensitize} 的脱敏处理器 | |
| 7 | + * | |
| 8 | + * @author gaibu | |
| 9 | + */ | |
| 10 | +public class EmailDesensitizationHandler extends AbstractRegexDesensitizationHandler<EmailDesensitize> { | |
| 11 | + | |
| 12 | + @Override | |
| 13 | + String getRegex(EmailDesensitize annotation) { | |
| 14 | + return annotation.regex(); | |
| 15 | + } | |
| 16 | + | |
| 17 | + @Override | |
| 18 | + String getReplacer(EmailDesensitize annotation) { | |
| 19 | + return annotation.replacer(); | |
| 20 | + } | |
| 21 | + | |
| 22 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/BankCardDesensitize.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.desensitize.core.slider.annotation; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.desensitize.core.base.annotation.DesensitizeBy; | |
| 4 | +import cn.iocoder.yudao.framework.desensitize.core.slider.handler.BankCardDesensitization; | |
| 5 | +import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; | |
| 6 | + | |
| 7 | +import java.lang.annotation.Documented; | |
| 8 | +import java.lang.annotation.ElementType; | |
| 9 | +import java.lang.annotation.Retention; | |
| 10 | +import java.lang.annotation.RetentionPolicy; | |
| 11 | +import java.lang.annotation.Target; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 银行卡号 | |
| 15 | + * | |
| 16 | + * @author gaibu | |
| 17 | + */ | |
| 18 | +@Documented | |
| 19 | +@Target({ElementType.FIELD}) | |
| 20 | +@Retention(RetentionPolicy.RUNTIME) | |
| 21 | +@JacksonAnnotationsInside | |
| 22 | +@DesensitizeBy(handler = BankCardDesensitization.class) | |
| 23 | +public @interface BankCardDesensitize { | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 前缀保留长度 | |
| 27 | + */ | |
| 28 | + int prefixKeep() default 6; | |
| 29 | + | |
| 30 | + /** | |
| 31 | + * 后缀保留长度 | |
| 32 | + */ | |
| 33 | + int suffixKeep() default 2; | |
| 34 | + | |
| 35 | + /** | |
| 36 | + * 替换规则,银行卡号; 比如:9988002866797031 脱敏之后为 998800********31 | |
| 37 | + */ | |
| 38 | + String replacer() default "*"; | |
| 39 | + | |
| 40 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/CarLicenseDesensitize.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.desensitize.core.slider.annotation; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.desensitize.core.base.annotation.DesensitizeBy; | |
| 4 | +import cn.iocoder.yudao.framework.desensitize.core.slider.handler.CarLicenseDesensitization; | |
| 5 | +import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; | |
| 6 | + | |
| 7 | +import java.lang.annotation.Documented; | |
| 8 | +import java.lang.annotation.ElementType; | |
| 9 | +import java.lang.annotation.Retention; | |
| 10 | +import java.lang.annotation.RetentionPolicy; | |
| 11 | +import java.lang.annotation.Target; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 车牌号 | |
| 15 | + * | |
| 16 | + * @author gaibu | |
| 17 | + */ | |
| 18 | +@Documented | |
| 19 | +@Target({ElementType.FIELD}) | |
| 20 | +@Retention(RetentionPolicy.RUNTIME) | |
| 21 | +@JacksonAnnotationsInside | |
| 22 | +@DesensitizeBy(handler = CarLicenseDesensitization.class) | |
| 23 | +public @interface CarLicenseDesensitize { | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 前缀保留长度 | |
| 27 | + */ | |
| 28 | + int prefixKeep() default 3; | |
| 29 | + | |
| 30 | + /** | |
| 31 | + * 后缀保留长度 | |
| 32 | + */ | |
| 33 | + int suffixKeep() default 1; | |
| 34 | + | |
| 35 | + /** | |
| 36 | + * 替换规则,车牌号;比如:粤A66666 脱敏之后为粤A6***6 | |
| 37 | + */ | |
| 38 | + String replacer() default "*"; | |
| 39 | + | |
| 40 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/ChineseNameDesensitize.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.desensitize.core.slider.annotation; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.desensitize.core.base.annotation.DesensitizeBy; | |
| 4 | +import cn.iocoder.yudao.framework.desensitize.core.slider.handler.ChineseNameDesensitization; | |
| 5 | +import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; | |
| 6 | + | |
| 7 | +import java.lang.annotation.Documented; | |
| 8 | +import java.lang.annotation.ElementType; | |
| 9 | +import java.lang.annotation.Retention; | |
| 10 | +import java.lang.annotation.RetentionPolicy; | |
| 11 | +import java.lang.annotation.Target; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 中文名 | |
| 15 | + * | |
| 16 | + * @author gaibu | |
| 17 | + */ | |
| 18 | +@Documented | |
| 19 | +@Target({ElementType.FIELD}) | |
| 20 | +@Retention(RetentionPolicy.RUNTIME) | |
| 21 | +@JacksonAnnotationsInside | |
| 22 | +@DesensitizeBy(handler = ChineseNameDesensitization.class) | |
| 23 | +public @interface ChineseNameDesensitize { | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 前缀保留长度 | |
| 27 | + */ | |
| 28 | + int prefixKeep() default 1; | |
| 29 | + | |
| 30 | + /** | |
| 31 | + * 后缀保留长度 | |
| 32 | + */ | |
| 33 | + int suffixKeep() default 0; | |
| 34 | + | |
| 35 | + /** | |
| 36 | + * 替换规则,中文名;比如:刘子豪脱敏之后为刘** | |
| 37 | + */ | |
| 38 | + String replacer() default "*"; | |
| 39 | + | |
| 40 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/FixedPhoneDesensitize.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.desensitize.core.slider.annotation; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.desensitize.core.base.annotation.DesensitizeBy; | |
| 4 | +import cn.iocoder.yudao.framework.desensitize.core.slider.handler.FixedPhoneDesensitization; | |
| 5 | +import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; | |
| 6 | + | |
| 7 | +import java.lang.annotation.Documented; | |
| 8 | +import java.lang.annotation.ElementType; | |
| 9 | +import java.lang.annotation.Retention; | |
| 10 | +import java.lang.annotation.RetentionPolicy; | |
| 11 | +import java.lang.annotation.Target; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 固定电话 | |
| 15 | + * | |
| 16 | + * @author gaibu | |
| 17 | + */ | |
| 18 | +@Documented | |
| 19 | +@Target({ElementType.FIELD}) | |
| 20 | +@Retention(RetentionPolicy.RUNTIME) | |
| 21 | +@JacksonAnnotationsInside | |
| 22 | +@DesensitizeBy(handler = FixedPhoneDesensitization.class) | |
| 23 | +public @interface FixedPhoneDesensitize { | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 前缀保留长度 | |
| 27 | + */ | |
| 28 | + int prefixKeep() default 4; | |
| 29 | + | |
| 30 | + /** | |
| 31 | + * 后缀保留长度 | |
| 32 | + */ | |
| 33 | + int suffixKeep() default 2; | |
| 34 | + | |
| 35 | + /** | |
| 36 | + * 替换规则,固定电话;比如:01086551122 脱敏之后为 0108*****22 | |
| 37 | + */ | |
| 38 | + String replacer() default "*"; | |
| 39 | + | |
| 40 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/IdCardDesensitize.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.desensitize.core.slider.annotation; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.desensitize.core.base.annotation.DesensitizeBy; | |
| 4 | +import cn.iocoder.yudao.framework.desensitize.core.slider.handler.IdCardDesensitization; | |
| 5 | +import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; | |
| 6 | + | |
| 7 | +import java.lang.annotation.Documented; | |
| 8 | +import java.lang.annotation.ElementType; | |
| 9 | +import java.lang.annotation.Retention; | |
| 10 | +import java.lang.annotation.RetentionPolicy; | |
| 11 | +import java.lang.annotation.Target; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 身份证 | |
| 15 | + * | |
| 16 | + * @author gaibu | |
| 17 | + */ | |
| 18 | +@Documented | |
| 19 | +@Target({ElementType.FIELD}) | |
| 20 | +@Retention(RetentionPolicy.RUNTIME) | |
| 21 | +@JacksonAnnotationsInside | |
| 22 | +@DesensitizeBy(handler = IdCardDesensitization.class) | |
| 23 | +public @interface IdCardDesensitize { | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 前缀保留长度 | |
| 27 | + */ | |
| 28 | + int prefixKeep() default 6; | |
| 29 | + | |
| 30 | + /** | |
| 31 | + * 后缀保留长度 | |
| 32 | + */ | |
| 33 | + int suffixKeep() default 2; | |
| 34 | + | |
| 35 | + /** | |
| 36 | + * 替换规则,身份证号码;比如:530321199204074611 脱敏之后为 530321**********11 | |
| 37 | + */ | |
| 38 | + String replacer() default "*"; | |
| 39 | + | |
| 40 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/MobileDesensitize.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.desensitize.core.slider.annotation; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.desensitize.core.base.annotation.DesensitizeBy; | |
| 4 | +import cn.iocoder.yudao.framework.desensitize.core.slider.handler.MobileDesensitization; | |
| 5 | +import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; | |
| 6 | + | |
| 7 | +import java.lang.annotation.Documented; | |
| 8 | +import java.lang.annotation.ElementType; | |
| 9 | +import java.lang.annotation.Retention; | |
| 10 | +import java.lang.annotation.RetentionPolicy; | |
| 11 | +import java.lang.annotation.Target; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 手机号 | |
| 15 | + * | |
| 16 | + * @author gaibu | |
| 17 | + */ | |
| 18 | +@Documented | |
| 19 | +@Target({ElementType.FIELD}) | |
| 20 | +@Retention(RetentionPolicy.RUNTIME) | |
| 21 | +@JacksonAnnotationsInside | |
| 22 | +@DesensitizeBy(handler = MobileDesensitization.class) | |
| 23 | +public @interface MobileDesensitize { | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 前缀保留长度 | |
| 27 | + */ | |
| 28 | + int prefixKeep() default 3; | |
| 29 | + | |
| 30 | + /** | |
| 31 | + * 后缀保留长度 | |
| 32 | + */ | |
| 33 | + int suffixKeep() default 4; | |
| 34 | + | |
| 35 | + /** | |
| 36 | + * 替换规则,手机号;比如:13248765917 脱敏之后为 132****5917 | |
| 37 | + */ | |
| 38 | + String replacer() default "*"; | |
| 39 | + | |
| 40 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/PasswordDesensitize.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.desensitize.core.slider.annotation; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.desensitize.core.base.annotation.DesensitizeBy; | |
| 4 | +import cn.iocoder.yudao.framework.desensitize.core.slider.handler.PasswordDesensitization; | |
| 5 | +import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; | |
| 6 | + | |
| 7 | +import java.lang.annotation.Documented; | |
| 8 | +import java.lang.annotation.ElementType; | |
| 9 | +import java.lang.annotation.Retention; | |
| 10 | +import java.lang.annotation.RetentionPolicy; | |
| 11 | +import java.lang.annotation.Target; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 密码 | |
| 15 | + * | |
| 16 | + * @author gaibu | |
| 17 | + */ | |
| 18 | +@Documented | |
| 19 | +@Target({ElementType.FIELD}) | |
| 20 | +@Retention(RetentionPolicy.RUNTIME) | |
| 21 | +@JacksonAnnotationsInside | |
| 22 | +@DesensitizeBy(handler = PasswordDesensitization.class) | |
| 23 | +public @interface PasswordDesensitize { | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 前缀保留长度 | |
| 27 | + */ | |
| 28 | + int prefixKeep() default 0; | |
| 29 | + | |
| 30 | + /** | |
| 31 | + * 后缀保留长度 | |
| 32 | + */ | |
| 33 | + int suffixKeep() default 0; | |
| 34 | + | |
| 35 | + /** | |
| 36 | + * 替换规则,密码; | |
| 37 | + * | |
| 38 | + * 比如:123456 脱敏之后为 ****** | |
| 39 | + */ | |
| 40 | + String replacer() default "*"; | |
| 41 | + | |
| 42 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/annotation/SliderDesensitize.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.desensitize.core.slider.annotation; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.desensitize.core.base.annotation.DesensitizeBy; | |
| 4 | +import cn.iocoder.yudao.framework.desensitize.core.slider.handler.DefaultDesensitizationHandler; | |
| 5 | +import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; | |
| 6 | + | |
| 7 | +import java.lang.annotation.Documented; | |
| 8 | +import java.lang.annotation.ElementType; | |
| 9 | +import java.lang.annotation.Retention; | |
| 10 | +import java.lang.annotation.RetentionPolicy; | |
| 11 | +import java.lang.annotation.Target; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 滑动脱敏注解 | |
| 15 | + * | |
| 16 | + * @author gaibu | |
| 17 | + */ | |
| 18 | +@Documented | |
| 19 | +@Target({ElementType.FIELD, ElementType.ANNOTATION_TYPE}) | |
| 20 | +@Retention(RetentionPolicy.RUNTIME) | |
| 21 | +@JacksonAnnotationsInside | |
| 22 | +@DesensitizeBy(handler = DefaultDesensitizationHandler.class) | |
| 23 | +public @interface SliderDesensitize { | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 后缀保留长度 | |
| 27 | + */ | |
| 28 | + int suffixKeep() default 0; | |
| 29 | + | |
| 30 | + /** | |
| 31 | + * 替换规则,会将前缀后缀保留后,全部替换成 replacer | |
| 32 | + * | |
| 33 | + * 例如:prefixKeep = 1; suffixKeep = 2; replacer = "*"; | |
| 34 | + * 原始字符串 123456 | |
| 35 | + * 脱敏后 1***56 | |
| 36 | + */ | |
| 37 | + String replacer() default "*"; | |
| 38 | + | |
| 39 | + /** | |
| 40 | + * 前缀保留长度 | |
| 41 | + */ | |
| 42 | + int prefixKeep() default 0; | |
| 43 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/AbstractSliderDesensitizationHandler.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.desensitize.core.slider.handler; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.desensitize.core.base.handler.DesensitizationHandler; | |
| 4 | + | |
| 5 | +import java.lang.annotation.Annotation; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * 滑动脱敏处理器抽象类,已实现通用的方法 | |
| 9 | + * | |
| 10 | + * @author gaibu | |
| 11 | + */ | |
| 12 | +public abstract class AbstractSliderDesensitizationHandler<T extends Annotation> | |
| 13 | + implements DesensitizationHandler<T> { | |
| 14 | + | |
| 15 | + @Override | |
| 16 | + public String desensitize(String origin, T annotation) { | |
| 17 | + int prefixKeep = getPrefixKeep(annotation); | |
| 18 | + int suffixKeep = getSuffixKeep(annotation); | |
| 19 | + String replacer = getReplacer(annotation); | |
| 20 | + int length = origin.length(); | |
| 21 | + | |
| 22 | + // 情况一:原始字符串长度小于等于保留长度,则原始字符串全部替换 | |
| 23 | + if (prefixKeep >= length || suffixKeep >= length) { | |
| 24 | + return buildReplacerByLength(replacer, length); | |
| 25 | + } | |
| 26 | + | |
| 27 | + // 情况二:原始字符串长度小于等于前后缀保留字符串长度,则原始字符串全部替换 | |
| 28 | + if ((prefixKeep + suffixKeep) >= length) { | |
| 29 | + return buildReplacerByLength(replacer, length); | |
| 30 | + } | |
| 31 | + | |
| 32 | + // 情况三:原始字符串长度大于前后缀保留字符串长度,则替换中间字符串 | |
| 33 | + int interval = length - prefixKeep - suffixKeep; | |
| 34 | + return origin.substring(0, prefixKeep) + | |
| 35 | + buildReplacerByLength(replacer, interval) + | |
| 36 | + origin.substring(prefixKeep + interval); | |
| 37 | + } | |
| 38 | + | |
| 39 | + /** | |
| 40 | + * 根据长度循环构建替换符 | |
| 41 | + * | |
| 42 | + * @param replacer 替换符 | |
| 43 | + * @param length 长度 | |
| 44 | + * @return 构建后的替换符 | |
| 45 | + */ | |
| 46 | + private String buildReplacerByLength(String replacer, int length) { | |
| 47 | + StringBuilder builder = new StringBuilder(); | |
| 48 | + for (int i = 0; i < length; i++) { | |
| 49 | + builder.append(replacer); | |
| 50 | + } | |
| 51 | + return builder.toString(); | |
| 52 | + } | |
| 53 | + | |
| 54 | + /** | |
| 55 | + * 前缀保留长度 | |
| 56 | + * | |
| 57 | + * @param annotation 注解信息 | |
| 58 | + * @return 前缀保留长度 | |
| 59 | + */ | |
| 60 | + abstract Integer getPrefixKeep(T annotation); | |
| 61 | + | |
| 62 | + /** | |
| 63 | + * 后缀保留长度 | |
| 64 | + * | |
| 65 | + * @param annotation 注解信息 | |
| 66 | + * @return 后缀保留长度 | |
| 67 | + */ | |
| 68 | + abstract Integer getSuffixKeep(T annotation); | |
| 69 | + | |
| 70 | + /** | |
| 71 | + * 替换符 | |
| 72 | + * | |
| 73 | + * @param annotation 注解信息 | |
| 74 | + * @return 替换符 | |
| 75 | + */ | |
| 76 | + abstract String getReplacer(T annotation); | |
| 77 | + | |
| 78 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/BankCardDesensitization.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.desensitize.core.slider.handler; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.BankCardDesensitize; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * {@link BankCardDesensitize} 的脱敏处理器 | |
| 7 | + * | |
| 8 | + * @author gaibu | |
| 9 | + */ | |
| 10 | +public class BankCardDesensitization extends AbstractSliderDesensitizationHandler<BankCardDesensitize> { | |
| 11 | + | |
| 12 | + @Override | |
| 13 | + Integer getPrefixKeep(BankCardDesensitize annotation) { | |
| 14 | + return annotation.prefixKeep(); | |
| 15 | + } | |
| 16 | + | |
| 17 | + @Override | |
| 18 | + Integer getSuffixKeep(BankCardDesensitize annotation) { | |
| 19 | + return annotation.suffixKeep(); | |
| 20 | + } | |
| 21 | + | |
| 22 | + @Override | |
| 23 | + String getReplacer(BankCardDesensitize annotation) { | |
| 24 | + return annotation.replacer(); | |
| 25 | + } | |
| 26 | + | |
| 27 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/CarLicenseDesensitization.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.desensitize.core.slider.handler; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.CarLicenseDesensitize; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * {@link CarLicenseDesensitize} 的脱敏处理器 | |
| 7 | + * | |
| 8 | + * @author gaibu | |
| 9 | + */ | |
| 10 | +public class CarLicenseDesensitization extends AbstractSliderDesensitizationHandler<CarLicenseDesensitize> { | |
| 11 | + @Override | |
| 12 | + Integer getPrefixKeep(CarLicenseDesensitize annotation) { | |
| 13 | + return annotation.prefixKeep(); | |
| 14 | + } | |
| 15 | + | |
| 16 | + @Override | |
| 17 | + Integer getSuffixKeep(CarLicenseDesensitize annotation) { | |
| 18 | + return annotation.suffixKeep(); | |
| 19 | + } | |
| 20 | + | |
| 21 | + @Override | |
| 22 | + String getReplacer(CarLicenseDesensitize annotation) { | |
| 23 | + return annotation.replacer(); | |
| 24 | + } | |
| 25 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/ChineseNameDesensitization.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.desensitize.core.slider.handler; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.ChineseNameDesensitize; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * {@link ChineseNameDesensitize} 的脱敏处理器 | |
| 7 | + * | |
| 8 | + * @author gaibu | |
| 9 | + */ | |
| 10 | +public class ChineseNameDesensitization extends AbstractSliderDesensitizationHandler<ChineseNameDesensitize> { | |
| 11 | + | |
| 12 | + @Override | |
| 13 | + Integer getPrefixKeep(ChineseNameDesensitize annotation) { | |
| 14 | + return annotation.prefixKeep(); | |
| 15 | + } | |
| 16 | + | |
| 17 | + @Override | |
| 18 | + Integer getSuffixKeep(ChineseNameDesensitize annotation) { | |
| 19 | + return annotation.suffixKeep(); | |
| 20 | + } | |
| 21 | + | |
| 22 | + @Override | |
| 23 | + String getReplacer(ChineseNameDesensitize annotation) { | |
| 24 | + return annotation.replacer(); | |
| 25 | + } | |
| 26 | + | |
| 27 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/DefaultDesensitizationHandler.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.desensitize.core.slider.handler; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.SliderDesensitize; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * {@link SliderDesensitize} 的脱敏处理器 | |
| 7 | + * | |
| 8 | + * @author gaibu | |
| 9 | + */ | |
| 10 | +public class DefaultDesensitizationHandler extends AbstractSliderDesensitizationHandler<SliderDesensitize> { | |
| 11 | + @Override | |
| 12 | + Integer getPrefixKeep(SliderDesensitize annotation) { | |
| 13 | + return annotation.prefixKeep(); | |
| 14 | + } | |
| 15 | + | |
| 16 | + @Override | |
| 17 | + Integer getSuffixKeep(SliderDesensitize annotation) { | |
| 18 | + return annotation.suffixKeep(); | |
| 19 | + } | |
| 20 | + | |
| 21 | + @Override | |
| 22 | + String getReplacer(SliderDesensitize annotation) { | |
| 23 | + return annotation.replacer(); | |
| 24 | + } | |
| 25 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/FixedPhoneDesensitization.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.desensitize.core.slider.handler; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.FixedPhoneDesensitize; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * {@link FixedPhoneDesensitize} 的脱敏处理器 | |
| 7 | + * | |
| 8 | + * @author gaibu | |
| 9 | + */ | |
| 10 | +public class FixedPhoneDesensitization extends AbstractSliderDesensitizationHandler<FixedPhoneDesensitize> { | |
| 11 | + @Override | |
| 12 | + Integer getPrefixKeep(FixedPhoneDesensitize annotation) { | |
| 13 | + return annotation.prefixKeep(); | |
| 14 | + } | |
| 15 | + | |
| 16 | + @Override | |
| 17 | + Integer getSuffixKeep(FixedPhoneDesensitize annotation) { | |
| 18 | + return annotation.suffixKeep(); | |
| 19 | + } | |
| 20 | + | |
| 21 | + @Override | |
| 22 | + String getReplacer(FixedPhoneDesensitize annotation) { | |
| 23 | + return annotation.replacer(); | |
| 24 | + } | |
| 25 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/IdCardDesensitization.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.desensitize.core.slider.handler; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.IdCardDesensitize; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * {@link IdCardDesensitize} 的脱敏处理器 | |
| 7 | + * | |
| 8 | + * @author gaibu | |
| 9 | + */ | |
| 10 | +public class IdCardDesensitization extends AbstractSliderDesensitizationHandler<IdCardDesensitize> { | |
| 11 | + @Override | |
| 12 | + Integer getPrefixKeep(IdCardDesensitize annotation) { | |
| 13 | + return annotation.prefixKeep(); | |
| 14 | + } | |
| 15 | + | |
| 16 | + @Override | |
| 17 | + Integer getSuffixKeep(IdCardDesensitize annotation) { | |
| 18 | + return annotation.suffixKeep(); | |
| 19 | + } | |
| 20 | + | |
| 21 | + @Override | |
| 22 | + String getReplacer(IdCardDesensitize annotation) { | |
| 23 | + return annotation.replacer(); | |
| 24 | + } | |
| 25 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/MobileDesensitization.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.desensitize.core.slider.handler; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.MobileDesensitize; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * {@link MobileDesensitize} 的脱敏处理器 | |
| 7 | + * | |
| 8 | + * @author gaibu | |
| 9 | + */ | |
| 10 | +public class MobileDesensitization extends AbstractSliderDesensitizationHandler<MobileDesensitize> { | |
| 11 | + | |
| 12 | + @Override | |
| 13 | + Integer getPrefixKeep(MobileDesensitize annotation) { | |
| 14 | + return annotation.prefixKeep(); | |
| 15 | + } | |
| 16 | + | |
| 17 | + @Override | |
| 18 | + Integer getSuffixKeep(MobileDesensitize annotation) { | |
| 19 | + return annotation.suffixKeep(); | |
| 20 | + } | |
| 21 | + | |
| 22 | + @Override | |
| 23 | + String getReplacer(MobileDesensitize annotation) { | |
| 24 | + return annotation.replacer(); | |
| 25 | + } | |
| 26 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/src/main/java/cn/iocoder/yudao/framework/desensitize/core/slider/handler/PasswordDesensitization.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.desensitize.core.slider.handler; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.PasswordDesensitize; | |
| 4 | + | |
| 5 | +/** | |
| 6 | + * {@link PasswordDesensitize} 的码脱敏处理器 | |
| 7 | + * | |
| 8 | + * @author gaibu | |
| 9 | + */ | |
| 10 | +public class PasswordDesensitization extends AbstractSliderDesensitizationHandler<PasswordDesensitize> { | |
| 11 | + @Override | |
| 12 | + Integer getPrefixKeep(PasswordDesensitize annotation) { | |
| 13 | + return annotation.prefixKeep(); | |
| 14 | + } | |
| 15 | + | |
| 16 | + @Override | |
| 17 | + Integer getSuffixKeep(PasswordDesensitize annotation) { | |
| 18 | + return annotation.suffixKeep(); | |
| 19 | + } | |
| 20 | + | |
| 21 | + @Override | |
| 22 | + String getReplacer(PasswordDesensitize annotation) { | |
| 23 | + return annotation.replacer(); | |
| 24 | + } | |
| 25 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/src/test/java/cn/iocoder/yudao/framework/desensitize/core/DesensitizeTest.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.desensitize.core; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.util.json.JsonUtils; | |
| 4 | +import cn.iocoder.yudao.framework.desensitize.core.regex.annotation.EmailDesensitize; | |
| 5 | +import cn.iocoder.yudao.framework.desensitize.core.regex.annotation.RegexDesensitize; | |
| 6 | +import cn.iocoder.yudao.framework.desensitize.core.annotation.Address; | |
| 7 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.BankCardDesensitize; | |
| 8 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.CarLicenseDesensitize; | |
| 9 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.ChineseNameDesensitize; | |
| 10 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.FixedPhoneDesensitize; | |
| 11 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.IdCardDesensitize; | |
| 12 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.PasswordDesensitize; | |
| 13 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.MobileDesensitize; | |
| 14 | +import cn.iocoder.yudao.framework.desensitize.core.slider.annotation.SliderDesensitize; | |
| 15 | +import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest; | |
| 16 | +import lombok.Data; | |
| 17 | +import org.junit.jupiter.api.Test; | |
| 18 | + | |
| 19 | +import static org.junit.jupiter.api.Assertions.*; | |
| 20 | + | |
| 21 | +/** | |
| 22 | + * {@link DesensitizeTest} 的单元测试 | |
| 23 | + */ | |
| 24 | +public class DesensitizeTest extends BaseMockitoUnitTest { | |
| 25 | + | |
| 26 | + @Test | |
| 27 | + public void test() { | |
| 28 | + // 准备参数 | |
| 29 | + DesensitizeDemo desensitizeDemo = new DesensitizeDemo(); | |
| 30 | + desensitizeDemo.setNickname("芋道源码"); | |
| 31 | + desensitizeDemo.setBankCard("9988002866797031"); | |
| 32 | + desensitizeDemo.setCarLicense("粤A66666"); | |
| 33 | + desensitizeDemo.setFixedPhone("01086551122"); | |
| 34 | + desensitizeDemo.setIdCard("530321199204074611"); | |
| 35 | + desensitizeDemo.setPassword("123456"); | |
| 36 | + desensitizeDemo.setPhoneNumber("13248765917"); | |
| 37 | + desensitizeDemo.setSlider1("ABCDEFG"); | |
| 38 | + desensitizeDemo.setSlider2("ABCDEFG"); | |
| 39 | + desensitizeDemo.setSlider3("ABCDEFG"); | |
| 40 | + desensitizeDemo.setEmail("1@email.com"); | |
| 41 | + desensitizeDemo.setRegex("你好,我是芋道源码"); | |
| 42 | + desensitizeDemo.setAddress("北京市海淀区上地十街10号"); | |
| 43 | + desensitizeDemo.setOrigin("芋道源码"); | |
| 44 | + | |
| 45 | + // 调用 | |
| 46 | + DesensitizeDemo d = JsonUtils.parseObject(JsonUtils.toJsonString(desensitizeDemo), DesensitizeDemo.class); | |
| 47 | + // 断言 | |
| 48 | + assertNotNull(d); | |
| 49 | + assertEquals("芋***", d.getNickname()); | |
| 50 | + assertEquals("998800********31", d.getBankCard()); | |
| 51 | + assertEquals("粤A6***6", d.getCarLicense()); | |
| 52 | + assertEquals("0108*****22", d.getFixedPhone()); | |
| 53 | + assertEquals("530321**********11", d.getIdCard()); | |
| 54 | + assertEquals("******", d.getPassword()); | |
| 55 | + assertEquals("132****5917", d.getPhoneNumber()); | |
| 56 | + assertEquals("#######", d.getSlider1()); | |
| 57 | + assertEquals("ABC*EFG", d.getSlider2()); | |
| 58 | + assertEquals("*******", d.getSlider3()); | |
| 59 | + assertEquals("1****@email.com", d.getEmail()); | |
| 60 | + assertEquals("你好,我是*", d.getRegex()); | |
| 61 | + assertEquals("北京市海淀区上地十街10号*", d.getAddress()); | |
| 62 | + assertEquals("芋道源码", d.getOrigin()); | |
| 63 | + } | |
| 64 | + | |
| 65 | + @Data | |
| 66 | + public static class DesensitizeDemo { | |
| 67 | + | |
| 68 | + @ChineseNameDesensitize | |
| 69 | + private String nickname; | |
| 70 | + @BankCardDesensitize | |
| 71 | + private String bankCard; | |
| 72 | + @CarLicenseDesensitize | |
| 73 | + private String carLicense; | |
| 74 | + @FixedPhoneDesensitize | |
| 75 | + private String fixedPhone; | |
| 76 | + @IdCardDesensitize | |
| 77 | + private String idCard; | |
| 78 | + @PasswordDesensitize | |
| 79 | + private String password; | |
| 80 | + @MobileDesensitize | |
| 81 | + private String phoneNumber; | |
| 82 | + @SliderDesensitize(prefixKeep = 6, suffixKeep = 1, replacer = "#") | |
| 83 | + private String slider1; | |
| 84 | + @SliderDesensitize(prefixKeep = 3, suffixKeep = 3) | |
| 85 | + private String slider2; | |
| 86 | + @SliderDesensitize(prefixKeep = 10) | |
| 87 | + private String slider3; | |
| 88 | + @EmailDesensitize | |
| 89 | + private String email; | |
| 90 | + @RegexDesensitize(regex = "芋道源码", replacer = "*") | |
| 91 | + private String regex; | |
| 92 | + @Address | |
| 93 | + private String address; | |
| 94 | + private String origin; | |
| 95 | + | |
| 96 | + } | |
| 97 | + | |
| 98 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/src/test/java/cn/iocoder/yudao/framework/desensitize/core/annotation/Address.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.desensitize.core.annotation; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.desensitize.core.DesensitizeTest; | |
| 4 | +import cn.iocoder.yudao.framework.desensitize.core.base.annotation.DesensitizeBy; | |
| 5 | +import cn.iocoder.yudao.framework.desensitize.core.handler.AddressHandler; | |
| 6 | +import com.fasterxml.jackson.annotation.JacksonAnnotationsInside; | |
| 7 | + | |
| 8 | +import java.lang.annotation.Documented; | |
| 9 | +import java.lang.annotation.ElementType; | |
| 10 | +import java.lang.annotation.Retention; | |
| 11 | +import java.lang.annotation.RetentionPolicy; | |
| 12 | +import java.lang.annotation.Target; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * 地址 | |
| 16 | + * | |
| 17 | + * 用于 {@link DesensitizeTest} 测试使用 | |
| 18 | + * | |
| 19 | + * @author gaibu | |
| 20 | + */ | |
| 21 | +@Documented | |
| 22 | +@Target({ElementType.FIELD}) | |
| 23 | +@Retention(RetentionPolicy.RUNTIME) | |
| 24 | +@JacksonAnnotationsInside | |
| 25 | +@DesensitizeBy(handler = AddressHandler.class) | |
| 26 | +public @interface Address { | |
| 27 | + | |
| 28 | + String replacer() default "*"; | |
| 29 | + | |
| 30 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-desensitize/src/test/java/cn/iocoder/yudao/framework/desensitize/core/handler/AddressHandler.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.desensitize.core.handler; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.desensitize.core.DesensitizeTest; | |
| 4 | +import cn.iocoder.yudao.framework.desensitize.core.base.handler.DesensitizationHandler; | |
| 5 | +import cn.iocoder.yudao.framework.desensitize.core.annotation.Address; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * {@link Address} 的脱敏处理器 | |
| 9 | + * | |
| 10 | + * 用于 {@link DesensitizeTest} 测试使用 | |
| 11 | + */ | |
| 12 | +public class AddressHandler implements DesensitizationHandler<Address> { | |
| 13 | + | |
| 14 | + @Override | |
| 15 | + public String desensitize(String origin, Address annotation) { | |
| 16 | + return origin + annotation.replacer(); | |
| 17 | + } | |
| 18 | + | |
| 19 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/mapper/BaseMapperX.java
| ... | ... | @@ -81,22 +81,19 @@ public interface BaseMapperX<T> extends BaseMapper<T> { |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | /** |
| 84 | - * 逐条插入,适合少量数据插入,或者对性能要求不高的场景 | |
| 85 | - * <p> | |
| 86 | - * 如果大量,请使用 {@link com.baomidou.mybatisplus.extension.service.impl.ServiceImpl#saveBatch(Collection)} 方法 | |
| 87 | - * 使用示例,可见 RoleMenuBatchInsertMapper、UserRoleBatchInsertMapper 类 | |
| 84 | + * 批量插入,适合大量数据插入 | |
| 88 | 85 | * |
| 89 | 86 | * @param entities 实体们 |
| 90 | 87 | */ |
| 91 | 88 | default void insertBatch(Collection<T> entities) { |
| 92 | - entities.forEach(this::insert); | |
| 89 | + Db.saveBatch(entities); | |
| 93 | 90 | } |
| 94 | 91 | |
| 95 | 92 | /** |
| 96 | 93 | * 批量插入,适合大量数据插入 |
| 97 | 94 | * |
| 98 | 95 | * @param entities 实体们 |
| 99 | - * @param size 插入数量 Db.saveBatch 默认为1000 | |
| 96 | + * @param size 插入数量 Db.saveBatch 默认为 1000 | |
| 100 | 97 | */ |
| 101 | 98 | default void insertBatch(Collection<T> entities, int size) { |
| 102 | 99 | Db.saveBatch(entities, size); | ... | ... |
yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/LambdaQueryWrapperX.java
| 1 | 1 | package cn.iocoder.yudao.framework.mybatis.core.query; |
| 2 | 2 | |
| 3 | +import cn.hutool.core.lang.Assert; | |
| 3 | 4 | import cn.hutool.core.util.ArrayUtil; |
| 4 | 5 | import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; |
| 6 | +import cn.iocoder.yudao.framework.mybatis.core.enums.SqlConstants; | |
| 5 | 7 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| 6 | 8 | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| 7 | 9 | import com.baomidou.mybatisplus.core.toolkit.support.SFunction; | ... | ... |
yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/query/QueryWrapperX.java
| ... | ... | @@ -146,19 +146,19 @@ public class QueryWrapperX<T> extends QueryWrapper<T> { |
| 146 | 146 | * |
| 147 | 147 | * @return this |
| 148 | 148 | */ |
| 149 | - public QueryWrapperX<T> limit1() { | |
| 149 | + public QueryWrapperX<T> limitN(int n) { | |
| 150 | 150 | Assert.notNull(SqlConstants.DB_TYPE, "获取不到数据库的类型"); |
| 151 | 151 | switch (SqlConstants.DB_TYPE) { |
| 152 | 152 | case ORACLE: |
| 153 | 153 | case ORACLE_12C: |
| 154 | - super.eq("ROWNUM", 1); | |
| 154 | + super.eq("ROWNUM", n); | |
| 155 | 155 | break; |
| 156 | 156 | case SQL_SERVER: |
| 157 | 157 | case SQL_SERVER2005: |
| 158 | - super.select("TOP 1 *"); // 由于 SQL Server 是通过 SELECT TOP 1 实现限制一条,所以只好使用 * 查询剩余字段 | |
| 158 | + super.select("TOP " + n + " *"); // 由于 SQL Server 是通过 SELECT TOP 1 实现限制一条,所以只好使用 * 查询剩余字段 | |
| 159 | 159 | break; |
| 160 | 160 | default: |
| 161 | - super.last("LIMIT 1"); | |
| 161 | + super.last("LIMIT " + n); | |
| 162 | 162 | } |
| 163 | 163 | return this; |
| 164 | 164 | } | ... | ... |
yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/util/RandomUtils.java
| ... | ... | @@ -7,7 +7,10 @@ import cn.hutool.core.util.StrUtil; |
| 7 | 7 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| 8 | 8 | import uk.co.jemos.podam.api.PodamFactory; |
| 9 | 9 | import uk.co.jemos.podam.api.PodamFactoryImpl; |
| 10 | +import uk.co.jemos.podam.common.AttributeStrategy; | |
| 10 | 11 | |
| 12 | +import javax.validation.constraints.Email; | |
| 13 | +import java.lang.annotation.Annotation; | |
| 11 | 14 | import java.lang.reflect.Type; |
| 12 | 15 | import java.time.LocalDateTime; |
| 13 | 16 | import java.util.Arrays; |
| ... | ... | @@ -95,6 +98,10 @@ public class RandomUtils { |
| 95 | 98 | return RandomUtil.randomEle(CommonStatusEnum.values()).getStatus(); |
| 96 | 99 | } |
| 97 | 100 | |
| 101 | + public static String randomEmail() { | |
| 102 | + return randomString() + "@qq.com"; | |
| 103 | + } | |
| 104 | + | |
| 98 | 105 | @SafeVarargs |
| 99 | 106 | public static <T> T randomPojo(Class<T> clazz, Consumer<T>... consumers) { |
| 100 | 107 | T pojo = PODAM_FACTORY.manufacturePojo(clazz); | ... | ... |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/package-info.java
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/YudaoWebAutoConfiguration.java
| ... | ... | @@ -2,27 +2,18 @@ package cn.iocoder.yudao.framework.web.config; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.apilog.core.service.ApiErrorLogFrameworkService; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.enums.WebFilterOrderEnum; |
| 5 | -import cn.iocoder.yudao.framework.web.core.clean.JsoupXssCleaner; | |
| 6 | -import cn.iocoder.yudao.framework.web.core.clean.XssCleaner; | |
| 7 | 5 | import cn.iocoder.yudao.framework.web.core.filter.CacheRequestBodyFilter; |
| 8 | 6 | import cn.iocoder.yudao.framework.web.core.filter.DemoFilter; |
| 9 | -import cn.iocoder.yudao.framework.web.core.filter.XssFilter; | |
| 10 | 7 | import cn.iocoder.yudao.framework.web.core.handler.GlobalExceptionHandler; |
| 11 | 8 | import cn.iocoder.yudao.framework.web.core.handler.GlobalResponseBodyHandler; |
| 12 | -import cn.iocoder.yudao.framework.web.core.json.XssStringJsonDeserializer; | |
| 13 | 9 | import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils; |
| 14 | -import com.fasterxml.jackson.databind.ObjectMapper; | |
| 15 | 10 | import org.springframework.beans.factory.annotation.Value; |
| 16 | 11 | import org.springframework.boot.autoconfigure.AutoConfiguration; |
| 17 | -import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; | |
| 18 | -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; | |
| 19 | 12 | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| 20 | -import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer; | |
| 21 | 13 | import org.springframework.boot.context.properties.EnableConfigurationProperties; |
| 22 | 14 | import org.springframework.boot.web.servlet.FilterRegistrationBean; |
| 23 | 15 | import org.springframework.context.annotation.Bean; |
| 24 | 16 | import org.springframework.util.AntPathMatcher; |
| 25 | -import org.springframework.util.PathMatcher; | |
| 26 | 17 | import org.springframework.web.bind.annotation.RestController; |
| 27 | 18 | import org.springframework.web.cors.CorsConfiguration; |
| 28 | 19 | import org.springframework.web.cors.UrlBasedCorsConfigurationSource; |
| ... | ... | @@ -34,7 +25,7 @@ import javax.annotation.Resource; |
| 34 | 25 | import javax.servlet.Filter; |
| 35 | 26 | |
| 36 | 27 | @AutoConfiguration |
| 37 | -@EnableConfigurationProperties({WebProperties.class, XssProperties.class}) | |
| 28 | +@EnableConfigurationProperties(WebProperties.class) | |
| 38 | 29 | public class YudaoWebAutoConfiguration implements WebMvcConfigurer { |
| 39 | 30 | |
| 40 | 31 | @Resource |
| ... | ... | @@ -108,15 +99,6 @@ public class YudaoWebAutoConfiguration implements WebMvcConfigurer { |
| 108 | 99 | } |
| 109 | 100 | |
| 110 | 101 | /** |
| 111 | - * 创建 XssFilter Bean,解决 Xss 安全问题 | |
| 112 | - */ | |
| 113 | - @Bean | |
| 114 | - @ConditionalOnBean(XssCleaner.class) | |
| 115 | - public FilterRegistrationBean<XssFilter> xssFilter(XssProperties properties, PathMatcher pathMatcher, XssCleaner xssCleaner) { | |
| 116 | - return createFilterBean(new XssFilter(properties, pathMatcher, xssCleaner), WebFilterOrderEnum.XSS_FILTER); | |
| 117 | - } | |
| 118 | - | |
| 119 | - /** | |
| 120 | 102 | * 创建 DemoFilter Bean,演示模式 |
| 121 | 103 | */ |
| 122 | 104 | @Bean |
| ... | ... | @@ -125,33 +107,7 @@ public class YudaoWebAutoConfiguration implements WebMvcConfigurer { |
| 125 | 107 | return createFilterBean(new DemoFilter(), WebFilterOrderEnum.DEMO_FILTER); |
| 126 | 108 | } |
| 127 | 109 | |
| 128 | - | |
| 129 | - /** | |
| 130 | - * Xss 清理者 | |
| 131 | - * | |
| 132 | - * @return XssCleaner | |
| 133 | - */ | |
| 134 | - @Bean | |
| 135 | - @ConditionalOnMissingBean(XssCleaner.class) | |
| 136 | - public XssCleaner xssCleaner() { | |
| 137 | - return new JsoupXssCleaner(); | |
| 138 | - } | |
| 139 | - | |
| 140 | - /** | |
| 141 | - * 注册 Jackson 的序列化器,用于处理 json 类型参数的 xss 过滤 | |
| 142 | - * | |
| 143 | - * @return Jackson2ObjectMapperBuilderCustomizer | |
| 144 | - */ | |
| 145 | - @Bean | |
| 146 | - @ConditionalOnMissingBean(name = "xssJacksonCustomizer") | |
| 147 | - @ConditionalOnBean(ObjectMapper.class) | |
| 148 | - @ConditionalOnProperty(value = "yudao.xss.enable", havingValue = "true") | |
| 149 | - public Jackson2ObjectMapperBuilderCustomizer xssJacksonCustomizer(XssCleaner xssCleaner) { | |
| 150 | - // 在反序列化时进行 xss 过滤,可以替换使用 XssStringJsonSerializer,在序列化时进行处理 | |
| 151 | - return builder -> builder.deserializerByType(String.class, new XssStringJsonDeserializer(xssCleaner)); | |
| 152 | - } | |
| 153 | - | |
| 154 | - private static <T extends Filter> FilterRegistrationBean<T> createFilterBean(T filter, Integer order) { | |
| 110 | + public static <T extends Filter> FilterRegistrationBean<T> createFilterBean(T filter, Integer order) { | |
| 155 | 111 | FilterRegistrationBean<T> bean = new FilterRegistrationBean<>(filter); |
| 156 | 112 | bean.setOrder(order); |
| 157 | 113 | return bean; | ... | ... |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/config/XssProperties.java renamed to yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/xss/config/XssProperties.java
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/xss/config/YudaoXssAutoConfiguration.java
0 → 100644
| 1 | +package cn.iocoder.yudao.framework.xss.config; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.enums.WebFilterOrderEnum; | |
| 4 | +import cn.iocoder.yudao.framework.xss.core.clean.JsoupXssCleaner; | |
| 5 | +import cn.iocoder.yudao.framework.xss.core.clean.XssCleaner; | |
| 6 | +import cn.iocoder.yudao.framework.xss.core.filter.XssFilter; | |
| 7 | +import cn.iocoder.yudao.framework.xss.core.json.XssStringJsonDeserializer; | |
| 8 | +import com.fasterxml.jackson.databind.ObjectMapper; | |
| 9 | +import org.springframework.boot.autoconfigure.AutoConfiguration; | |
| 10 | +import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; | |
| 11 | +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; | |
| 12 | +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | |
| 13 | +import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer; | |
| 14 | +import org.springframework.boot.context.properties.EnableConfigurationProperties; | |
| 15 | +import org.springframework.boot.web.servlet.FilterRegistrationBean; | |
| 16 | +import org.springframework.context.annotation.Bean; | |
| 17 | +import org.springframework.util.PathMatcher; | |
| 18 | +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | |
| 19 | + | |
| 20 | +import static cn.iocoder.yudao.framework.web.config.YudaoWebAutoConfiguration.createFilterBean; | |
| 21 | + | |
| 22 | +@AutoConfiguration | |
| 23 | +@EnableConfigurationProperties(XssProperties.class) | |
| 24 | +public class YudaoXssAutoConfiguration implements WebMvcConfigurer { | |
| 25 | + | |
| 26 | + /** | |
| 27 | + * Xss 清理者 | |
| 28 | + * | |
| 29 | + * @return XssCleaner | |
| 30 | + */ | |
| 31 | + @Bean | |
| 32 | + @ConditionalOnMissingBean(XssCleaner.class) | |
| 33 | + public XssCleaner xssCleaner() { | |
| 34 | + return new JsoupXssCleaner(); | |
| 35 | + } | |
| 36 | + | |
| 37 | + /** | |
| 38 | + * 注册 Jackson 的序列化器,用于处理 json 类型参数的 xss 过滤 | |
| 39 | + * | |
| 40 | + * @return Jackson2ObjectMapperBuilderCustomizer | |
| 41 | + */ | |
| 42 | + @Bean | |
| 43 | + @ConditionalOnMissingBean(name = "xssJacksonCustomizer") | |
| 44 | + @ConditionalOnBean(ObjectMapper.class) | |
| 45 | + @ConditionalOnProperty(value = "yudao.xss.enable", havingValue = "true") | |
| 46 | + public Jackson2ObjectMapperBuilderCustomizer xssJacksonCustomizer(XssCleaner xssCleaner) { | |
| 47 | + // 在反序列化时进行 xss 过滤,可以替换使用 XssStringJsonSerializer,在序列化时进行处理 | |
| 48 | + return builder -> builder.deserializerByType(String.class, new XssStringJsonDeserializer(xssCleaner)); | |
| 49 | + } | |
| 50 | + | |
| 51 | + /** | |
| 52 | + * 创建 XssFilter Bean,解决 Xss 安全问题 | |
| 53 | + */ | |
| 54 | + @Bean | |
| 55 | + @ConditionalOnBean(XssCleaner.class) | |
| 56 | + public FilterRegistrationBean<XssFilter> xssFilter(XssProperties properties, PathMatcher pathMatcher, XssCleaner xssCleaner) { | |
| 57 | + return createFilterBean(new XssFilter(properties, pathMatcher, xssCleaner), WebFilterOrderEnum.XSS_FILTER); | |
| 58 | + } | |
| 59 | + | |
| 60 | +} | ... | ... |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/clean/JsoupXssCleaner.java renamed to yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/xss/core/clean/JsoupXssCleaner.java
| 1 | -package cn.iocoder.yudao.framework.web.core.clean; | |
| 1 | +package cn.iocoder.yudao.framework.xss.core.clean; | |
| 2 | 2 | |
| 3 | 3 | import org.jsoup.Jsoup; |
| 4 | 4 | import org.jsoup.nodes.Document; |
| 5 | 5 | import org.jsoup.safety.Safelist; |
| 6 | 6 | |
| 7 | 7 | /** |
| 8 | - * jsonp 过滤字符串 | |
| 8 | + * 基于 JSONP 实现 XSS 过滤字符串 | |
| 9 | 9 | */ |
| 10 | 10 | public class JsoupXssCleaner implements XssCleaner { |
| 11 | 11 | |
| ... | ... | @@ -24,21 +24,6 @@ public class JsoupXssCleaner implements XssCleaner { |
| 24 | 24 | this.baseUri = ""; |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - public JsoupXssCleaner(Safelist safelist) { | |
| 28 | - this.safelist = safelist; | |
| 29 | - this.baseUri = ""; | |
| 30 | - } | |
| 31 | - | |
| 32 | - public JsoupXssCleaner(String baseUri) { | |
| 33 | - this.safelist = buildSafelist(); | |
| 34 | - this.baseUri = baseUri; | |
| 35 | - } | |
| 36 | - | |
| 37 | - public JsoupXssCleaner(Safelist safelist, String baseUri) { | |
| 38 | - this.safelist = safelist; | |
| 39 | - this.baseUri = baseUri; | |
| 40 | - } | |
| 41 | - | |
| 42 | 27 | /** |
| 43 | 28 | * 构建一个 Xss 清理的 Safelist 规则。 |
| 44 | 29 | * 基于 Safelist#relaxed() 的基础上: |
| ... | ... | @@ -67,7 +52,6 @@ public class JsoupXssCleaner implements XssCleaner { |
| 67 | 52 | // 虽然可以重写 WhiteList#isSafeAttribute 来处理,但是有隐患,所以暂时不支持相对路径 |
| 68 | 53 | // WHITELIST.removeProtocols("a", "href", "ftp", "http", "https", "mailto"); |
| 69 | 54 | // WHITELIST.removeProtocols("img", "src", "http", "https"); |
| 70 | - | |
| 71 | 55 | return relaxedSafelist; |
| 72 | 56 | } |
| 73 | 57 | ... | ... |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/clean/XssCleaner.java renamed to yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/xss/core/clean/XssCleaner.java
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/filter/XssFilter.java renamed to yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/xss/core/filter/XssFilter.java
| 1 | -package cn.iocoder.yudao.framework.web.core.filter; | |
| 1 | +package cn.iocoder.yudao.framework.xss.core.filter; | |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.framework.web.config.XssProperties; | |
| 4 | -import cn.iocoder.yudao.framework.web.core.clean.XssCleaner; | |
| 3 | +import cn.iocoder.yudao.framework.xss.config.XssProperties; | |
| 4 | +import cn.iocoder.yudao.framework.xss.core.clean.XssCleaner; | |
| 5 | 5 | import lombok.AllArgsConstructor; |
| 6 | 6 | import org.springframework.util.PathMatcher; |
| 7 | 7 | import org.springframework.web.filter.OncePerRequestFilter; |
| ... | ... | @@ -14,8 +14,6 @@ import java.io.IOException; |
| 14 | 14 | |
| 15 | 15 | /** |
| 16 | 16 | * Xss 过滤器 |
| 17 | - * <p> | |
| 18 | - * 对 Xss 不了解的胖友,可以看看 http://www.iocoder.cn/Fight/The-new-girl-asked-me-why-AJAX-requests-are-not-secure-I-did-not-answer/ | |
| 19 | 17 | * |
| 20 | 18 | * @author 芋道源码 |
| 21 | 19 | */ | ... | ... |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/filter/XssRequestWrapper.java renamed to yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/xss/core/filter/XssRequestWrapper.java
| 1 | -package cn.iocoder.yudao.framework.web.core.filter; | |
| 1 | +package cn.iocoder.yudao.framework.xss.core.filter; | |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.framework.web.core.clean.XssCleaner; | |
| 3 | +import cn.iocoder.yudao.framework.xss.core.clean.XssCleaner; | |
| 4 | 4 | |
| 5 | 5 | import javax.servlet.http.HttpServletRequest; |
| 6 | 6 | import javax.servlet.http.HttpServletRequestWrapper; |
| ... | ... | @@ -13,6 +13,7 @@ import java.util.Map; |
| 13 | 13 | * @author 芋道源码 |
| 14 | 14 | */ |
| 15 | 15 | public class XssRequestWrapper extends HttpServletRequestWrapper { |
| 16 | + | |
| 16 | 17 | private final XssCleaner xssCleaner; |
| 17 | 18 | |
| 18 | 19 | public XssRequestWrapper(HttpServletRequest request, XssCleaner xssCleaner) { | ... | ... |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/web/core/json/XssStringJsonDeserializer.java renamed to yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/xss/core/json/XssStringJsonDeserializer.java
| 1 | -package cn.iocoder.yudao.framework.web.core.json; | |
| 1 | +package cn.iocoder.yudao.framework.xss.core.json; | |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.framework.web.core.clean.XssCleaner; | |
| 3 | +import cn.iocoder.yudao.framework.xss.core.clean.XssCleaner; | |
| 4 | 4 | import com.fasterxml.jackson.core.JsonParser; |
| 5 | 5 | import com.fasterxml.jackson.core.JsonToken; |
| 6 | 6 | import com.fasterxml.jackson.databind.DeserializationContext; | ... | ... |
yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/xss/package-info.java
0 → 100644
yudao-framework/yudao-spring-boot-starter-web/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
| 1 | 1 | cn.iocoder.yudao.framework.apilog.config.YudaoApiLogAutoConfiguration |
| 2 | 2 | cn.iocoder.yudao.framework.jackson.config.YudaoJacksonAutoConfiguration |
| 3 | 3 | cn.iocoder.yudao.framework.swagger.config.YudaoSwaggerAutoConfiguration |
| 4 | -cn.iocoder.yudao.framework.web.config.YudaoWebAutoConfiguration | |
| 5 | 4 | \ No newline at end of file |
| 5 | +cn.iocoder.yudao.framework.web.config.YudaoWebAutoConfiguration | |
| 6 | +cn.iocoder.yudao.framework.xss.config.YudaoXssAutoConfiguration | ... | ... |
yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/dal/mysql/file/FileConfigMapper.java
| ... | ... | @@ -6,15 +6,7 @@ import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; |
| 6 | 6 | import cn.iocoder.yudao.module.infra.controller.admin.file.vo.config.FileConfigPageReqVO; |
| 7 | 7 | import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileConfigDO; |
| 8 | 8 | import org.apache.ibatis.annotations.Mapper; |
| 9 | -import org.apache.ibatis.annotations.Select; | |
| 10 | 9 | |
| 11 | -import java.time.LocalDateTime; | |
| 12 | - | |
| 13 | -/** | |
| 14 | - * 文件配置 Mapper | |
| 15 | - * | |
| 16 | - * @author 芋道源码 | |
| 17 | - */ | |
| 18 | 10 | @Mapper |
| 19 | 11 | public interface FileConfigMapper extends BaseMapperX<FileConfigDO> { |
| 20 | 12 | |
| ... | ... | @@ -26,7 +18,4 @@ public interface FileConfigMapper extends BaseMapperX<FileConfigDO> { |
| 26 | 18 | .orderByDesc(FileConfigDO::getId)); |
| 27 | 19 | } |
| 28 | 20 | |
| 29 | - @Select("SELECT COUNT(*) FROM infra_file_config WHERE update_time > #{maxUpdateTime}") | |
| 30 | - Long selectCountByUpdateTimeGt(LocalDateTime maxUpdateTime); | |
| 31 | - | |
| 32 | 21 | } | ... | ... |
yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/mq/consumer/file/FileConfigRefreshConsumer.java
| ... | ... | @@ -23,7 +23,7 @@ public class FileConfigRefreshConsumer extends AbstractChannelMessageListener<Fi |
| 23 | 23 | @Override |
| 24 | 24 | public void onMessage(FileConfigRefreshMessage message) { |
| 25 | 25 | log.info("[onMessage][收到 FileConfig 刷新消息]"); |
| 26 | - fileConfigService.initFileClients(); | |
| 26 | + fileConfigService.initLocalCache(); | |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | } | ... | ... |
yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigService.java
yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImpl.java
| ... | ... | @@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.infra.service.file; |
| 3 | 3 | import cn.hutool.core.io.resource.ResourceUtil; |
| 4 | 4 | import cn.hutool.core.util.IdUtil; |
| 5 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 6 | -import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | |
| 7 | 6 | import cn.iocoder.yudao.framework.common.util.json.JsonUtils; |
| 8 | 7 | import cn.iocoder.yudao.framework.common.util.validation.ValidationUtils; |
| 9 | 8 | import cn.iocoder.yudao.framework.file.core.client.FileClient; |
| ... | ... | @@ -19,7 +18,6 @@ import cn.iocoder.yudao.module.infra.dal.mysql.file.FileConfigMapper; |
| 19 | 18 | import cn.iocoder.yudao.module.infra.mq.producer.file.FileConfigProducer; |
| 20 | 19 | import lombok.Getter; |
| 21 | 20 | import lombok.extern.slf4j.Slf4j; |
| 22 | -import org.springframework.scheduling.annotation.Scheduled; | |
| 23 | 21 | import org.springframework.stereotype.Service; |
| 24 | 22 | import org.springframework.transaction.annotation.Transactional; |
| 25 | 23 | import org.springframework.transaction.support.TransactionSynchronization; |
| ... | ... | @@ -29,7 +27,6 @@ import org.springframework.validation.annotation.Validated; |
| 29 | 27 | import javax.annotation.PostConstruct; |
| 30 | 28 | import javax.annotation.Resource; |
| 31 | 29 | import javax.validation.Validator; |
| 32 | -import java.time.LocalDateTime; | |
| 33 | 30 | import java.util.Collection; |
| 34 | 31 | import java.util.List; |
| 35 | 32 | import java.util.Map; |
| ... | ... | @@ -48,18 +45,6 @@ import static cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants.FILE_CONFIG |
| 48 | 45 | @Slf4j |
| 49 | 46 | public class FileConfigServiceImpl implements FileConfigService { |
| 50 | 47 | |
| 51 | - /** | |
| 52 | - * 定时执行 {@link #schedulePeriodicRefresh()} 的周期 | |
| 53 | - * 因为已经通过 Redis Pub/Sub 机制,所以频率不需要高 | |
| 54 | - */ | |
| 55 | - private static final long SCHEDULER_PERIOD = 5 * 60 * 1000L; | |
| 56 | - | |
| 57 | - /** | |
| 58 | - * 缓存菜单的最大更新时间,用于后续的增量轮询,判断是否有更新 | |
| 59 | - */ | |
| 60 | - @Getter | |
| 61 | - private volatile LocalDateTime maxUpdateTime; | |
| 62 | - | |
| 63 | 48 | @Resource |
| 64 | 49 | private FileClientFactory fileClientFactory; |
| 65 | 50 | /** |
| ... | ... | @@ -79,34 +64,12 @@ public class FileConfigServiceImpl implements FileConfigService { |
| 79 | 64 | |
| 80 | 65 | @Override |
| 81 | 66 | @PostConstruct |
| 82 | - public void initFileClients() { | |
| 83 | - initLocalCacheIfUpdate(null); | |
| 84 | - } | |
| 85 | - | |
| 86 | - @Scheduled(fixedDelay = SCHEDULER_PERIOD, initialDelay = SCHEDULER_PERIOD) | |
| 87 | - public void schedulePeriodicRefresh() { | |
| 88 | - initLocalCacheIfUpdate(this.maxUpdateTime); | |
| 89 | - } | |
| 90 | - | |
| 91 | - /** | |
| 92 | - * 刷新本地缓存 | |
| 93 | - * | |
| 94 | - * @param maxUpdateTime 最大更新时间 | |
| 95 | - * 1. 如果 maxUpdateTime 为 null,则“强制”刷新缓存 | |
| 96 | - * 2. 如果 maxUpdateTime 不为 null,判断自 maxUpdateTime 是否有数据发生变化,有的情况下才刷新缓存 | |
| 97 | - */ | |
| 98 | - private void initLocalCacheIfUpdate(LocalDateTime maxUpdateTime) { | |
| 99 | - // 第一步:基于 maxUpdateTime 判断缓存是否刷新。 | |
| 100 | - // 如果没有增量的数据变化,则不进行本地缓存的刷新 | |
| 101 | - if (maxUpdateTime != null | |
| 102 | - && fileConfigMapper.selectCountByUpdateTimeGt(maxUpdateTime) == 0) { | |
| 103 | - log.info("[initLocalCacheIfUpdate][数据未发生变化({}),本地缓存不刷新]", maxUpdateTime); | |
| 104 | - return; | |
| 105 | - } | |
| 67 | + public void initLocalCache() { | |
| 68 | + // 第一步:查询数据 | |
| 106 | 69 | List<FileConfigDO> configs = fileConfigMapper.selectList(); |
| 107 | - log.info("[initLocalCacheIfUpdate][缓存文件配置,数量为:{}]", configs.size()); | |
| 70 | + log.info("[initLocalCache][缓存文件配置,数量为:{}]", configs.size()); | |
| 108 | 71 | |
| 109 | - // 第二步:构建缓存。创建或更新文件 Client | |
| 72 | + // 第二步:构建缓存:创建或更新文件 Client | |
| 110 | 73 | configs.forEach(config -> { |
| 111 | 74 | fileClientFactory.createOrUpdateFileClient(config.getId(), config.getStorage(), config.getConfig()); |
| 112 | 75 | // 如果是 master,进行设置 |
| ... | ... | @@ -114,9 +77,6 @@ public class FileConfigServiceImpl implements FileConfigService { |
| 114 | 77 | masterFileClient = fileClientFactory.getFileClient(config.getId()); |
| 115 | 78 | } |
| 116 | 79 | }); |
| 117 | - | |
| 118 | - // 第三步:设置最新的 maxUpdateTime,用于下次的增量判断。 | |
| 119 | - this.maxUpdateTime = CollectionUtils.getMaxValue(configs, FileConfigDO::getUpdateTime); | |
| 120 | 80 | } |
| 121 | 81 | |
| 122 | 82 | @Override | ... | ... |
yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/test/TestDemoServiceImpl.java
| ... | ... | @@ -79,7 +79,7 @@ public class TestDemoServiceImpl implements TestDemoService { |
| 79 | 79 | |
| 80 | 80 | @Override |
| 81 | 81 | public PageResult<TestDemoDO> getTestDemoPage(TestDemoPageReqVO pageReqVO) { |
| 82 | -// testDemoMapper.selectList2(); | |
| 82 | + testDemoMapper.selectList2(); | |
| 83 | 83 | return testDemoMapper.selectPage(pageReqVO); |
| 84 | 84 | } |
| 85 | 85 | ... | ... |
yudao-module-infra/yudao-module-infra-biz/src/test/java/cn/iocoder/yudao/module/infra/service/file/FileConfigServiceImplTest.java
| ... | ... | @@ -30,7 +30,6 @@ import java.util.Map; |
| 30 | 30 | import static cn.hutool.core.util.RandomUtil.randomEle; |
| 31 | 31 | import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; |
| 32 | 32 | import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; |
| 33 | -import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.max; | |
| 34 | 33 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; |
| 35 | 34 | import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; |
| 36 | 35 | import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; |
| ... | ... | @@ -74,16 +73,13 @@ public class FileConfigServiceImplTest extends BaseDbUnitTest { |
| 74 | 73 | when(fileClientFactory.getFileClient(eq(1L))).thenReturn(masterFileClient); |
| 75 | 74 | |
| 76 | 75 | // 调用 |
| 77 | - fileConfigService.initFileClients(); | |
| 76 | + fileConfigService.initLocalCache(); | |
| 78 | 77 | // 断言 fileClientFactory 调用 |
| 79 | 78 | verify(fileClientFactory).createOrUpdateFileClient(eq(1L), |
| 80 | 79 | eq(configDO1.getStorage()), eq(configDO1.getConfig())); |
| 81 | 80 | verify(fileClientFactory).createOrUpdateFileClient(eq(2L), |
| 82 | 81 | eq(configDO2.getStorage()), eq(configDO2.getConfig())); |
| 83 | 82 | assertSame(masterFileClient, fileConfigService.getMasterFileClient()); |
| 84 | - // 断言 maxUpdateTime 缓存 | |
| 85 | - assertEquals(max(configDO1.getUpdateTime(), configDO2.getUpdateTime()), | |
| 86 | - fileConfigService.getMaxUpdateTime()); | |
| 87 | 83 | } |
| 88 | 84 | |
| 89 | 85 | @Test | ... | ... |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/merchant/PayChannelMapper.java
| ... | ... | @@ -8,9 +8,7 @@ import cn.iocoder.yudao.module.pay.controller.admin.merchant.vo.channel.PayChann |
| 8 | 8 | import cn.iocoder.yudao.module.pay.dal.dataobject.merchant.PayChannelDO; |
| 9 | 9 | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| 10 | 10 | import org.apache.ibatis.annotations.Mapper; |
| 11 | -import org.apache.ibatis.annotations.Select; | |
| 12 | 11 | |
| 13 | -import java.time.LocalDateTime; | |
| 14 | 12 | import java.util.Collection; |
| 15 | 13 | import java.util.List; |
| 16 | 14 | |
| ... | ... | @@ -21,9 +19,6 @@ public interface PayChannelMapper extends BaseMapperX<PayChannelDO> { |
| 21 | 19 | return selectOne(PayChannelDO::getAppId, appId, PayChannelDO::getCode, code); |
| 22 | 20 | } |
| 23 | 21 | |
| 24 | - @Select("SELECT COUNT(*) FROM pay_channel WHERE update_time > #{maxUpdateTime}") | |
| 25 | - Long selectCountByUpdateTimeGt(LocalDateTime maxUpdateTime); | |
| 26 | - | |
| 27 | 22 | default PageResult<PayChannelDO> selectPage(PayChannelPageReqVO reqVO) { |
| 28 | 23 | return selectPage(reqVO, new QueryWrapperX<PayChannelDO>() |
| 29 | 24 | .eqIfPresent("code", reqVO.getCode()) |
| ... | ... | @@ -67,14 +62,14 @@ public interface PayChannelMapper extends BaseMapperX<PayChannelDO> { |
| 67 | 62 | * 根据条件获取渠道 |
| 68 | 63 | * |
| 69 | 64 | * @param merchantId 商户编号 |
| 70 | - * @param appid 应用编号 // TODO @aquan:appid =》appId | |
| 65 | + * @param appI 应用编号 | |
| 71 | 66 | * @param code 渠道编码 |
| 72 | 67 | * @return 数量 |
| 73 | 68 | */ |
| 74 | - default PayChannelDO selectOne(Long merchantId, Long appid, String code) { | |
| 69 | + default PayChannelDO selectOne(Long merchantId, Long appI, String code) { | |
| 75 | 70 | return this.selectOne((new QueryWrapper<PayChannelDO>().lambda() |
| 76 | 71 | .eq(PayChannelDO::getMerchantId, merchantId) |
| 77 | - .eq(PayChannelDO::getAppId, appid) | |
| 72 | + .eq(PayChannelDO::getAppId, appI) | |
| 78 | 73 | .eq(PayChannelDO::getCode, code) |
| 79 | 74 | )); |
| 80 | 75 | } | ... | ... |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/merchant/PayChannelServiceImpl.java
| ... | ... | @@ -5,7 +5,6 @@ import cn.hutool.json.JSONUtil; |
| 5 | 5 | import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; |
| 6 | 6 | import cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil; |
| 7 | 7 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 8 | -import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | |
| 9 | 8 | import cn.iocoder.yudao.framework.pay.core.client.PayClientConfig; |
| 10 | 9 | import cn.iocoder.yudao.framework.pay.core.client.PayClientFactory; |
| 11 | 10 | import cn.iocoder.yudao.framework.pay.core.enums.PayChannelEnum; |
| ... | ... | @@ -19,7 +18,6 @@ import cn.iocoder.yudao.module.pay.dal.dataobject.merchant.PayChannelDO; |
| 19 | 18 | import cn.iocoder.yudao.module.pay.dal.mysql.merchant.PayChannelMapper; |
| 20 | 19 | import cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants; |
| 21 | 20 | import lombok.extern.slf4j.Slf4j; |
| 22 | -import org.springframework.scheduling.annotation.Scheduled; | |
| 23 | 21 | import org.springframework.stereotype.Service; |
| 24 | 22 | import org.springframework.validation.annotation.Validated; |
| 25 | 23 | |
| ... | ... | @@ -45,12 +43,6 @@ import static cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants.CHANNEL_NOT_E |
| 45 | 43 | public class PayChannelServiceImpl implements PayChannelService { |
| 46 | 44 | |
| 47 | 45 | /** |
| 48 | - * 定时执行 {@link #schedulePeriodicRefresh()} 的周期 | |
| 49 | - * 因为已经通过 Redis Pub/Sub 机制,所以频率不需要高 | |
| 50 | - */ | |
| 51 | - private static final long SCHEDULER_PERIOD = 5 * 60 * 1000L; | |
| 52 | - | |
| 53 | - /** | |
| 54 | 46 | * 缓存菜单的最大更新时间,用于后续的增量轮询,判断是否有更新 |
| 55 | 47 | */ |
| 56 | 48 | private volatile LocalDateTime maxUpdateTime; |
| ... | ... | @@ -70,40 +62,15 @@ public class PayChannelServiceImpl implements PayChannelService { |
| 70 | 62 | @Override |
| 71 | 63 | @PostConstruct |
| 72 | 64 | public void initLocalCache() { |
| 73 | - initLocalCacheIfUpdate(null); | |
| 74 | - } | |
| 75 | - | |
| 76 | - @Scheduled(fixedDelay = SCHEDULER_PERIOD, initialDelay = SCHEDULER_PERIOD) | |
| 77 | - public void schedulePeriodicRefresh() { | |
| 78 | - initLocalCacheIfUpdate(this.maxUpdateTime); | |
| 79 | - } | |
| 80 | - | |
| 81 | - /** | |
| 82 | - * 刷新本地缓存 | |
| 83 | - * | |
| 84 | - * @param maxUpdateTime 最大更新时间 | |
| 85 | - * 1. 如果 maxUpdateTime 为 null,则“强制”刷新缓存 | |
| 86 | - * 2. 如果 maxUpdateTime 不为 null,判断自 maxUpdateTime 是否有数据发生变化,有的情况下才刷新缓存 | |
| 87 | - */ | |
| 88 | - private void initLocalCacheIfUpdate(LocalDateTime maxUpdateTime) { | |
| 89 | 65 | // 注意:忽略自动多租户,因为要全局初始化缓存 |
| 90 | 66 | TenantUtils.executeIgnore(() -> { |
| 91 | - // 第一步:基于 maxUpdateTime 判断缓存是否刷新。 | |
| 92 | - // 如果没有增量的数据变化,则不进行本地缓存的刷新 | |
| 93 | - if (maxUpdateTime != null | |
| 94 | - && channelMapper.selectCountByUpdateTimeGt(maxUpdateTime) == 0) { | |
| 95 | - log.info("[initLocalCacheIfUpdate][数据未发生变化({}),本地缓存不刷新]", maxUpdateTime); | |
| 96 | - return; | |
| 97 | - } | |
| 67 | + // 第一步:查询数据 | |
| 98 | 68 | List<PayChannelDO> channels = channelMapper.selectList(); |
| 99 | - log.info("[initLocalCacheIfUpdate][缓存支付渠道,数量为:{}]", channels.size()); | |
| 69 | + log.info("[initLocalCache][缓存支付渠道,数量为:{}]", channels.size()); | |
| 100 | 70 | |
| 101 | - // 第二步:构建缓存。创建或更新支付 Client | |
| 71 | + // 第二步:构建缓存:创建或更新支付 Client | |
| 102 | 72 | channels.forEach(payChannel -> payClientFactory.createOrUpdatePayClient(payChannel.getId(), |
| 103 | 73 | payChannel.getCode(), payChannel.getConfig())); |
| 104 | - | |
| 105 | - // 第三步:设置最新的 maxUpdateTime,用于下次的增量判断。 | |
| 106 | - this.maxUpdateTime = CollectionUtils.getMaxValue(channels, PayChannelDO::getUpdateTime); | |
| 107 | 74 | }); |
| 108 | 75 | } |
| 109 | 76 | ... | ... |
yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/mail/MailSendApi.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.api.mail; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.module.system.api.mail.dto.MailSendSingleToUserReqDTO; | |
| 4 | + | |
| 5 | +import javax.validation.Valid; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * 邮箱发送 API 接口 | |
| 9 | + * | |
| 10 | + * @author 芋道源码 | |
| 11 | + */ | |
| 12 | +public interface MailSendApi { | |
| 13 | + | |
| 14 | + /** | |
| 15 | + * 发送单条邮箱给 Admin 用户 | |
| 16 | + * | |
| 17 | + * 在 mail 为空时,使用 userId 加载对应 Admin 的邮箱 | |
| 18 | + * | |
| 19 | + * @param reqDTO 发送请求 | |
| 20 | + * @return 发送日志编号 | |
| 21 | + */ | |
| 22 | + Long sendSingleMailToAdmin(@Valid MailSendSingleToUserReqDTO reqDTO); | |
| 23 | + | |
| 24 | + /** | |
| 25 | + * 发送单条邮箱给 Member 用户 | |
| 26 | + * | |
| 27 | + * 在 mail 为空时,使用 userId 加载对应 Member 的邮箱 | |
| 28 | + * | |
| 29 | + * @param reqDTO 发送请求 | |
| 30 | + * @return 发送日志编号 | |
| 31 | + */ | |
| 32 | + Long sendSingleMailToMember(@Valid MailSendSingleToUserReqDTO reqDTO); | |
| 33 | + | |
| 34 | +} | ... | ... |
yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/mail/dto/MailSendSingleToUserReqDTO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.api.mail.dto; | |
| 2 | + | |
| 3 | +import lombok.Data; | |
| 4 | + | |
| 5 | +import javax.validation.constraints.Email; | |
| 6 | +import javax.validation.constraints.NotNull; | |
| 7 | +import java.util.Map; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * 邮件发送 Request DTO | |
| 11 | + * | |
| 12 | + * @author wangjingqi | |
| 13 | + */ | |
| 14 | +@Data | |
| 15 | +public class MailSendSingleToUserReqDTO { | |
| 16 | + | |
| 17 | + /** | |
| 18 | + * 用户编号 | |
| 19 | + */ | |
| 20 | + private Long userId; | |
| 21 | + /** | |
| 22 | + * 邮箱 | |
| 23 | + */ | |
| 24 | ||
| 25 | + private String mail; | |
| 26 | + | |
| 27 | + /** | |
| 28 | + * 邮件模板编号 | |
| 29 | + */ | |
| 30 | + @NotNull(message = "邮件模板编号不能为空") | |
| 31 | + private String templateCode; | |
| 32 | + /** | |
| 33 | + * 邮件模板参数 | |
| 34 | + */ | |
| 35 | + private Map<String, Object> templateParams; | |
| 36 | + | |
| 37 | +} | ... | ... |
yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/notify/NotifyMessageSendApi.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.api.notify; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.module.system.api.notify.dto.NotifySendSingleToUserReqDTO; | |
| 4 | + | |
| 5 | +import javax.validation.Valid; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * 站内信发送 API 接口 | |
| 9 | + * | |
| 10 | + * @author xrcoder | |
| 11 | + */ | |
| 12 | +public interface NotifyMessageSendApi { | |
| 13 | + | |
| 14 | + /** | |
| 15 | + * 发送单条站内信给 Admin 用户 | |
| 16 | + * | |
| 17 | + * @param reqDTO 发送请求 | |
| 18 | + * @return 发送消息 ID | |
| 19 | + */ | |
| 20 | + Long sendSingleMessageToAdmin(@Valid NotifySendSingleToUserReqDTO reqDTO); | |
| 21 | + | |
| 22 | + /** | |
| 23 | + * 发送单条站内信给 Member 用户 | |
| 24 | + * | |
| 25 | + * @param reqDTO 发送请求 | |
| 26 | + * @return 发送消息 ID | |
| 27 | + */ | |
| 28 | + Long sendSingleMessageToMember(@Valid NotifySendSingleToUserReqDTO reqDTO); | |
| 29 | + | |
| 30 | +} | ... | ... |
yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/notify/dto/NotifySendSingleToUserReqDTO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.api.notify.dto; | |
| 2 | + | |
| 3 | +import lombok.Data; | |
| 4 | + | |
| 5 | +import javax.validation.constraints.NotEmpty; | |
| 6 | +import javax.validation.constraints.NotNull; | |
| 7 | +import java.util.Map; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * 站内信发送给 Admin 或者 Member 用户 | |
| 11 | + * | |
| 12 | + * @author xrcoder | |
| 13 | + */ | |
| 14 | +@Data | |
| 15 | +public class NotifySendSingleToUserReqDTO { | |
| 16 | + | |
| 17 | + /** | |
| 18 | + * 用户编号 | |
| 19 | + */ | |
| 20 | + @NotNull(message = "用户编号不能为空") | |
| 21 | + private Long userId; | |
| 22 | + | |
| 23 | + /** | |
| 24 | + * 站内信模板编号 | |
| 25 | + */ | |
| 26 | + @NotEmpty(message = "站内信模板编号不能为空") | |
| 27 | + private String templateCode; | |
| 28 | + | |
| 29 | + /** | |
| 30 | + * 站内信模板参数 | |
| 31 | + */ | |
| 32 | + private Map<String, Object> templateParams; | |
| 33 | +} | ... | ... |
yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/ErrorCodeConstants.java
| ... | ... | @@ -141,4 +141,25 @@ public interface ErrorCodeConstants { |
| 141 | 141 | ErrorCode OAUTH2_CODE_NOT_EXISTS = new ErrorCode(1002022000, "code 不存在"); |
| 142 | 142 | ErrorCode OAUTH2_CODE_EXPIRE = new ErrorCode(1002022001, "code 已过期"); |
| 143 | 143 | |
| 144 | + // ========== 邮箱账号 1002023000 ========== | |
| 145 | + ErrorCode MAIL_ACCOUNT_NOT_EXISTS = new ErrorCode(1002023000, "邮箱账号不存在"); | |
| 146 | + ErrorCode MAIL_ACCOUNT_RELATE_TEMPLATE_EXISTS = new ErrorCode(1002023001, "无法删除,该邮箱账号还有邮件模板"); | |
| 147 | + | |
| 148 | + // ========== 邮件模版 1002024000 ========== | |
| 149 | + ErrorCode MAIL_TEMPLATE_NOT_EXISTS = new ErrorCode(1002024000, "邮件模版不存在"); | |
| 150 | + ErrorCode MAIL_TEMPLATE_CODE_EXISTS = new ErrorCode(1002024001, "邮件模版 code({}) 已存在"); | |
| 151 | + | |
| 152 | + // ========== 邮件发送 1002025000 ========== | |
| 153 | + ErrorCode MAIL_SEND_TEMPLATE_PARAM_MISS = new ErrorCode(1002025000, "模板参数({})缺失"); | |
| 154 | + ErrorCode MAIL_SEND_MAIL_NOT_EXISTS = new ErrorCode(1002025000, "邮箱不存在"); | |
| 155 | + | |
| 156 | + // ========== 站内信模版 1002026000 ========== | |
| 157 | + ErrorCode NOTIFY_TEMPLATE_NOT_EXISTS = new ErrorCode(1002026000, "站内信模版不存在"); | |
| 158 | + ErrorCode NOTIFY_TEMPLATE_CODE_DUPLICATE = new ErrorCode(1002026001, "已经存在编码为【{}】的站内信模板"); | |
| 159 | + | |
| 160 | + // ========== 站内信模版 1002027000 ========== | |
| 161 | + | |
| 162 | + // ========== 站内信发送 1002028000 ========== | |
| 163 | + ErrorCode NOTIFY_SEND_TEMPLATE_PARAM_MISS = new ErrorCode(1002025000, "模板参数({})缺失"); | |
| 164 | + | |
| 144 | 165 | } | ... | ... |
yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/enums/mail/MailSendStatusEnum.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.enums.mail; | |
| 2 | + | |
| 3 | +import lombok.AllArgsConstructor; | |
| 4 | +import lombok.Getter; | |
| 5 | + | |
| 6 | +/** | |
| 7 | + * 邮件的发送状态枚举 | |
| 8 | + * | |
| 9 | + * @author wangjingyi | |
| 10 | + * @since 2022/4/10 13:39 | |
| 11 | + */ | |
| 12 | +@Getter | |
| 13 | +@AllArgsConstructor | |
| 14 | +public enum MailSendStatusEnum { | |
| 15 | + | |
| 16 | + INIT(0), // 初始化 | |
| 17 | + SUCCESS(10), // 发送成功 | |
| 18 | + FAILURE(20), // 发送失败 | |
| 19 | + IGNORE(30), // 忽略,即不发送 | |
| 20 | + ; | |
| 21 | + | |
| 22 | + private final int status; | |
| 23 | + | |
| 24 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/pom.xml
| ... | ... | @@ -106,6 +106,10 @@ |
| 106 | 106 | <artifactId>yudao-spring-boot-starter-captcha</artifactId> |
| 107 | 107 | </dependency> |
| 108 | 108 | |
| 109 | + <dependency> | |
| 110 | + <groupId>org.springframework.boot</groupId> | |
| 111 | + <artifactId>spring-boot-starter-mail</artifactId> | |
| 112 | + </dependency> | |
| 109 | 113 | </dependencies> |
| 110 | 114 | |
| 111 | 115 | </project> | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/mail/MailSendApiImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.api.mail; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.module.system.api.mail.dto.MailSendSingleToUserReqDTO; | |
| 4 | +import cn.iocoder.yudao.module.system.service.mail.MailSendService; | |
| 5 | +import org.springframework.stereotype.Service; | |
| 6 | +import org.springframework.validation.annotation.Validated; | |
| 7 | + | |
| 8 | +import javax.annotation.Resource; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 邮件发送 API 实现类 | |
| 12 | + * | |
| 13 | + * @author wangjingyi | |
| 14 | + */ | |
| 15 | +@Service | |
| 16 | +@Validated | |
| 17 | +public class MailSendApiImpl implements MailSendApi { | |
| 18 | + | |
| 19 | + @Resource | |
| 20 | + private MailSendService mailSendService; | |
| 21 | + | |
| 22 | + @Override | |
| 23 | + public Long sendSingleMailToAdmin(MailSendSingleToUserReqDTO reqDTO) { | |
| 24 | + return mailSendService.sendSingleMailToAdmin(reqDTO.getMail(), reqDTO.getUserId(), | |
| 25 | + reqDTO.getTemplateCode(), reqDTO.getTemplateParams()); | |
| 26 | + } | |
| 27 | + | |
| 28 | + @Override | |
| 29 | + public Long sendSingleMailToMember(MailSendSingleToUserReqDTO reqDTO) { | |
| 30 | + return mailSendService.sendSingleMailToMember(reqDTO.getMail(), reqDTO.getUserId(), | |
| 31 | + reqDTO.getTemplateCode(), reqDTO.getTemplateParams()); | |
| 32 | + } | |
| 33 | + | |
| 34 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/api/notify/NotifyMessageSendApiImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.api.notify; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.module.system.api.notify.dto.NotifySendSingleToUserReqDTO; | |
| 4 | +import cn.iocoder.yudao.module.system.service.notify.NotifyMessageService; | |
| 5 | +import cn.iocoder.yudao.module.system.service.notify.NotifySendService; | |
| 6 | +import org.springframework.stereotype.Service; | |
| 7 | + | |
| 8 | +import javax.annotation.Resource; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 站内信发送 API 实现类 | |
| 12 | + * | |
| 13 | + * @author xrcoder | |
| 14 | + */ | |
| 15 | +@Service | |
| 16 | +public class NotifyMessageSendApiImpl implements NotifyMessageSendApi { | |
| 17 | + | |
| 18 | + @Resource | |
| 19 | + private NotifySendService notifySendService; | |
| 20 | + | |
| 21 | + @Override | |
| 22 | + public Long sendSingleMessageToAdmin(NotifySendSingleToUserReqDTO reqDTO) { | |
| 23 | + return notifySendService.sendSingleNotifyToAdmin(reqDTO.getUserId(), | |
| 24 | + reqDTO.getTemplateCode(), reqDTO.getTemplateParams()); | |
| 25 | + } | |
| 26 | + | |
| 27 | + @Override | |
| 28 | + public Long sendSingleMessageToMember(NotifySendSingleToUserReqDTO reqDTO) { | |
| 29 | + return notifySendService.sendSingleNotifyToMember(reqDTO.getUserId(), | |
| 30 | + reqDTO.getTemplateCode(), reqDTO.getTemplateParams()); | |
| 31 | + } | |
| 32 | + | |
| 33 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailAccountController.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.mail; | |
| 2 | + | |
| 3 | + | |
| 4 | +import cn.iocoder.yudao.framework.common.pojo.CommonResult; | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.*; | |
| 7 | +import cn.iocoder.yudao.module.system.convert.mail.MailAccountConvert; | |
| 8 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailAccountDO; | |
| 9 | +import cn.iocoder.yudao.module.system.service.mail.MailAccountService; | |
| 10 | +import io.swagger.annotations.Api; | |
| 11 | +import io.swagger.annotations.ApiImplicitParam; | |
| 12 | +import io.swagger.annotations.ApiOperation; | |
| 13 | +import org.springframework.security.access.prepost.PreAuthorize; | |
| 14 | +import org.springframework.web.bind.annotation.*; | |
| 15 | + | |
| 16 | +import javax.annotation.Resource; | |
| 17 | +import javax.validation.Valid; | |
| 18 | +import java.util.Comparator; | |
| 19 | +import java.util.List; | |
| 20 | + | |
| 21 | +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | |
| 22 | + | |
| 23 | +@Api(tags = "管理后台 - 邮箱账号") | |
| 24 | +@RestController | |
| 25 | +@RequestMapping("/system/mail-account") | |
| 26 | +public class MailAccountController { | |
| 27 | + | |
| 28 | + @Resource | |
| 29 | + private MailAccountService mailAccountService; | |
| 30 | + | |
| 31 | + @PostMapping("/create") | |
| 32 | + @ApiOperation("创建邮箱账号") | |
| 33 | + @PreAuthorize("@ss.hasPermission('system:mail-account:create')") | |
| 34 | + public CommonResult<Long> createMailAccount(@Valid @RequestBody MailAccountCreateReqVO createReqVO) { | |
| 35 | + return success(mailAccountService.createMailAccount(createReqVO)); | |
| 36 | + } | |
| 37 | + | |
| 38 | + @PutMapping("/update") | |
| 39 | + @ApiOperation("修改邮箱账号") | |
| 40 | + @PreAuthorize("@ss.hasPermission('system:mail-account:update')") | |
| 41 | + public CommonResult<Boolean> updateMailAccount(@Valid @RequestBody MailAccountUpdateReqVO updateReqVO) { | |
| 42 | + mailAccountService.updateMailAccount(updateReqVO); | |
| 43 | + return success(true); | |
| 44 | + } | |
| 45 | + | |
| 46 | + @DeleteMapping("/delete") | |
| 47 | + @ApiOperation("删除邮箱账号") | |
| 48 | + @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) | |
| 49 | + @PreAuthorize("@ss.hasPermission('system:mail-account:delete')") | |
| 50 | + public CommonResult<Boolean> deleteMailAccount(@RequestParam Long id) { | |
| 51 | + mailAccountService.deleteMailAccount(id); | |
| 52 | + return success(true); | |
| 53 | + } | |
| 54 | + | |
| 55 | + @GetMapping("/get") | |
| 56 | + @ApiOperation("获得邮箱账号") | |
| 57 | + @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) | |
| 58 | + @PreAuthorize("@ss.hasPermission('system:mail-account:get')") | |
| 59 | + public CommonResult<MailAccountRespVO> getMailAccount(@RequestParam("id") Long id) { | |
| 60 | + MailAccountDO mailAccountDO = mailAccountService.getMailAccount(id); | |
| 61 | + return success(MailAccountConvert.INSTANCE.convert(mailAccountDO)); | |
| 62 | + } | |
| 63 | + | |
| 64 | + @GetMapping("/page") | |
| 65 | + @ApiOperation("获得邮箱账号分页") | |
| 66 | + @PreAuthorize("@ss.hasPermission('system:mail-account:query')") | |
| 67 | + public CommonResult<PageResult<MailAccountBaseVO>> getMailAccountPage(@Valid MailAccountPageReqVO pageReqVO) { | |
| 68 | + PageResult<MailAccountDO> pageResult = mailAccountService.getMailAccountPage(pageReqVO); | |
| 69 | + return success(MailAccountConvert.INSTANCE.convertPage(pageResult)); | |
| 70 | + } | |
| 71 | + | |
| 72 | + @GetMapping("/list-all-simple") | |
| 73 | + @ApiOperation(value = "获得邮箱账号精简列表") | |
| 74 | + public CommonResult<List<MailAccountSimpleRespVO>> getSimpleMailAccountList() { | |
| 75 | + List<MailAccountDO> list = mailAccountService.getMailAccountList(); | |
| 76 | + return success(MailAccountConvert.INSTANCE.convertList02(list)); | |
| 77 | + } | |
| 78 | + | |
| 79 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailLogController.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.mail; | |
| 2 | + | |
| 3 | + | |
| 4 | +import cn.iocoder.yudao.framework.common.pojo.CommonResult; | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.log.MailLogPageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.log.MailLogRespVO; | |
| 8 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.template.MailTemplateRespVO; | |
| 9 | +import cn.iocoder.yudao.module.system.convert.mail.MailLogConvert; | |
| 10 | +import cn.iocoder.yudao.module.system.convert.mail.MailTemplateConvert; | |
| 11 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailLogDO; | |
| 12 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO; | |
| 13 | +import cn.iocoder.yudao.module.system.service.mail.MailLogService; | |
| 14 | +import io.swagger.annotations.Api; | |
| 15 | +import io.swagger.annotations.ApiImplicitParam; | |
| 16 | +import io.swagger.annotations.ApiOperation; | |
| 17 | +import org.springframework.security.access.prepost.PreAuthorize; | |
| 18 | +import org.springframework.web.bind.annotation.GetMapping; | |
| 19 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 20 | +import org.springframework.web.bind.annotation.RequestParam; | |
| 21 | +import org.springframework.web.bind.annotation.RestController; | |
| 22 | + | |
| 23 | +import javax.annotation.Resource; | |
| 24 | +import javax.validation.Valid; | |
| 25 | + | |
| 26 | +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | |
| 27 | + | |
| 28 | + | |
| 29 | +@Api(tags = "管理后台 - 邮件日志") | |
| 30 | +@RestController | |
| 31 | +@RequestMapping("/system/mail-log") | |
| 32 | +public class MailLogController { | |
| 33 | + | |
| 34 | + @Resource | |
| 35 | + private MailLogService mailLogService; | |
| 36 | + | |
| 37 | + @GetMapping("/page") | |
| 38 | + @ApiOperation("获得邮箱日志分页") | |
| 39 | + @PreAuthorize("@ss.hasPermission('system:mail-log:query')") | |
| 40 | + public CommonResult<PageResult<MailLogRespVO>> getMailLogPage(@Valid MailLogPageReqVO pageVO) { | |
| 41 | + PageResult<MailLogDO> pageResult = mailLogService.getMailLogPage(pageVO); | |
| 42 | + return success(MailLogConvert.INSTANCE.convertPage(pageResult)); | |
| 43 | + } | |
| 44 | + | |
| 45 | + @GetMapping("/get") | |
| 46 | + @ApiOperation("获得邮箱日志") | |
| 47 | + @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) | |
| 48 | + @PreAuthorize("@ss.hasPermission('system:mail-log:query')") | |
| 49 | + public CommonResult<MailLogRespVO> getMailTemplate(@RequestParam("id") Long id) { | |
| 50 | + MailLogDO mailLogDO = mailLogService.getMailLog(id); | |
| 51 | + return success(MailLogConvert.INSTANCE.convert(mailLogDO)); | |
| 52 | + } | |
| 53 | + | |
| 54 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailTemplateController.http
0 → 100644
| 1 | +### 请求 /system/mail-template/send-mail 接口 => 成功 | |
| 2 | +POST {{baseUrl}}/system/mail-template/send-mail | |
| 3 | +Authorization: Bearer {{token}} | |
| 4 | +Content-Type: application/json | |
| 5 | +tenant-id: {{adminTenentId}} | |
| 6 | + | |
| 7 | +{ | |
| 8 | + "templateCode": "test_01", | |
| 9 | + "mail": "7685413@qq.com", | |
| 10 | + "templateParams": { | |
| 11 | + "key01": "value01", | |
| 12 | + "key02": "value02" | |
| 13 | + } | |
| 14 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailTemplateController.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.mail; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.CommonResult; | |
| 4 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 5 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.template.*; | |
| 6 | +import cn.iocoder.yudao.module.system.controller.admin.sms.vo.template.SmsTemplateSendReqVO; | |
| 7 | +import cn.iocoder.yudao.module.system.convert.mail.MailTemplateConvert; | |
| 8 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO; | |
| 9 | +import cn.iocoder.yudao.module.system.service.mail.MailSendService; | |
| 10 | +import cn.iocoder.yudao.module.system.service.mail.MailTemplateService; | |
| 11 | +import io.swagger.annotations.Api; | |
| 12 | +import io.swagger.annotations.ApiImplicitParam; | |
| 13 | +import io.swagger.annotations.ApiOperation; | |
| 14 | +import org.springframework.security.access.prepost.PreAuthorize; | |
| 15 | +import org.springframework.web.bind.annotation.*; | |
| 16 | + | |
| 17 | +import javax.annotation.Resource; | |
| 18 | +import javax.validation.Valid; | |
| 19 | +import java.util.List; | |
| 20 | + | |
| 21 | +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | |
| 22 | + | |
| 23 | +@Api(tags = "管理后台 - 邮件模版") | |
| 24 | +@RestController | |
| 25 | +@RequestMapping("/system/mail-template") | |
| 26 | +public class MailTemplateController { | |
| 27 | + | |
| 28 | + @Resource | |
| 29 | + private MailTemplateService mailTempleService; | |
| 30 | + @Resource | |
| 31 | + private MailSendService mailSendService; | |
| 32 | + | |
| 33 | + @PostMapping("/create") | |
| 34 | + @ApiOperation("创建邮件模版") | |
| 35 | + @PreAuthorize("@ss.hasPermission('system:mail-template:create')") | |
| 36 | + public CommonResult<Long> createMailTemplate(@Valid @RequestBody MailTemplateCreateReqVO createReqVO){ | |
| 37 | + return success(mailTempleService.createMailTemplate(createReqVO)); | |
| 38 | + } | |
| 39 | + | |
| 40 | + @PutMapping("/update") | |
| 41 | + @ApiOperation("修改邮件模版") | |
| 42 | + @PreAuthorize("@ss.hasPermission('system:mail-template:update')") | |
| 43 | + public CommonResult<Boolean> updateMailTemplate(@Valid @RequestBody MailTemplateUpdateReqVO updateReqVO){ | |
| 44 | + mailTempleService.updateMailTemplate(updateReqVO); | |
| 45 | + return success(true); | |
| 46 | + } | |
| 47 | + | |
| 48 | + @DeleteMapping("/delete") | |
| 49 | + @ApiOperation("删除邮件模版") | |
| 50 | + @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) | |
| 51 | + @PreAuthorize("@ss.hasPermission('system:mail-template:delete')") | |
| 52 | + public CommonResult<Boolean> deleteMailTemplate(@RequestParam("id") Long id) { | |
| 53 | + mailTempleService.deleteMailTemplate(id); | |
| 54 | + return success(true); | |
| 55 | + } | |
| 56 | + | |
| 57 | + @GetMapping("/get") | |
| 58 | + @ApiOperation("获得邮件模版") | |
| 59 | + @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) | |
| 60 | + @PreAuthorize("@ss.hasPermission('system:mail-template:get')") | |
| 61 | + public CommonResult<MailTemplateRespVO> getMailTemplate(@RequestParam("id") Long id) { | |
| 62 | + MailTemplateDO mailTemplateDO = mailTempleService.getMailTemplate(id); | |
| 63 | + return success(MailTemplateConvert.INSTANCE.convert(mailTemplateDO)); | |
| 64 | + } | |
| 65 | + | |
| 66 | + @GetMapping("/page") | |
| 67 | + @ApiOperation("获得邮件模版分页") | |
| 68 | + @PreAuthorize("@ss.hasPermission('system:mail-template:query')") | |
| 69 | + public CommonResult<PageResult<MailTemplateRespVO>> getMailTemplatePage(@Valid MailTemplatePageReqVO pageReqVO) { | |
| 70 | + PageResult<MailTemplateDO> pageResult = mailTempleService.getMailTemplatePage(pageReqVO); | |
| 71 | + return success(MailTemplateConvert.INSTANCE.convertPage(pageResult)); | |
| 72 | + } | |
| 73 | + | |
| 74 | + @GetMapping("/list-all-simple") | |
| 75 | + @ApiOperation(value = "获得邮件模版精简列表") | |
| 76 | + public CommonResult<List<MailTemplateSimpleRespVO>> getSimpleTemplateList() { | |
| 77 | + List<MailTemplateDO> list = mailTempleService.getMailTemplateList(); | |
| 78 | + return success(MailTemplateConvert.INSTANCE.convertList02(list)); | |
| 79 | + } | |
| 80 | + | |
| 81 | + @PostMapping("/send-mail") | |
| 82 | + @ApiOperation("发送短信") | |
| 83 | + @PreAuthorize("@ss.hasPermission('system:mail-template:send-mail')") | |
| 84 | + public CommonResult<Long> sendMail(@Valid @RequestBody MailTemplateSendReqVO sendReqVO) { | |
| 85 | + return success(mailSendService.sendSingleMailToAdmin(sendReqVO.getMail(), null, | |
| 86 | + sendReqVO.getTemplateCode(), sendReqVO.getTemplateParams())); | |
| 87 | + } | |
| 88 | + | |
| 89 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountBaseVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account; | |
| 2 | + | |
| 3 | +import io.swagger.annotations.ApiModelProperty; | |
| 4 | +import lombok.Data; | |
| 5 | + | |
| 6 | +import javax.validation.constraints.Email; | |
| 7 | +import javax.validation.constraints.NotNull; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * 邮箱账号 Base VO,提供给添加、修改、详细的子 VO 使用 | |
| 11 | + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | |
| 12 | + */ | |
| 13 | +@Data | |
| 14 | +public class MailAccountBaseVO { | |
| 15 | + | |
| 16 | + @ApiModelProperty(value = "邮箱", required = true, example = "yudaoyuanma@123.com") | |
| 17 | + @NotNull(message = "邮箱不能为空") | |
| 18 | + @Email(message = "必须是 Email 格式") | |
| 19 | + private String mail; | |
| 20 | + | |
| 21 | + @ApiModelProperty(value = "用户名", required = true, example = "yudao") | |
| 22 | + @NotNull(message = "用户名不能为空") | |
| 23 | + private String username; | |
| 24 | + | |
| 25 | + @ApiModelProperty(value = "密码", required = true, example = "123456") | |
| 26 | + @NotNull(message = "密码必填") | |
| 27 | + private String password; | |
| 28 | + | |
| 29 | + @ApiModelProperty(value = "SMTP 服务器域名", required = true, example = "www.iocoder.cn") | |
| 30 | + @NotNull(message = "SMTP 服务器域名不能为空") | |
| 31 | + private String host; | |
| 32 | + | |
| 33 | + @ApiModelProperty(value = "SMTP 服务器端口", required = true, example = "80") | |
| 34 | + @NotNull(message = "SMTP 服务器端口不能为空") | |
| 35 | + private Integer port; | |
| 36 | + | |
| 37 | + @ApiModelProperty(value = "是否开启 ssl", required = true, example = "true") | |
| 38 | + @NotNull(message = "是否开启 ssl 必填") | |
| 39 | + private Boolean sslEnable; | |
| 40 | + | |
| 41 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountCreateReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account; | |
| 2 | + | |
| 3 | +import io.swagger.annotations.ApiModel; | |
| 4 | +import io.swagger.annotations.ApiModelProperty; | |
| 5 | +import lombok.Data; | |
| 6 | +import lombok.EqualsAndHashCode; | |
| 7 | +import lombok.ToString; | |
| 8 | + | |
| 9 | +import javax.validation.constraints.NotNull; | |
| 10 | + | |
| 11 | +@ApiModel("管理后台 - 邮箱账号创建 Request VO") | |
| 12 | +@Data | |
| 13 | +@EqualsAndHashCode(callSuper = true) | |
| 14 | +@ToString(callSuper = true) | |
| 15 | +public class MailAccountCreateReqVO extends MailAccountBaseVO { | |
| 16 | + | |
| 17 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountPageReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageParam; | |
| 4 | +import io.swagger.annotations.ApiModel; | |
| 5 | +import io.swagger.annotations.ApiModelProperty; | |
| 6 | +import lombok.Data; | |
| 7 | +import lombok.EqualsAndHashCode; | |
| 8 | +import lombok.ToString; | |
| 9 | + | |
| 10 | +@ApiModel("管理后台 - 邮箱账号分页 Request VO") | |
| 11 | +@Data | |
| 12 | +@EqualsAndHashCode(callSuper = true) | |
| 13 | +@ToString(callSuper = true) | |
| 14 | +public class MailAccountPageReqVO extends PageParam { | |
| 15 | + | |
| 16 | + @ApiModelProperty(value = "邮箱", required = true, example = "yudaoyuanma@123.com") | |
| 17 | + private String mail; | |
| 18 | + | |
| 19 | + @ApiModelProperty(value = "用户名" , required = true , example = "yudao") | |
| 20 | + private String username; | |
| 21 | + | |
| 22 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account; | |
| 2 | + | |
| 3 | +import io.swagger.annotations.ApiModel; | |
| 4 | +import io.swagger.annotations.ApiModelProperty; | |
| 5 | +import lombok.Data; | |
| 6 | +import lombok.EqualsAndHashCode; | |
| 7 | +import lombok.ToString; | |
| 8 | + | |
| 9 | +import javax.validation.constraints.NotNull; | |
| 10 | +import java.time.LocalDateTime; | |
| 11 | + | |
| 12 | +@ApiModel("管理后台 - 邮箱账号 Response VO") | |
| 13 | +@Data | |
| 14 | +@EqualsAndHashCode(callSuper = true) | |
| 15 | +@ToString(callSuper = true) | |
| 16 | +public class MailAccountRespVO extends MailAccountBaseVO { | |
| 17 | + | |
| 18 | + @ApiModelProperty(value = "编号", required = true, example = "1024") | |
| 19 | + @NotNull(message = "编号不能为空") | |
| 20 | + private Long id; | |
| 21 | + | |
| 22 | + @ApiModelProperty(value = "创建时间", required = true) | |
| 23 | + private LocalDateTime createTime; | |
| 24 | + | |
| 25 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountSimpleRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account; | |
| 2 | + | |
| 3 | +import io.swagger.annotations.ApiModel; | |
| 4 | +import io.swagger.annotations.ApiModelProperty; | |
| 5 | +import lombok.Data; | |
| 6 | + | |
| 7 | +@ApiModel("管理后台 - 邮箱账号的精简 Response VO") | |
| 8 | +@Data | |
| 9 | +public class MailAccountSimpleRespVO { | |
| 10 | + | |
| 11 | + @ApiModelProperty(value = "邮箱编号", required = true, example = "1024") | |
| 12 | + private Long id; | |
| 13 | + | |
| 14 | + @ApiModelProperty(value = "邮箱", required = true, example = "768541388@qq.com") | |
| 15 | + private String mail; | |
| 16 | + | |
| 17 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/account/MailAccountUpdateReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.mail.vo.account; | |
| 2 | + | |
| 3 | +import io.swagger.annotations.ApiModel; | |
| 4 | +import io.swagger.annotations.ApiModelProperty; | |
| 5 | +import lombok.Data; | |
| 6 | +import lombok.EqualsAndHashCode; | |
| 7 | +import lombok.ToString; | |
| 8 | + | |
| 9 | +import javax.validation.constraints.NotNull; | |
| 10 | + | |
| 11 | +@ApiModel("管理后台 - 邮箱账号修改 Request VO") | |
| 12 | +@Data | |
| 13 | +@EqualsAndHashCode(callSuper = true) | |
| 14 | +@ToString(callSuper = true) | |
| 15 | +public class MailAccountUpdateReqVO extends MailAccountBaseVO { | |
| 16 | + | |
| 17 | + @ApiModelProperty(value = "编号", required = true, example = "1024") | |
| 18 | + @NotNull(message = "编号不能为空") | |
| 19 | + private Long id; | |
| 20 | + | |
| 21 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/log/MailLogBaseVO.java
0 → 100755
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.mail.vo.log; | |
| 2 | + | |
| 3 | +import lombok.*; | |
| 4 | +import java.util.*; | |
| 5 | +import java.time.LocalDateTime; | |
| 6 | +import java.time.LocalDateTime; | |
| 7 | +import java.time.LocalDateTime; | |
| 8 | +import io.swagger.annotations.*; | |
| 9 | +import javax.validation.constraints.*; | |
| 10 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 11 | + | |
| 12 | +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 13 | + | |
| 14 | +/** | |
| 15 | +* 邮件日志 Base VO,提供给添加、修改、详细的子 VO 使用 | |
| 16 | +* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | |
| 17 | +*/ | |
| 18 | +@Data | |
| 19 | +public class MailLogBaseVO { | |
| 20 | + | |
| 21 | + @ApiModelProperty(value = "用户编号", example = "30883") | |
| 22 | + private Long userId; | |
| 23 | + | |
| 24 | + @ApiModelProperty(value = "用户类型", example = "2", notes = "参见 UserTypeEnum 枚举") | |
| 25 | + private Byte userType; | |
| 26 | + | |
| 27 | + @ApiModelProperty(value = "接收邮箱地址", required = true, example = "76854@qq.com") | |
| 28 | + @NotNull(message = "接收邮箱地址不能为空") | |
| 29 | + private String toMail; | |
| 30 | + | |
| 31 | + @ApiModelProperty(value = "邮箱账号编号", required = true, example = "18107") | |
| 32 | + @NotNull(message = "邮箱账号编号不能为空") | |
| 33 | + private Long accountId; | |
| 34 | + | |
| 35 | + @ApiModelProperty(value = "发送邮箱地址", required = true, example = "85757@qq.com") | |
| 36 | + @NotNull(message = "发送邮箱地址不能为空") | |
| 37 | + private String fromMail; | |
| 38 | + | |
| 39 | + @ApiModelProperty(value = "模板编号", required = true, example = "5678") | |
| 40 | + @NotNull(message = "模板编号不能为空") | |
| 41 | + private Long templateId; | |
| 42 | + | |
| 43 | + @ApiModelProperty(value = "模板编码", required = true, example = "test_01") | |
| 44 | + @NotNull(message = "模板编码不能为空") | |
| 45 | + private String templateCode; | |
| 46 | + | |
| 47 | + @ApiModelProperty(value = "模版发送人名称", example = "李四") | |
| 48 | + private String templateNickname; | |
| 49 | + | |
| 50 | + @ApiModelProperty(value = "邮件标题", required = true, example = "测试标题") | |
| 51 | + @NotNull(message = "邮件标题不能为空") | |
| 52 | + private String templateTitle; | |
| 53 | + | |
| 54 | + @ApiModelProperty(value = "邮件内容", required = true, example = "测试内容") | |
| 55 | + @NotNull(message = "邮件内容不能为空") | |
| 56 | + private String templateContent; | |
| 57 | + | |
| 58 | + @ApiModelProperty(value = "邮件参数", required = true) | |
| 59 | + @NotNull(message = "邮件参数不能为空") | |
| 60 | + private Map<String, Object> templateParams; | |
| 61 | + | |
| 62 | + @ApiModelProperty(value = "发送状态", required = true, example = "1", notes = "参见 MailSendStatusEnum 枚举") | |
| 63 | + @NotNull(message = "发送状态不能为空") | |
| 64 | + private Byte sendStatus; | |
| 65 | + | |
| 66 | + @ApiModelProperty(value = "发送时间") | |
| 67 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 68 | + private LocalDateTime sendTime; | |
| 69 | + | |
| 70 | + @ApiModelProperty(value = "发送返回的消息 ID", example = "28568") | |
| 71 | + private String sendMessageId; | |
| 72 | + | |
| 73 | + @ApiModelProperty(value = "发送异常") | |
| 74 | + private String sendException; | |
| 75 | + | |
| 76 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/log/MailLogPageReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.mail.vo.log; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageParam; | |
| 4 | +import io.swagger.annotations.ApiModel; | |
| 5 | +import io.swagger.annotations.ApiModelProperty; | |
| 6 | +import lombok.Data; | |
| 7 | +import lombok.EqualsAndHashCode; | |
| 8 | +import lombok.ToString; | |
| 9 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 10 | + | |
| 11 | +import java.sql.Timestamp; | |
| 12 | +import java.time.LocalDateTime; | |
| 13 | + | |
| 14 | +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 15 | + | |
| 16 | +@ApiModel("管理后台 - 邮箱日志分页 Request VO") | |
| 17 | +@Data | |
| 18 | +@EqualsAndHashCode(callSuper = true) | |
| 19 | +@ToString(callSuper = true) | |
| 20 | +public class MailLogPageReqVO extends PageParam { | |
| 21 | + | |
| 22 | + @ApiModelProperty(value = "用户编号", example = "30883") | |
| 23 | + private Long userId; | |
| 24 | + | |
| 25 | + @ApiModelProperty(value = "用户类型", example = "2", notes = "参见 UserTypeEnum 枚举") | |
| 26 | + private Integer userType; | |
| 27 | + | |
| 28 | + @ApiModelProperty(value = "接收邮箱地址", example = "76854@qq.com", notes = "模糊匹配") | |
| 29 | + private String toMail; | |
| 30 | + | |
| 31 | + @ApiModelProperty(value = "邮箱账号编号", example = "18107") | |
| 32 | + private Long accountId; | |
| 33 | + | |
| 34 | + @ApiModelProperty(value = "模板编号", example = "5678") | |
| 35 | + private Long templateId; | |
| 36 | + | |
| 37 | + @ApiModelProperty(value = "发送状态", example = "1", notes = "参见 MailSendStatusEnum 枚举") | |
| 38 | + private Integer sendStatus; | |
| 39 | + | |
| 40 | + @ApiModelProperty(value = "发送时间") | |
| 41 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 42 | + private LocalDateTime[] sendTime; | |
| 43 | + | |
| 44 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/log/MailLogRespVO.java
0 → 100755
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.mail.vo.log; | |
| 2 | + | |
| 3 | +import lombok.*; | |
| 4 | +import java.time.LocalDateTime; | |
| 5 | +import io.swagger.annotations.*; | |
| 6 | + | |
| 7 | +@ApiModel("管理后台 - 邮件日志 Response VO") | |
| 8 | +@Data | |
| 9 | +@EqualsAndHashCode(callSuper = true) | |
| 10 | +@ToString(callSuper = true) | |
| 11 | +public class MailLogRespVO extends MailLogBaseVO { | |
| 12 | + | |
| 13 | + @ApiModelProperty(value = "编号", required = true, example = "31020") | |
| 14 | + private Long id; | |
| 15 | + | |
| 16 | + @ApiModelProperty(value = "创建时间", required = true) | |
| 17 | + private LocalDateTime createTime; | |
| 18 | + | |
| 19 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateBaseVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.mail.vo.template; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailAccountDO; | |
| 4 | +import io.swagger.annotations.ApiModelProperty; | |
| 5 | +import lombok.Data; | |
| 6 | + | |
| 7 | +import javax.validation.constraints.NotEmpty; | |
| 8 | +import javax.validation.constraints.NotNull; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 邮件模版 Base VO,提供给添加、修改、详细的子 VO 使用 | |
| 12 | + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | |
| 13 | + */ | |
| 14 | +@Data | |
| 15 | +public class MailTemplateBaseVO { | |
| 16 | + | |
| 17 | + @ApiModelProperty(value = "模版名称", required = true, example = "测试名字") | |
| 18 | + @NotNull(message = "名称不能为空") | |
| 19 | + private String name; | |
| 20 | + | |
| 21 | + @ApiModelProperty(value = "模版编号", required = true, example = "test") | |
| 22 | + @NotNull(message = "模版编号不能为空") | |
| 23 | + private String code; | |
| 24 | + | |
| 25 | + @ApiModelProperty(value = "发送的邮箱账号编号", required = true, example = "1") | |
| 26 | + @NotNull(message = "发送的邮箱账号编号不能为空") | |
| 27 | + private Long accountId; | |
| 28 | + | |
| 29 | + @ApiModelProperty(value = "发送人名称", example = "芋头") | |
| 30 | + private String nickname; | |
| 31 | + | |
| 32 | + @ApiModelProperty(value = "标题", required = true, example = "注册成功") | |
| 33 | + @NotEmpty(message = "标题不能为空") | |
| 34 | + private String title; | |
| 35 | + | |
| 36 | + @ApiModelProperty(value = "内容", required = true, example = "你好,注册成功啦") | |
| 37 | + @NotEmpty(message = "内容不能为空") | |
| 38 | + private String content; | |
| 39 | + | |
| 40 | + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举") | |
| 41 | + @NotNull(message = "状态不能为空") | |
| 42 | + private Integer status; | |
| 43 | + | |
| 44 | + @ApiModelProperty(value = "备注", example = "奥特曼") | |
| 45 | + private String remark; | |
| 46 | + | |
| 47 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateCreateReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.mail.vo.template; | |
| 2 | + | |
| 3 | +import io.swagger.annotations.ApiModel; | |
| 4 | +import lombok.Data; | |
| 5 | +import lombok.EqualsAndHashCode; | |
| 6 | +import lombok.ToString; | |
| 7 | + | |
| 8 | +@ApiModel("管理后台 - 邮件模版创建 Request VO") | |
| 9 | +@Data | |
| 10 | +@EqualsAndHashCode(callSuper = true) | |
| 11 | +@ToString(callSuper = true) | |
| 12 | +public class MailTemplateCreateReqVO extends MailTemplateBaseVO { | |
| 13 | + | |
| 14 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplatePageReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.mail.vo.template; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageParam; | |
| 4 | +import io.swagger.annotations.ApiModel; | |
| 5 | +import io.swagger.annotations.ApiModelProperty; | |
| 6 | +import lombok.Data; | |
| 7 | +import lombok.EqualsAndHashCode; | |
| 8 | +import lombok.ToString; | |
| 9 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 10 | + | |
| 11 | +import java.time.LocalDateTime; | |
| 12 | + | |
| 13 | +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 14 | + | |
| 15 | +@ApiModel("管理后台 - 邮件模版分页 Request VO") | |
| 16 | +@Data | |
| 17 | +@EqualsAndHashCode(callSuper = true) | |
| 18 | +@ToString(callSuper = true) | |
| 19 | +public class MailTemplatePageReqVO extends PageParam { | |
| 20 | + | |
| 21 | + @ApiModelProperty(value = "状态", example = "1", notes = "参见 CommonStatusEnum 枚举") | |
| 22 | + private Integer status; | |
| 23 | + | |
| 24 | + @ApiModelProperty(value = "标识", example = "code_1024", notes = "模糊匹配") | |
| 25 | + private String code; | |
| 26 | + | |
| 27 | + @ApiModelProperty(value = "名称", example = "芋头", notes = "模糊匹配") | |
| 28 | + private String name; | |
| 29 | + | |
| 30 | + @ApiModelProperty(value = "账号编号", example = "2048") | |
| 31 | + private Long accountId; | |
| 32 | + | |
| 33 | + @ApiModelProperty(value = "创建时间") | |
| 34 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 35 | + private LocalDateTime[] createTime; | |
| 36 | + | |
| 37 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.mail.vo.template; | |
| 2 | + | |
| 3 | +import io.swagger.annotations.ApiModel; | |
| 4 | +import io.swagger.annotations.ApiModelProperty; | |
| 5 | +import lombok.Data; | |
| 6 | +import lombok.EqualsAndHashCode; | |
| 7 | +import lombok.ToString; | |
| 8 | + | |
| 9 | +import java.time.LocalDateTime; | |
| 10 | +import java.util.List; | |
| 11 | + | |
| 12 | +@ApiModel("管理后台 - 邮件末班 Response VO") | |
| 13 | +@Data | |
| 14 | +@EqualsAndHashCode(callSuper = true) | |
| 15 | +@ToString(callSuper = true) | |
| 16 | +public class MailTemplateRespVO extends MailTemplateBaseVO { | |
| 17 | + | |
| 18 | + @ApiModelProperty(value = "编号", required = true, example = "1024") | |
| 19 | + private Long id; | |
| 20 | + | |
| 21 | + @ApiModelProperty(value = "参数数组", example = "name,code") | |
| 22 | + private List<String> params; | |
| 23 | + | |
| 24 | + @ApiModelProperty(value = "创建时间", required = true) | |
| 25 | + private LocalDateTime createTime; | |
| 26 | + | |
| 27 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateSendReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.mail.vo.template; | |
| 2 | + | |
| 3 | +import io.swagger.annotations.ApiModel; | |
| 4 | +import io.swagger.annotations.ApiModelProperty; | |
| 5 | +import lombok.Data; | |
| 6 | + | |
| 7 | +import javax.validation.constraints.NotEmpty; | |
| 8 | +import javax.validation.constraints.NotNull; | |
| 9 | +import java.util.Map; | |
| 10 | + | |
| 11 | +@ApiModel("管理后台 - 邮件发送 Req VO") | |
| 12 | +@Data | |
| 13 | +public class MailTemplateSendReqVO { | |
| 14 | + | |
| 15 | + @ApiModelProperty(value = "接收邮箱", required = true, example = "7685413@qq.com") | |
| 16 | + @NotEmpty(message = "接收邮箱不能为空") | |
| 17 | + private String mail; | |
| 18 | + | |
| 19 | + @ApiModelProperty(value = "模板编码", required = true, example = "test_01") | |
| 20 | + @NotNull(message = "模板编码不能为空") | |
| 21 | + private String templateCode; | |
| 22 | + | |
| 23 | + @ApiModelProperty(value = "模板参数") | |
| 24 | + private Map<String, Object> templateParams; | |
| 25 | + | |
| 26 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateSimpleRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.mail.vo.template; | |
| 2 | + | |
| 3 | +import io.swagger.annotations.ApiModel; | |
| 4 | +import io.swagger.annotations.ApiModelProperty; | |
| 5 | +import lombok.Data; | |
| 6 | + | |
| 7 | +@ApiModel("管理后台 - 邮件模版的精简 Response VO") | |
| 8 | +@Data | |
| 9 | +public class MailTemplateSimpleRespVO { | |
| 10 | + | |
| 11 | + @ApiModelProperty(value = "模版编号", required = true, example = "1024") | |
| 12 | + private Long id; | |
| 13 | + | |
| 14 | + @ApiModelProperty(value = "模版名字", required = true, example = "哒哒哒") | |
| 15 | + private String name; | |
| 16 | + | |
| 17 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/vo/template/MailTemplateUpdateReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.mail.vo.template; | |
| 2 | + | |
| 3 | +import io.swagger.annotations.ApiModel; | |
| 4 | +import io.swagger.annotations.ApiModelProperty; | |
| 5 | +import lombok.Data; | |
| 6 | +import lombok.EqualsAndHashCode; | |
| 7 | +import lombok.ToString; | |
| 8 | + | |
| 9 | +import javax.validation.constraints.NotNull; | |
| 10 | + | |
| 11 | +@ApiModel("管理后台 - 邮件模版修改 Request VO") | |
| 12 | +@Data | |
| 13 | +@EqualsAndHashCode(callSuper = true) | |
| 14 | +@ToString(callSuper = true) | |
| 15 | +public class MailTemplateUpdateReqVO extends MailTemplateBaseVO { | |
| 16 | + | |
| 17 | + @ApiModelProperty(value = "编号", required = true, example = "1024") | |
| 18 | + @NotNull(message = "编号不能为空") | |
| 19 | + private Long id; | |
| 20 | + | |
| 21 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/NotifyMessageController.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.notify; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | |
| 4 | +import cn.iocoder.yudao.framework.common.pojo.CommonResult; | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | +import cn.iocoder.yudao.module.system.controller.admin.notify.vo.message.NotifyMessageMyPageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.system.controller.admin.notify.vo.message.NotifyMessagePageReqVO; | |
| 8 | +import cn.iocoder.yudao.module.system.controller.admin.notify.vo.message.NotifyMessageRespVO; | |
| 9 | +import cn.iocoder.yudao.module.system.convert.notify.NotifyMessageConvert; | |
| 10 | +import cn.iocoder.yudao.module.system.dal.dataobject.notify.NotifyMessageDO; | |
| 11 | +import cn.iocoder.yudao.module.system.service.notify.NotifyMessageService; | |
| 12 | +import io.swagger.annotations.Api; | |
| 13 | +import io.swagger.annotations.ApiImplicitParam; | |
| 14 | +import io.swagger.annotations.ApiOperation; | |
| 15 | +import org.springframework.security.access.prepost.PreAuthorize; | |
| 16 | +import org.springframework.validation.annotation.Validated; | |
| 17 | +import org.springframework.web.bind.annotation.*; | |
| 18 | + | |
| 19 | +import javax.annotation.Resource; | |
| 20 | +import javax.validation.Valid; | |
| 21 | +import java.util.List; | |
| 22 | + | |
| 23 | +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | |
| 24 | +import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; | |
| 25 | + | |
| 26 | +@Api(tags = "管理后台 - 我的站内信") | |
| 27 | +@RestController | |
| 28 | +@RequestMapping("/system/notify-message") | |
| 29 | +@Validated | |
| 30 | +public class NotifyMessageController { | |
| 31 | + | |
| 32 | + @Resource | |
| 33 | + private NotifyMessageService notifyMessageService; | |
| 34 | + | |
| 35 | + // ========== 管理所有的站内信 ========== | |
| 36 | + | |
| 37 | + @GetMapping("/get") | |
| 38 | + @ApiOperation("获得站内信") | |
| 39 | + @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) | |
| 40 | + @PreAuthorize("@ss.hasPermission('system:notify-message:query')") | |
| 41 | + public CommonResult<NotifyMessageRespVO> getNotifyMessage(@RequestParam("id") Long id) { | |
| 42 | + NotifyMessageDO notifyMessage = notifyMessageService.getNotifyMessage(id); | |
| 43 | + return success(NotifyMessageConvert.INSTANCE.convert(notifyMessage)); | |
| 44 | + } | |
| 45 | + | |
| 46 | + @GetMapping("/page") | |
| 47 | + @ApiOperation("获得站内信分页") | |
| 48 | + @PreAuthorize("@ss.hasPermission('system:notify-message:query')") | |
| 49 | + public CommonResult<PageResult<NotifyMessageRespVO>> getNotifyMessagePage(@Valid NotifyMessagePageReqVO pageVO) { | |
| 50 | + PageResult<NotifyMessageDO> pageResult = notifyMessageService.getNotifyMessagePage(pageVO); | |
| 51 | + return success(NotifyMessageConvert.INSTANCE.convertPage(pageResult)); | |
| 52 | + } | |
| 53 | + | |
| 54 | + // ========== 查看自己的站内信 ========== | |
| 55 | + | |
| 56 | + @GetMapping("/my-page") | |
| 57 | + @ApiOperation("获得我的站内信分页") | |
| 58 | + public CommonResult<PageResult<NotifyMessageRespVO>> getMyMyNotifyMessagePage(@Valid NotifyMessageMyPageReqVO pageVO) { | |
| 59 | + PageResult<NotifyMessageDO> pageResult = notifyMessageService.getMyMyNotifyMessagePage(pageVO, | |
| 60 | + getLoginUserId(), UserTypeEnum.ADMIN.getValue()); | |
| 61 | + return success(NotifyMessageConvert.INSTANCE.convertPage(pageResult)); | |
| 62 | + } | |
| 63 | + | |
| 64 | + @PutMapping("/update-read") | |
| 65 | + @ApiOperation("标记站内信为已读") | |
| 66 | + @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) | |
| 67 | + public CommonResult<Boolean> updateNotifyMessageRead(@RequestParam("ids") List<Long> ids) { | |
| 68 | + notifyMessageService.updateNotifyMessageRead(ids, getLoginUserId(), UserTypeEnum.ADMIN.getValue()); | |
| 69 | + return success(Boolean.TRUE); | |
| 70 | + } | |
| 71 | + | |
| 72 | + @PutMapping("/update-all-read") | |
| 73 | + @ApiOperation("标记所有站内信为已读") | |
| 74 | + public CommonResult<Boolean> updateAllNotifyMessageRead() { | |
| 75 | + notifyMessageService.updateAllNotifyMessageRead(getLoginUserId(), UserTypeEnum.ADMIN.getValue()); | |
| 76 | + return success(Boolean.TRUE); | |
| 77 | + } | |
| 78 | + | |
| 79 | + @GetMapping("/get-unread-list") | |
| 80 | + @ApiOperation("获取当前用户的最新站内信列表,默认 10 条") | |
| 81 | + @ApiImplicitParam(name = "size", value = "10", defaultValue = "10", dataTypeClass = Integer.class) | |
| 82 | + public CommonResult<List<NotifyMessageRespVO>> getUnreadNotifyMessageList( | |
| 83 | + @RequestParam(name = "size", defaultValue = "10") Integer size) { | |
| 84 | + List<NotifyMessageDO> list = notifyMessageService.getUnreadNotifyMessageList( | |
| 85 | + getLoginUserId(), UserTypeEnum.ADMIN.getValue(), size); | |
| 86 | + return success(NotifyMessageConvert.INSTANCE.convertList(list)); | |
| 87 | + } | |
| 88 | + | |
| 89 | + @GetMapping("/get-unread-count") | |
| 90 | + @ApiOperation("获得当前用户的未读站内信数量") | |
| 91 | + public CommonResult<Long> getUnreadNotifyMessageCount() { | |
| 92 | + return success(notifyMessageService.getUnreadNotifyMessageCount(getLoginUserId(), UserTypeEnum.ADMIN.getValue())); | |
| 93 | + } | |
| 94 | + | |
| 95 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/NotifyTemplateController.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.notify; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.CommonResult; | |
| 4 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 5 | +import cn.iocoder.yudao.module.system.controller.admin.notify.vo.template.*; | |
| 6 | +import cn.iocoder.yudao.module.system.convert.notify.NotifyTemplateConvert; | |
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.notify.NotifyTemplateDO; | |
| 8 | +import cn.iocoder.yudao.module.system.service.notify.NotifySendService; | |
| 9 | +import cn.iocoder.yudao.module.system.service.notify.NotifyTemplateService; | |
| 10 | +import io.swagger.annotations.Api; | |
| 11 | +import io.swagger.annotations.ApiImplicitParam; | |
| 12 | +import io.swagger.annotations.ApiOperation; | |
| 13 | +import org.springframework.security.access.prepost.PreAuthorize; | |
| 14 | +import org.springframework.validation.annotation.Validated; | |
| 15 | +import org.springframework.web.bind.annotation.*; | |
| 16 | + | |
| 17 | +import javax.annotation.Resource; | |
| 18 | +import javax.validation.Valid; | |
| 19 | + | |
| 20 | +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | |
| 21 | + | |
| 22 | +@Api(tags = "管理后台 - 站内信模版") | |
| 23 | +@RestController | |
| 24 | +@RequestMapping("/system/notify-template") | |
| 25 | +@Validated | |
| 26 | +public class NotifyTemplateController { | |
| 27 | + | |
| 28 | + @Resource | |
| 29 | + private NotifyTemplateService notifyTemplateService; | |
| 30 | + | |
| 31 | + @Resource | |
| 32 | + private NotifySendService notifySendService; | |
| 33 | + | |
| 34 | + @PostMapping("/create") | |
| 35 | + @ApiOperation("创建站内信模版") | |
| 36 | + @PreAuthorize("@ss.hasPermission('system:notify-template:create')") | |
| 37 | + public CommonResult<Long> createNotifyTemplate(@Valid @RequestBody NotifyTemplateCreateReqVO createReqVO) { | |
| 38 | + return success(notifyTemplateService.createNotifyTemplate(createReqVO)); | |
| 39 | + } | |
| 40 | + | |
| 41 | + @PutMapping("/update") | |
| 42 | + @ApiOperation("更新站内信模版") | |
| 43 | + @PreAuthorize("@ss.hasPermission('system:notify-template:update')") | |
| 44 | + public CommonResult<Boolean> updateNotifyTemplate(@Valid @RequestBody NotifyTemplateUpdateReqVO updateReqVO) { | |
| 45 | + notifyTemplateService.updateNotifyTemplate(updateReqVO); | |
| 46 | + return success(true); | |
| 47 | + } | |
| 48 | + | |
| 49 | + @DeleteMapping("/delete") | |
| 50 | + @ApiOperation("删除站内信模版") | |
| 51 | + @ApiImplicitParam(name = "id", value = "编号", required = true, dataTypeClass = Long.class) | |
| 52 | + @PreAuthorize("@ss.hasPermission('system:notify-template:delete')") | |
| 53 | + public CommonResult<Boolean> deleteNotifyTemplate(@RequestParam("id") Long id) { | |
| 54 | + notifyTemplateService.deleteNotifyTemplate(id); | |
| 55 | + return success(true); | |
| 56 | + } | |
| 57 | + | |
| 58 | + @GetMapping("/get") | |
| 59 | + @ApiOperation("获得站内信模版") | |
| 60 | + @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) | |
| 61 | + @PreAuthorize("@ss.hasPermission('system:notify-template:query')") | |
| 62 | + public CommonResult<NotifyTemplateRespVO> getNotifyTemplate(@RequestParam("id") Long id) { | |
| 63 | + NotifyTemplateDO notifyTemplate = notifyTemplateService.getNotifyTemplate(id); | |
| 64 | + return success(NotifyTemplateConvert.INSTANCE.convert(notifyTemplate)); | |
| 65 | + } | |
| 66 | + | |
| 67 | + @GetMapping("/page") | |
| 68 | + @ApiOperation("获得站内信模版分页") | |
| 69 | + @PreAuthorize("@ss.hasPermission('system:notify-template:query')") | |
| 70 | + public CommonResult<PageResult<NotifyTemplateRespVO>> getNotifyTemplatePage(@Valid NotifyTemplatePageReqVO pageVO) { | |
| 71 | + PageResult<NotifyTemplateDO> pageResult = notifyTemplateService.getNotifyTemplatePage(pageVO); | |
| 72 | + return success(NotifyTemplateConvert.INSTANCE.convertPage(pageResult)); | |
| 73 | + } | |
| 74 | + | |
| 75 | + @PostMapping("/send-notify") | |
| 76 | + @ApiOperation("发送站内信") | |
| 77 | + @PreAuthorize("@ss.hasPermission('system:notify-template:send-notify')") | |
| 78 | + public CommonResult<Long> sendNotify(@Valid @RequestBody NotifyTemplateSendReqVO sendReqVO) { | |
| 79 | + return success(notifySendService.sendSingleNotifyToAdmin(sendReqVO.getUserId(), | |
| 80 | + sendReqVO.getTemplateCode(), sendReqVO.getTemplateParams())); | |
| 81 | + } | |
| 82 | + | |
| 83 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/message/NotifyMessageBaseVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.notify.vo.message; | |
| 2 | + | |
| 3 | +import io.swagger.annotations.ApiModelProperty; | |
| 4 | +import lombok.Data; | |
| 5 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 6 | + | |
| 7 | +import javax.validation.constraints.NotNull; | |
| 8 | +import java.time.LocalDateTime; | |
| 9 | +import java.util.Date; | |
| 10 | +import java.util.Map; | |
| 11 | + | |
| 12 | +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * 站内信消息 Base VO,提供给添加、修改、详细的子 VO 使用 | |
| 16 | + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | |
| 17 | + */ | |
| 18 | +@Data | |
| 19 | +public class NotifyMessageBaseVO { | |
| 20 | + | |
| 21 | + @ApiModelProperty(value = "用户编号", required = true, example = "25025") | |
| 22 | + @NotNull(message = "用户编号不能为空") | |
| 23 | + private Long userId; | |
| 24 | + | |
| 25 | + @ApiModelProperty(value = "用户类型", required = true, example = "1", notes = "参见 UserTypeEnum 枚举") | |
| 26 | + @NotNull(message = "用户类型不能为空") | |
| 27 | + private Byte userType; | |
| 28 | + | |
| 29 | + @ApiModelProperty(value = "模版编号", required = true, example = "13013") | |
| 30 | + @NotNull(message = "模版编号不能为空") | |
| 31 | + private Long templateId; | |
| 32 | + | |
| 33 | + @ApiModelProperty(value = "模板编码", required = true, example = "test_01") | |
| 34 | + @NotNull(message = "模板编码不能为空") | |
| 35 | + private String templateCode; | |
| 36 | + | |
| 37 | + @ApiModelProperty(value = "模版发送人名称", required = true, example = "芋艿") | |
| 38 | + @NotNull(message = "模版发送人名称不能为空") | |
| 39 | + private String templateNickname; | |
| 40 | + | |
| 41 | + @ApiModelProperty(value = "模版内容", required = true, example = "测试内容") | |
| 42 | + @NotNull(message = "模版内容不能为空") | |
| 43 | + private String templateContent; | |
| 44 | + | |
| 45 | + @ApiModelProperty(value = "模版类型", required = true, example = "2") | |
| 46 | + @NotNull(message = "模版类型不能为空") | |
| 47 | + private Integer templateType; | |
| 48 | + | |
| 49 | + @ApiModelProperty(value = "模版参数", required = true) | |
| 50 | + @NotNull(message = "模版参数不能为空") | |
| 51 | + private Map<String, Object> templateParams; | |
| 52 | + | |
| 53 | + @ApiModelProperty(value = "是否已读", required = true, example = "true") | |
| 54 | + @NotNull(message = "是否已读不能为空") | |
| 55 | + private Boolean readStatus; | |
| 56 | + | |
| 57 | + @ApiModelProperty(value = "阅读时间") | |
| 58 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 59 | + private LocalDateTime readTime; | |
| 60 | + | |
| 61 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/message/NotifyMessageMyPageReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.notify.vo.message; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageParam; | |
| 4 | +import io.swagger.annotations.ApiModel; | |
| 5 | +import io.swagger.annotations.ApiModelProperty; | |
| 6 | +import lombok.Data; | |
| 7 | +import lombok.EqualsAndHashCode; | |
| 8 | +import lombok.ToString; | |
| 9 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 10 | + | |
| 11 | +import java.time.LocalDateTime; | |
| 12 | + | |
| 13 | +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 14 | + | |
| 15 | +@ApiModel("管理后台 - 站内信分页 Request VO") | |
| 16 | +@Data | |
| 17 | +@EqualsAndHashCode(callSuper = true) | |
| 18 | +@ToString(callSuper = true) | |
| 19 | +public class NotifyMessageMyPageReqVO extends PageParam { | |
| 20 | + | |
| 21 | + @ApiModelProperty(value = "是否已读", example = "true") | |
| 22 | + private Boolean readStatus; | |
| 23 | + | |
| 24 | + @ApiModelProperty(value = "创建时间") | |
| 25 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 26 | + private LocalDateTime[] createTime; | |
| 27 | + | |
| 28 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/message/NotifyMessagePageReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.notify.vo.message; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageParam; | |
| 4 | +import io.swagger.annotations.ApiModel; | |
| 5 | +import io.swagger.annotations.ApiModelProperty; | |
| 6 | +import lombok.Data; | |
| 7 | +import lombok.EqualsAndHashCode; | |
| 8 | +import lombok.ToString; | |
| 9 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 10 | + | |
| 11 | +import java.time.LocalDateTime; | |
| 12 | +import java.util.Date; | |
| 13 | + | |
| 14 | +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 15 | + | |
| 16 | +@ApiModel("管理后台 - 站内信分页 Request VO") | |
| 17 | +@Data | |
| 18 | +@EqualsAndHashCode(callSuper = true) | |
| 19 | +@ToString(callSuper = true) | |
| 20 | +public class NotifyMessagePageReqVO extends PageParam { | |
| 21 | + | |
| 22 | + @ApiModelProperty(value = "用户编号", example = "25025") | |
| 23 | + private Long userId; | |
| 24 | + | |
| 25 | + @ApiModelProperty(value = "用户类型", example = "1") | |
| 26 | + private Integer userType; | |
| 27 | + | |
| 28 | + @ApiModelProperty(value = "模板编码", example = "test_01") | |
| 29 | + private String templateCode; | |
| 30 | + | |
| 31 | + @ApiModelProperty(value = "模版类型", example = "2") | |
| 32 | + private Integer templateType; | |
| 33 | + | |
| 34 | + @ApiModelProperty(value = "创建时间") | |
| 35 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 36 | + private LocalDateTime[] createTime; | |
| 37 | + | |
| 38 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/message/NotifyMessageRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.notify.vo.message; | |
| 2 | + | |
| 3 | +import lombok.*; | |
| 4 | +import java.util.*; | |
| 5 | +import io.swagger.annotations.*; | |
| 6 | + | |
| 7 | +@ApiModel("管理后台 - 站内信 Response VO") | |
| 8 | +@Data | |
| 9 | +@EqualsAndHashCode(callSuper = true) | |
| 10 | +@ToString(callSuper = true) | |
| 11 | +public class NotifyMessageRespVO extends NotifyMessageBaseVO { | |
| 12 | + | |
| 13 | + @ApiModelProperty(value = "ID", required = true, example = "1024") | |
| 14 | + private Long id; | |
| 15 | + | |
| 16 | + @ApiModelProperty(value = "创建时间", required = true) | |
| 17 | + private Date createTime; | |
| 18 | + | |
| 19 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplateBaseVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.notify.vo.template; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | |
| 4 | +import cn.iocoder.yudao.framework.common.validation.InEnum; | |
| 5 | +import io.swagger.annotations.ApiModelProperty; | |
| 6 | +import lombok.Data; | |
| 7 | + | |
| 8 | +import javax.validation.constraints.NotEmpty; | |
| 9 | +import javax.validation.constraints.NotNull; | |
| 10 | + | |
| 11 | +/** | |
| 12 | +* 站内信模版 Base VO,提供给添加、修改、详细的子 VO 使用 | |
| 13 | +* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | |
| 14 | +*/ | |
| 15 | +@Data | |
| 16 | +public class NotifyTemplateBaseVO { | |
| 17 | + | |
| 18 | + @ApiModelProperty(value = "模版名称", required = true, example = "测试模版") | |
| 19 | + @NotEmpty(message = "模版名称不能为空") | |
| 20 | + private String name; | |
| 21 | + | |
| 22 | + @ApiModelProperty(value = "模版编码", required = true, example = "SEND_TEST") | |
| 23 | + @NotNull(message = "模版编码不能为空") | |
| 24 | + private String code; | |
| 25 | + | |
| 26 | + @ApiModelProperty(value = "模版类型", required = true, example = "1", notes = "对应 system_notify_template_type 字典") | |
| 27 | + @NotNull(message = "模版类型不能为空") | |
| 28 | + private Integer type; | |
| 29 | + | |
| 30 | + @ApiModelProperty(value = "发送人名称", required = true, example = "土豆") | |
| 31 | + @NotEmpty(message = "发送人名称不能为空") | |
| 32 | + private String nickname; | |
| 33 | + | |
| 34 | + @ApiModelProperty(value = "模版内容", required = true, example = "我是模版内容") | |
| 35 | + @NotEmpty(message = "模版内容不能为空") | |
| 36 | + private String content; | |
| 37 | + | |
| 38 | + @ApiModelProperty(value = "状态", required = true, example = "1", notes = "参见 CommonStatusEnum 枚举") | |
| 39 | + @NotNull(message = "状态不能为空") | |
| 40 | + @InEnum(value = CommonStatusEnum.class, message = "状态必须是 {value}") | |
| 41 | + private Integer status; | |
| 42 | + | |
| 43 | + @ApiModelProperty(value = "备注", example = "我是备注") | |
| 44 | + private String remark; | |
| 45 | + | |
| 46 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplateCreateReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.notify.vo.template; | |
| 2 | + | |
| 3 | +import lombok.*; | |
| 4 | +import io.swagger.annotations.*; | |
| 5 | + | |
| 6 | +@ApiModel("管理后台 - 站内信模版创建 Request VO") | |
| 7 | +@Data | |
| 8 | +@EqualsAndHashCode(callSuper = true) | |
| 9 | +@ToString(callSuper = true) | |
| 10 | +public class NotifyTemplateCreateReqVO extends NotifyTemplateBaseVO { | |
| 11 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplatePageReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.notify.vo.template; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils; | |
| 4 | +import lombok.*; | |
| 5 | + | |
| 6 | +import java.time.LocalDateTime; | |
| 7 | +import java.util.*; | |
| 8 | +import io.swagger.annotations.*; | |
| 9 | +import cn.iocoder.yudao.framework.common.pojo.PageParam; | |
| 10 | +import org.springframework.format.annotation.DateTimeFormat; | |
| 11 | + | |
| 12 | +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 13 | + | |
| 14 | +@ApiModel("管理后台 - 站内信模版分页 Request VO") | |
| 15 | +@Data | |
| 16 | +@EqualsAndHashCode(callSuper = true) | |
| 17 | +@ToString(callSuper = true) | |
| 18 | +public class NotifyTemplatePageReqVO extends PageParam { | |
| 19 | + | |
| 20 | + @ApiModelProperty(value = "模版编码", example = "test_01") | |
| 21 | + private String code; | |
| 22 | + | |
| 23 | + @ApiModelProperty(value = "模版名称", example = "我是名称") | |
| 24 | + private String name; | |
| 25 | + | |
| 26 | + @ApiModelProperty(value = "状态", example = "1", notes = "参见 CommonStatusEnum 枚举类") | |
| 27 | + private Integer status; | |
| 28 | + | |
| 29 | + @ApiModelProperty(value = "创建时间") | |
| 30 | + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 31 | + private LocalDateTime[] createTime; | |
| 32 | + | |
| 33 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplateRespVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.notify.vo.template; | |
| 2 | + | |
| 3 | +import lombok.*; | |
| 4 | +import java.util.*; | |
| 5 | +import io.swagger.annotations.*; | |
| 6 | + | |
| 7 | +@ApiModel("管理后台 - 站内信模版 Response VO") | |
| 8 | +@Data | |
| 9 | +@EqualsAndHashCode(callSuper = true) | |
| 10 | +@ToString(callSuper = true) | |
| 11 | +public class NotifyTemplateRespVO extends NotifyTemplateBaseVO { | |
| 12 | + | |
| 13 | + @ApiModelProperty(value = "ID", required = true, example = "1024") | |
| 14 | + private Long id; | |
| 15 | + | |
| 16 | + @ApiModelProperty(value = "参数数组", example = "name,code") | |
| 17 | + private List<String> params; | |
| 18 | + | |
| 19 | + @ApiModelProperty(value = "创建时间", required = true) | |
| 20 | + private Date createTime; | |
| 21 | + | |
| 22 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplateSendReqVO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.controller.admin.notify.vo.template; | |
| 2 | + | |
| 3 | +import io.swagger.annotations.ApiModel; | |
| 4 | +import io.swagger.annotations.ApiModelProperty; | |
| 5 | +import lombok.Data; | |
| 6 | + | |
| 7 | +import javax.validation.constraints.NotEmpty; | |
| 8 | +import javax.validation.constraints.NotNull; | |
| 9 | +import java.util.Map; | |
| 10 | + | |
| 11 | +@ApiModel("管理后台 - 站内信模板的发送 Request VO") | |
| 12 | +@Data | |
| 13 | +public class NotifyTemplateSendReqVO { | |
| 14 | + | |
| 15 | + @ApiModelProperty(value = "用户id", required = true, example = "01") | |
| 16 | + @NotNull(message = "用户id不能为空") | |
| 17 | + private Long userId; | |
| 18 | + | |
| 19 | + @ApiModelProperty(value = "模板编码", required = true, example = "01") | |
| 20 | + @NotEmpty(message = "模板编码不能为空") | |
| 21 | + private String templateCode; | |
| 22 | + | |
| 23 | + @ApiModelProperty(value = "模板参数") | |
| 24 | + private Map<String, Object> templateParams; | |
| 25 | +} | ... | ... |