Commit 7731b4f5033c1ed1788e3d909ce5de3efef49afc
Merge branch 'master' of https://gitee.com/zhijiantianya/ruoyi-vue-pro into feature/dev-yunai
Showing
188 changed files
with
9436 additions
and
345 deletions
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> |
| ... | ... | @@ -39,7 +39,7 @@ |
| 39 | 39 | <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version> |
| 40 | 40 | <!-- 看看咋放到 bom 里 --> |
| 41 | 41 | <lombok.version>1.18.24</lombok.version> |
| 42 | - <spring.boot.version>2.7.7</spring.boot.version> | |
| 42 | + <spring.boot.version>2.7.8</spring.boot.version> | |
| 43 | 43 | <mapstruct.version>1.5.3.Final</mapstruct.version> |
| 44 | 44 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| 45 | 45 | </properties> | ... | ... |
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'); |
| ... | ... | @@ -1791,76 +1895,76 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i |
| 1791 | 1895 | 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 (1267, '客户端删除', 'system:oauth2-client:delete', 3, 4, 1263, '', '', '', 0, b'1', b'1', '', '2022-05-10 16:26:33', '1', '2022-05-11 00:31:33', b'0'); |
| 1792 | 1896 | 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 (1281, '报表管理', '', 1, 40, 0, '/visualization', 'chart', NULL, 0, b'1', b'1', '1', '2022-07-10 20:22:15', '1', '2022-12-10 16:33:13', b'0'); |
| 1793 | 1897 | 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 (1282, '报表设计器', '', 2, 1, 1281, 'jimu-report', 'example', 'visualization/jmreport/index', 0, b'1', b'1', '1', '2022-07-10 20:26:36', '1', '2022-07-29 12:48:05', b'0'); |
| 1794 | -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 (2000, '商品中心', '', 1, 60, 0, '/product', 'merchant', NULL, 0, b'1', b'1', '', '2022-07-29 15:53:53', '1', '2022-07-30 22:26:19', b'0'); | |
| 1795 | -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 (2002, '商品分类', '', 2, 2, 2000, 'category', 'dict', 'mall/product/category/index', 0, b'1', b'1', '', '2022-07-29 15:53:53', '1', '2022-07-30 22:23:37', b'0'); | |
| 1796 | -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 (2003, '分类查询', 'product:category:query', 3, 1, 2002, '', '', '', 0, b'1', b'1', '', '2022-07-29 15:53:53', '', '2022-07-29 15:53:53', b'0'); | |
| 1797 | -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 (2004, '分类创建', 'product:category:create', 3, 2, 2002, '', '', '', 0, b'1', b'1', '', '2022-07-29 15:53:53', '', '2022-07-29 15:53:53', b'0'); | |
| 1798 | -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 (2005, '分类更新', 'product:category:update', 3, 3, 2002, '', '', '', 0, b'1', b'1', '', '2022-07-29 15:53:53', '', '2022-07-29 15:53:53', b'0'); | |
| 1799 | -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 (2006, '分类删除', 'product:category:delete', 3, 4, 2002, '', '', '', 0, b'1', b'1', '', '2022-07-29 15:53:53', '', '2022-07-29 15:53:53', b'0'); | |
| 1800 | -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 (2008, '商品品牌', '', 2, 3, 2000, 'brand', 'dashboard', 'mall/product/brand/index', 0, b'1', b'1', '', '2022-07-30 13:52:44', '1', '2022-10-24 22:29:30', b'0'); | |
| 1801 | -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 (2009, '品牌查询', 'product:brand:query', 3, 1, 2008, '', '', '', 0, b'1', b'1', '', '2022-07-30 13:52:44', '', '2022-07-30 13:52:44', b'0'); | |
| 1802 | -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 (2010, '品牌创建', 'product:brand:create', 3, 2, 2008, '', '', '', 0, b'1', b'1', '', '2022-07-30 13:52:44', '', '2022-07-30 13:52:44', b'0'); | |
| 1803 | -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 (2011, '品牌更新', 'product:brand:update', 3, 3, 2008, '', '', '', 0, b'1', b'1', '', '2022-07-30 13:52:44', '', '2022-07-30 13:52:44', b'0'); | |
| 1804 | -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 (2012, '品牌删除', 'product:brand:delete', 3, 4, 2008, '', '', '', 0, b'1', b'1', '', '2022-07-30 13:52:44', '', '2022-07-30 13:52:44', b'0'); | |
| 1805 | -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 (2014, '商品列表', '', 2, 1, 2000, 'spu', 'list', 'mall/product/spu/index', 0, b'1', b'1', '', '2022-07-30 14:22:58', '1', '2022-10-24 22:29:25', b'0'); | |
| 1806 | -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 (2015, '商品查询', 'product:spu:query', 3, 1, 2014, '', '', '', 0, b'1', b'1', '', '2022-07-30 14:22:58', '', '2022-07-30 14:22:58', b'0'); | |
| 1807 | -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 (2016, '商品创建', 'product:spu:create', 3, 2, 2014, '', '', '', 0, b'1', b'1', '', '2022-07-30 14:22:58', '', '2022-07-30 14:22:58', b'0'); | |
| 1808 | -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 (2017, '商品更新', 'product:spu:update', 3, 3, 2014, '', '', '', 0, b'1', b'1', '', '2022-07-30 14:22:58', '', '2022-07-30 14:22:58', b'0'); | |
| 1809 | -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 (2018, '商品删除', 'product:spu:delete', 3, 4, 2014, '', '', '', 0, b'1', b'1', '', '2022-07-30 14:22:58', '', '2022-07-30 14:22:58', b'0'); | |
| 1810 | -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 (2019, '商品属性', '', 2, 3, 2000, 'property', 'eye', 'mall/product/property/index', 0, b'1', b'1', '', '2022-08-01 14:55:35', '1', '2022-12-12 20:58:06', b'0'); | |
| 1811 | -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 (2020, '规格查询', 'product:property:query', 3, 1, 2019, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:55:35', '', '2022-12-12 20:26:24', b'0'); | |
| 1812 | -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 (2021, '规格创建', 'product:property:create', 3, 2, 2019, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:55:35', '', '2022-12-12 20:26:30', b'0'); | |
| 1813 | -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 (2022, '规格更新', 'product:property:update', 3, 3, 2019, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:55:35', '', '2022-12-12 20:26:33', b'0'); | |
| 1814 | -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 (2023, '规格删除', 'product:property:delete', 3, 4, 2019, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:55:35', '', '2022-12-12 20:26:37', b'0'); | |
| 1815 | -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 (2025, 'Banner管理', '', 2, 100, 2000, 'banner', '', 'mall/market/banner/index', 0, b'1', b'1', '', '2022-08-01 14:56:14', '1', '2022-10-24 22:29:39', b'0'); | |
| 1816 | -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 (2026, 'Banner查询', 'market:banner:query', 3, 1, 2025, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:56:14', '', '2022-08-01 14:56:14', b'0'); | |
| 1817 | -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 (2027, 'Banner创建', 'market:banner:create', 3, 2, 2025, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:56:14', '', '2022-08-01 14:56:14', b'0'); | |
| 1818 | -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 (2028, 'Banner更新', 'market:banner:update', 3, 3, 2025, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:56:14', '', '2022-08-01 14:56:14', b'0'); | |
| 1819 | -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 (2029, 'Banner删除', 'market:banner:delete', 3, 4, 2025, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:56:14', '', '2022-08-01 14:56:14', b'0'); | |
| 1820 | -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 (2030, '营销中心', '', 1, 70, 0, '/promotion', 'rate', NULL, 0, b'1', b'1', '1', '2022-10-31 21:25:09', '1', '2022-10-31 21:25:09', b'0'); | |
| 1821 | -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 (2032, '优惠劵', '', 2, 2, 2030, 'coupon-template', 'textarea', 'mall/promotion/couponTemplate/index', 0, b'1', b'1', '', '2022-10-31 22:27:14', '1', '2022-11-05 12:27:34', b'0'); | |
| 1822 | -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 (2033, '优惠劵模板查询', 'promotion:coupon-template:query', 3, 1, 2032, '', '', '', 0, b'1', b'1', '', '2022-10-31 22:27:14', '', '2022-10-31 22:27:14', b'0'); | |
| 1823 | -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 (2034, '优惠劵模板创建', 'promotion:coupon-template:create', 3, 2, 2032, '', '', '', 0, b'1', b'1', '', '2022-10-31 22:27:14', '', '2022-10-31 22:27:14', b'0'); | |
| 1824 | -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 (2035, '优惠劵模板更新', 'promotion:coupon-template:update', 3, 3, 2032, '', '', '', 0, b'1', b'1', '', '2022-10-31 22:27:14', '', '2022-10-31 22:27:14', b'0'); | |
| 1825 | -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 (2036, '优惠劵模板删除', 'promotion:coupon-template:delete', 3, 4, 2032, '', '', '', 0, b'1', b'1', '', '2022-10-31 22:27:14', '', '2022-10-31 22:27:14', b'0'); | |
| 1826 | -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 (2038, '会员优惠劵', '', 2, 2, 2030, 'coupon', '', 'mall/promotion/coupon/index', 0, b'0', b'1', '', '2022-11-03 23:21:31', '1', '2022-11-05 12:27:45', b'0'); | |
| 1827 | -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 (2039, '优惠劵查询', 'promotion:coupon:query', 3, 1, 2038, '', '', '', 0, b'1', b'1', '', '2022-11-03 23:21:31', '', '2022-11-03 23:21:31', b'0'); | |
| 1828 | -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 (2040, '优惠劵删除', 'promotion:coupon:delete', 3, 4, 2038, '', '', '', 0, b'1', b'1', '', '2022-11-03 23:21:31', '', '2022-11-03 23:21:31', b'0'); | |
| 1829 | -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 (2041, '满减送活动', '', 2, 10, 2030, 'reward-activity', 'radio', 'mall/promotion/rewardActivity/index', 0, b'1', b'1', '', '2022-11-04 23:47:49', '1', '2022-11-05 12:27:56', b'0'); | |
| 1830 | -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 (2042, '满减送活动查询', 'promotion:reward-activity:query', 3, 1, 2041, '', '', '', 0, b'1', b'1', '', '2022-11-04 23:47:49', '', '2022-11-04 23:47:49', b'0'); | |
| 1831 | -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 (2043, '满减送活动创建', 'promotion:reward-activity:create', 3, 2, 2041, '', '', '', 0, b'1', b'1', '', '2022-11-04 23:47:49', '', '2022-11-04 23:47:49', b'0'); | |
| 1832 | -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 (2044, '满减送活动更新', 'promotion:reward-activity:update', 3, 3, 2041, '', '', '', 0, b'1', b'1', '', '2022-11-04 23:47:50', '', '2022-11-04 23:47:50', b'0'); | |
| 1833 | -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 (2045, '满减送活动删除', 'promotion:reward-activity:delete', 3, 4, 2041, '', '', '', 0, b'1', b'1', '', '2022-11-04 23:47:50', '', '2022-11-04 23:47:50', b'0'); | |
| 1834 | -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 (2046, '满减送活动关闭', 'promotion:reward-activity:close', 3, 5, 2041, '', '', '', 0, b'1', b'1', '1', '2022-11-05 10:42:53', '1', '2022-11-05 10:42:53', b'0'); | |
| 1835 | -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 (2047, '限时折扣活动', '', 2, 7, 2030, 'discount-activity', 'time', 'mall/promotion/discountActivity/index', 0, b'1', b'1', '', '2022-11-05 17:12:15', '1', '2022-11-29 22:14:56', b'0'); | |
| 1836 | -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 (2048, '限时折扣活动查询', 'promotion:discount-activity:query', 3, 1, 2047, '', '', '', 0, b'1', b'1', '', '2022-11-05 17:12:15', '', '2022-11-05 17:12:15', b'0'); | |
| 1837 | -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 (2049, '限时折扣活动创建', 'promotion:discount-activity:create', 3, 2, 2047, '', '', '', 0, b'1', b'1', '', '2022-11-05 17:12:15', '', '2022-11-05 17:12:15', b'0'); | |
| 1838 | -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 (2050, '限时折扣活动更新', 'promotion:discount-activity:update', 3, 3, 2047, '', '', '', 0, b'1', b'1', '', '2022-11-05 17:12:16', '', '2022-11-05 17:12:16', b'0'); | |
| 1839 | -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 (2051, '限时折扣活动删除', 'promotion:discount-activity:delete', 3, 4, 2047, '', '', '', 0, b'1', b'1', '', '2022-11-05 17:12:16', '', '2022-11-05 17:12:16', b'0'); | |
| 1840 | -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 (2052, '限时折扣活动关闭', 'promotion:discount-activity:close', 3, 5, 2047, '', '', '', 0, b'1', b'1', '', '2022-11-05 17:12:16', '', '2022-11-05 17:12:16', b'0'); | |
| 1841 | -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 (2059, '秒杀活动管理', '', 2, 0, 2030, 'seckill-activity', 'time-range', 'mall/promotion/seckill/seckillActivity/index', 0, b'1', b'1', '', '2022-11-06 22:24:49', '1', '2022-11-29 22:24:39', b'0'); | |
| 1842 | -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 (2060, '秒杀活动查询', 'promotion:seckill-activity:query', 3, 1, 2059, '', '', '', 0, b'1', b'1', '', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0'); | |
| 1843 | -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 (2061, '秒杀活动创建', 'promotion:seckill-activity:create', 3, 2, 2059, '', '', '', 0, b'1', b'1', '', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0'); | |
| 1844 | -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 (2062, '秒杀活动更新', 'promotion:seckill-activity:update', 3, 3, 2059, '', '', '', 0, b'1', b'1', '', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0'); | |
| 1845 | -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 (2063, '秒杀活动删除', 'promotion:seckill-activity:delete', 3, 4, 2059, '', '', '', 0, b'1', b'1', '', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0'); | |
| 1846 | -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 (2064, '秒杀活动导出', 'promotion:seckill-activity:export', 3, 5, 2059, '', '', '', 0, b'1', b'1', '', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0'); | |
| 1847 | -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 (2066, '秒杀时段管理', '', 2, 0, 2030, 'seckill-time', '', 'mall/promotion/seckill/seckillTime/index', 0, b'0', b'1', '', '2022-11-15 19:46:50', '1', '2022-11-29 22:09:03', b'0'); | |
| 1848 | -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 (2067, '秒杀时段查询', 'promotion:seckill-time:query', 3, 1, 2066, '', '', '', 0, b'1', b'1', '', '2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0'); | |
| 1849 | -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 (2068, '秒杀时段创建', 'promotion:seckill-time:create', 3, 2, 2066, '', '', '', 0, b'1', b'1', '', '2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0'); | |
| 1850 | -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 (2069, '秒杀时段更新', 'promotion:seckill-time:update', 3, 3, 2066, '', '', '', 0, b'1', b'1', '', '2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0'); | |
| 1851 | -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 (2070, '秒杀时段删除', 'promotion:seckill-time:delete', 3, 4, 2066, '', '', '', 0, b'1', b'1', '', '2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0'); | |
| 1852 | -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 (2071, '秒杀时段导出', 'promotion:seckill-time:export', 3, 5, 2066, '', '', '', 0, b'1', b'1', '', '2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0'); | |
| 1853 | -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 (2072, '订单中心', '', 1, 65, 0, '/trade', 'order', NULL, 0, b'1', b'1', '1', '2022-11-19 18:57:19', '1', '2022-12-10 16:32:57', b'0'); | |
| 1854 | -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 (2073, '售后退款', '', 2, 1, 2072, 'trade/after-sale', 'education', 'mall/trade/afterSale/index', 0, b'1', b'1', '', '2022-11-19 20:15:32', '1', '2022-12-10 21:11:02', b'0'); | |
| 1855 | -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 (2074, '售后查询', 'trade:after-sale:query', 3, 1, 2073, '', '', '', 0, b'1', b'1', '', '2022-11-19 20:15:33', '1', '2022-12-10 21:04:29', b'0'); | |
| 1856 | -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 (2075, '秒杀活动关闭', 'promotion:sekill-activity:close', 3, 6, 2059, '', '', '', 0, b'1', b'1', '1', '2022-11-28 20:20:15', '1', '2022-11-28 20:20:15', b'0'); | |
| 1857 | -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 (2076, '订单列表', '', 2, 0, 2072, 'trade/order', 'list', 'mall/trade/order/index', 0, b'1', b'1', '1', '2022-12-10 21:05:44', '1', '2022-12-10 21:08:44', b'0'); | |
| 1858 | -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 (2077, '物流公司管理管理', '', 2, 0, 2072, 'express-company', '', 'mall/trade/expressCompany/index', 0, b'1', b'1', '', '2022-12-20 23:27:55', '1', '2022-12-20 23:36:20', b'0'); | |
| 1859 | -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 (2078, '物流公司管理查询', 'trade:express-company:query', 3, 1, 2077, '', '', '', 0, b'1', b'1', '', '2022-12-20 23:27:55', '', '2022-12-20 23:27:55', b'0'); | |
| 1860 | -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 (2079, '物流公司管理创建', 'trade:express-company:create', 3, 2, 2077, '', '', '', 0, b'1', b'1', '', '2022-12-20 23:27:55', '', '2022-12-20 23:27:55', b'0'); | |
| 1861 | -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 (2080, '物流公司管理更新', 'trade:express-company:update', 3, 3, 2077, '', '', '', 0, b'1', b'1', '', '2022-12-20 23:27:55', '', '2022-12-20 23:27:55', b'0'); | |
| 1862 | -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 (2081, '物流公司管理删除', 'trade:express-company:delete', 3, 4, 2077, '', '', '', 0, b'1', b'1', '', '2022-12-20 23:27:55', '', '2022-12-20 23:27:55', b'0'); | |
| 1863 | -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 (2082, '物流公司管理导出', 'trade:express-company:export', 3, 5, 2077, '', '', '', 0, b'1', b'1', '', '2022-12-20 23:27:55', '', '2022-12-20 23:27:55', b'0'); | |
| 1898 | +# 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 (2000, '商品中心', '', 1, 60, 0, '/product', 'merchant', NULL, 0, b'1', b'1', '', '2022-07-29 15:53:53', '1', '2022-07-30 22:26:19', b'0'); | |
| 1899 | +# 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 (2002, '商品分类', '', 2, 2, 2000, 'category', 'dict', 'mall/product/category/index', 0, b'1', b'1', '', '2022-07-29 15:53:53', '1', '2022-07-30 22:23:37', b'0'); | |
| 1900 | +# 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 (2003, '分类查询', 'product:category:query', 3, 1, 2002, '', '', '', 0, b'1', b'1', '', '2022-07-29 15:53:53', '', '2022-07-29 15:53:53', b'0'); | |
| 1901 | +# 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 (2004, '分类创建', 'product:category:create', 3, 2, 2002, '', '', '', 0, b'1', b'1', '', '2022-07-29 15:53:53', '', '2022-07-29 15:53:53', b'0'); | |
| 1902 | +# 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 (2005, '分类更新', 'product:category:update', 3, 3, 2002, '', '', '', 0, b'1', b'1', '', '2022-07-29 15:53:53', '', '2022-07-29 15:53:53', b'0'); | |
| 1903 | +# 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 (2006, '分类删除', 'product:category:delete', 3, 4, 2002, '', '', '', 0, b'1', b'1', '', '2022-07-29 15:53:53', '', '2022-07-29 15:53:53', b'0'); | |
| 1904 | +# 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 (2008, '商品品牌', '', 2, 3, 2000, 'brand', 'dashboard', 'mall/product/brand/index', 0, b'1', b'1', '', '2022-07-30 13:52:44', '1', '2022-10-24 22:29:30', b'0'); | |
| 1905 | +# 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 (2009, '品牌查询', 'product:brand:query', 3, 1, 2008, '', '', '', 0, b'1', b'1', '', '2022-07-30 13:52:44', '', '2022-07-30 13:52:44', b'0'); | |
| 1906 | +# 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 (2010, '品牌创建', 'product:brand:create', 3, 2, 2008, '', '', '', 0, b'1', b'1', '', '2022-07-30 13:52:44', '', '2022-07-30 13:52:44', b'0'); | |
| 1907 | +# 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 (2011, '品牌更新', 'product:brand:update', 3, 3, 2008, '', '', '', 0, b'1', b'1', '', '2022-07-30 13:52:44', '', '2022-07-30 13:52:44', b'0'); | |
| 1908 | +# 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 (2012, '品牌删除', 'product:brand:delete', 3, 4, 2008, '', '', '', 0, b'1', b'1', '', '2022-07-30 13:52:44', '', '2022-07-30 13:52:44', b'0'); | |
| 1909 | +# 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 (2014, '商品列表', '', 2, 1, 2000, 'spu', 'list', 'mall/product/spu/index', 0, b'1', b'1', '', '2022-07-30 14:22:58', '1', '2022-10-24 22:29:25', b'0'); | |
| 1910 | +# 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 (2015, '商品查询', 'product:spu:query', 3, 1, 2014, '', '', '', 0, b'1', b'1', '', '2022-07-30 14:22:58', '', '2022-07-30 14:22:58', b'0'); | |
| 1911 | +# 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 (2016, '商品创建', 'product:spu:create', 3, 2, 2014, '', '', '', 0, b'1', b'1', '', '2022-07-30 14:22:58', '', '2022-07-30 14:22:58', b'0'); | |
| 1912 | +# 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 (2017, '商品更新', 'product:spu:update', 3, 3, 2014, '', '', '', 0, b'1', b'1', '', '2022-07-30 14:22:58', '', '2022-07-30 14:22:58', b'0'); | |
| 1913 | +# 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 (2018, '商品删除', 'product:spu:delete', 3, 4, 2014, '', '', '', 0, b'1', b'1', '', '2022-07-30 14:22:58', '', '2022-07-30 14:22:58', b'0'); | |
| 1914 | +# 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 (2019, '商品属性', '', 2, 3, 2000, 'property', 'eye', 'mall/product/property/index', 0, b'1', b'1', '', '2022-08-01 14:55:35', '1', '2022-12-12 20:58:06', b'0'); | |
| 1915 | +# 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 (2020, '规格查询', 'product:property:query', 3, 1, 2019, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:55:35', '', '2022-12-12 20:26:24', b'0'); | |
| 1916 | +# 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 (2021, '规格创建', 'product:property:create', 3, 2, 2019, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:55:35', '', '2022-12-12 20:26:30', b'0'); | |
| 1917 | +# 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 (2022, '规格更新', 'product:property:update', 3, 3, 2019, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:55:35', '', '2022-12-12 20:26:33', b'0'); | |
| 1918 | +# 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 (2023, '规格删除', 'product:property:delete', 3, 4, 2019, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:55:35', '', '2022-12-12 20:26:37', b'0'); | |
| 1919 | +# 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 (2025, 'Banner管理', '', 2, 100, 2000, 'banner', '', 'mall/market/banner/index', 0, b'1', b'1', '', '2022-08-01 14:56:14', '1', '2022-10-24 22:29:39', b'0'); | |
| 1920 | +# 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 (2026, 'Banner查询', 'market:banner:query', 3, 1, 2025, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:56:14', '', '2022-08-01 14:56:14', b'0'); | |
| 1921 | +# 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 (2027, 'Banner创建', 'market:banner:create', 3, 2, 2025, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:56:14', '', '2022-08-01 14:56:14', b'0'); | |
| 1922 | +# 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 (2028, 'Banner更新', 'market:banner:update', 3, 3, 2025, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:56:14', '', '2022-08-01 14:56:14', b'0'); | |
| 1923 | +# 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 (2029, 'Banner删除', 'market:banner:delete', 3, 4, 2025, '', '', '', 0, b'1', b'1', '', '2022-08-01 14:56:14', '', '2022-08-01 14:56:14', b'0'); | |
| 1924 | +# 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 (2030, '营销中心', '', 1, 70, 0, '/promotion', 'rate', NULL, 0, b'1', b'1', '1', '2022-10-31 21:25:09', '1', '2022-10-31 21:25:09', b'0'); | |
| 1925 | +# 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 (2032, '优惠劵', '', 2, 2, 2030, 'coupon-template', 'textarea', 'mall/promotion/couponTemplate/index', 0, b'1', b'1', '', '2022-10-31 22:27:14', '1', '2022-11-05 12:27:34', b'0'); | |
| 1926 | +# 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 (2033, '优惠劵模板查询', 'promotion:coupon-template:query', 3, 1, 2032, '', '', '', 0, b'1', b'1', '', '2022-10-31 22:27:14', '', '2022-10-31 22:27:14', b'0'); | |
| 1927 | +# 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 (2034, '优惠劵模板创建', 'promotion:coupon-template:create', 3, 2, 2032, '', '', '', 0, b'1', b'1', '', '2022-10-31 22:27:14', '', '2022-10-31 22:27:14', b'0'); | |
| 1928 | +# 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 (2035, '优惠劵模板更新', 'promotion:coupon-template:update', 3, 3, 2032, '', '', '', 0, b'1', b'1', '', '2022-10-31 22:27:14', '', '2022-10-31 22:27:14', b'0'); | |
| 1929 | +# 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 (2036, '优惠劵模板删除', 'promotion:coupon-template:delete', 3, 4, 2032, '', '', '', 0, b'1', b'1', '', '2022-10-31 22:27:14', '', '2022-10-31 22:27:14', b'0'); | |
| 1930 | +# 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 (2038, '会员优惠劵', '', 2, 2, 2030, 'coupon', '', 'mall/promotion/coupon/index', 0, b'0', b'1', '', '2022-11-03 23:21:31', '1', '2022-11-05 12:27:45', b'0'); | |
| 1931 | +# 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 (2039, '优惠劵查询', 'promotion:coupon:query', 3, 1, 2038, '', '', '', 0, b'1', b'1', '', '2022-11-03 23:21:31', '', '2022-11-03 23:21:31', b'0'); | |
| 1932 | +# 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 (2040, '优惠劵删除', 'promotion:coupon:delete', 3, 4, 2038, '', '', '', 0, b'1', b'1', '', '2022-11-03 23:21:31', '', '2022-11-03 23:21:31', b'0'); | |
| 1933 | +# 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 (2041, '满减送活动', '', 2, 10, 2030, 'reward-activity', 'radio', 'mall/promotion/rewardActivity/index', 0, b'1', b'1', '', '2022-11-04 23:47:49', '1', '2022-11-05 12:27:56', b'0'); | |
| 1934 | +# 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 (2042, '满减送活动查询', 'promotion:reward-activity:query', 3, 1, 2041, '', '', '', 0, b'1', b'1', '', '2022-11-04 23:47:49', '', '2022-11-04 23:47:49', b'0'); | |
| 1935 | +# 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 (2043, '满减送活动创建', 'promotion:reward-activity:create', 3, 2, 2041, '', '', '', 0, b'1', b'1', '', '2022-11-04 23:47:49', '', '2022-11-04 23:47:49', b'0'); | |
| 1936 | +# 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 (2044, '满减送活动更新', 'promotion:reward-activity:update', 3, 3, 2041, '', '', '', 0, b'1', b'1', '', '2022-11-04 23:47:50', '', '2022-11-04 23:47:50', b'0'); | |
| 1937 | +# 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 (2045, '满减送活动删除', 'promotion:reward-activity:delete', 3, 4, 2041, '', '', '', 0, b'1', b'1', '', '2022-11-04 23:47:50', '', '2022-11-04 23:47:50', b'0'); | |
| 1938 | +# 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 (2046, '满减送活动关闭', 'promotion:reward-activity:close', 3, 5, 2041, '', '', '', 0, b'1', b'1', '1', '2022-11-05 10:42:53', '1', '2022-11-05 10:42:53', b'0'); | |
| 1939 | +# 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 (2047, '限时折扣活动', '', 2, 7, 2030, 'discount-activity', 'time', 'mall/promotion/discountActivity/index', 0, b'1', b'1', '', '2022-11-05 17:12:15', '1', '2022-11-29 22:14:56', b'0'); | |
| 1940 | +# 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 (2048, '限时折扣活动查询', 'promotion:discount-activity:query', 3, 1, 2047, '', '', '', 0, b'1', b'1', '', '2022-11-05 17:12:15', '', '2022-11-05 17:12:15', b'0'); | |
| 1941 | +# 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 (2049, '限时折扣活动创建', 'promotion:discount-activity:create', 3, 2, 2047, '', '', '', 0, b'1', b'1', '', '2022-11-05 17:12:15', '', '2022-11-05 17:12:15', b'0'); | |
| 1942 | +# 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 (2050, '限时折扣活动更新', 'promotion:discount-activity:update', 3, 3, 2047, '', '', '', 0, b'1', b'1', '', '2022-11-05 17:12:16', '', '2022-11-05 17:12:16', b'0'); | |
| 1943 | +# 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 (2051, '限时折扣活动删除', 'promotion:discount-activity:delete', 3, 4, 2047, '', '', '', 0, b'1', b'1', '', '2022-11-05 17:12:16', '', '2022-11-05 17:12:16', b'0'); | |
| 1944 | +# 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 (2052, '限时折扣活动关闭', 'promotion:discount-activity:close', 3, 5, 2047, '', '', '', 0, b'1', b'1', '', '2022-11-05 17:12:16', '', '2022-11-05 17:12:16', b'0'); | |
| 1945 | +# 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 (2059, '秒杀活动管理', '', 2, 0, 2030, 'seckill-activity', 'time-range', 'mall/promotion/seckill/seckillActivity/index', 0, b'1', b'1', '', '2022-11-06 22:24:49', '1', '2022-11-29 22:24:39', b'0'); | |
| 1946 | +# 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 (2060, '秒杀活动查询', 'promotion:seckill-activity:query', 3, 1, 2059, '', '', '', 0, b'1', b'1', '', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0'); | |
| 1947 | +# 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 (2061, '秒杀活动创建', 'promotion:seckill-activity:create', 3, 2, 2059, '', '', '', 0, b'1', b'1', '', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0'); | |
| 1948 | +# 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 (2062, '秒杀活动更新', 'promotion:seckill-activity:update', 3, 3, 2059, '', '', '', 0, b'1', b'1', '', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0'); | |
| 1949 | +# 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 (2063, '秒杀活动删除', 'promotion:seckill-activity:delete', 3, 4, 2059, '', '', '', 0, b'1', b'1', '', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0'); | |
| 1950 | +# 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 (2064, '秒杀活动导出', 'promotion:seckill-activity:export', 3, 5, 2059, '', '', '', 0, b'1', b'1', '', '2022-11-06 22:24:49', '', '2022-11-06 22:24:49', b'0'); | |
| 1951 | +# 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 (2066, '秒杀时段管理', '', 2, 0, 2030, 'seckill-time', '', 'mall/promotion/seckill/seckillTime/index', 0, b'0', b'1', '', '2022-11-15 19:46:50', '1', '2022-11-29 22:09:03', b'0'); | |
| 1952 | +# 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 (2067, '秒杀时段查询', 'promotion:seckill-time:query', 3, 1, 2066, '', '', '', 0, b'1', b'1', '', '2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0'); | |
| 1953 | +# 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 (2068, '秒杀时段创建', 'promotion:seckill-time:create', 3, 2, 2066, '', '', '', 0, b'1', b'1', '', '2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0'); | |
| 1954 | +# 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 (2069, '秒杀时段更新', 'promotion:seckill-time:update', 3, 3, 2066, '', '', '', 0, b'1', b'1', '', '2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0'); | |
| 1955 | +# 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 (2070, '秒杀时段删除', 'promotion:seckill-time:delete', 3, 4, 2066, '', '', '', 0, b'1', b'1', '', '2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0'); | |
| 1956 | +# 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 (2071, '秒杀时段导出', 'promotion:seckill-time:export', 3, 5, 2066, '', '', '', 0, b'1', b'1', '', '2022-11-15 19:46:51', '', '2022-11-15 19:46:51', b'0'); | |
| 1957 | +# 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 (2072, '订单中心', '', 1, 65, 0, '/trade', 'order', NULL, 0, b'1', b'1', '1', '2022-11-19 18:57:19', '1', '2022-12-10 16:32:57', b'0'); | |
| 1958 | +# 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 (2073, '售后退款', '', 2, 1, 2072, 'trade/after-sale', 'education', 'mall/trade/afterSale/index', 0, b'1', b'1', '', '2022-11-19 20:15:32', '1', '2022-12-10 21:11:02', b'0'); | |
| 1959 | +# 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 (2074, '售后查询', 'trade:after-sale:query', 3, 1, 2073, '', '', '', 0, b'1', b'1', '', '2022-11-19 20:15:33', '1', '2022-12-10 21:04:29', b'0'); | |
| 1960 | +# 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 (2075, '秒杀活动关闭', 'promotion:sekill-activity:close', 3, 6, 2059, '', '', '', 0, b'1', b'1', '1', '2022-11-28 20:20:15', '1', '2022-11-28 20:20:15', b'0'); | |
| 1961 | +# 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 (2076, '订单列表', '', 2, 0, 2072, 'trade/order', 'list', 'mall/trade/order/index', 0, b'1', b'1', '1', '2022-12-10 21:05:44', '1', '2022-12-10 21:08:44', b'0'); | |
| 1962 | +# 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 (2077, '物流公司管理管理', '', 2, 0, 2072, 'express-company', '', 'mall/trade/expressCompany/index', 0, b'1', b'1', '', '2022-12-20 23:27:55', '1', '2022-12-20 23:36:20', b'0'); | |
| 1963 | +# 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 (2078, '物流公司管理查询', 'trade:express-company:query', 3, 1, 2077, '', '', '', 0, b'1', b'1', '', '2022-12-20 23:27:55', '', '2022-12-20 23:27:55', b'0'); | |
| 1964 | +# 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 (2079, '物流公司管理创建', 'trade:express-company:create', 3, 2, 2077, '', '', '', 0, b'1', b'1', '', '2022-12-20 23:27:55', '', '2022-12-20 23:27:55', b'0'); | |
| 1965 | +# 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 (2080, '物流公司管理更新', 'trade:express-company:update', 3, 3, 2077, '', '', '', 0, b'1', b'1', '', '2022-12-20 23:27:55', '', '2022-12-20 23:27:55', b'0'); | |
| 1966 | +# 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 (2081, '物流公司管理删除', 'trade:express-company:delete', 3, 4, 2077, '', '', '', 0, b'1', b'1', '', '2022-12-20 23:27:55', '', '2022-12-20 23:27:55', b'0'); | |
| 1967 | +# 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 (2082, '物流公司管理导出', 'trade:express-company:export', 3, 5, 2077, '', '', '', 0, b'1', b'1', '', '2022-12-20 23:27:55', '', '2022-12-20 23:27:55', b'0'); | |
| 1864 | 1968 | 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 (2083, '地区管理', '', 2, 14, 1, 'area', 'row', 'system/area/index', 0, b'1', b'1', '1', '2022-12-23 17:35:05', '1', '2022-12-23 17:35:48', b'0'); |
| 1865 | 1969 | 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 (2084, '公众号管理', '', 1, 100, 0, '/mp', 'wechat', NULL, 0, b'1', b'1', '1', '2023-01-01 20:11:04', '1', '2023-01-15 11:28:57', b'0'); |
| 1866 | 1970 | 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 (2085, '账号管理', 'mp:account:query', 2, 1, 2084, 'account', 'phone', 'mp/account/index', 0, b'1', b'1', '1', '2023-01-01 20:13:31', '1', '2023-01-01 20:14:39', b'0'); |
| ... | ... | @@ -1877,7 +1981,7 @@ INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_i |
| 1877 | 1981 | 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 (2096, '修改标签', 'mp:tag:update', 3, 2, 2093, '', '', '', 0, b'1', b'1', '1', '2023-01-08 11:59:41', '1', '2023-01-08 11:59:41', b'0'); |
| 1878 | 1982 | 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 (2097, '删除标签', 'mp:tag:delete', 3, 3, 2093, '', '', '', 0, b'1', b'1', '1', '2023-01-08 12:00:04', '1', '2023-01-08 12:00:13', b'0'); |
| 1879 | 1983 | 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 (2098, '同步标签', 'mp:tag:sync', 3, 4, 2093, '', '', '', 0, b'1', b'1', '1', '2023-01-08 12:00:29', '1', '2023-01-08 12:00:29', b'0'); |
| 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 (2099, '粉丝管理', '', 2, 4, 2084, 'user', 'people', 'mp/user/index', 0, b'1', b'1', '1', '2023-01-08 16:51:20', '1', '2023-01-08 16:56:19', b'0'); | |
| 1984 | +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 (2099, '粉丝管理', '', 2, 4, 2084, 'mpuser', 'people', 'mp/mpuser/index', 0, b'1', b'1', '1', '2023-01-08 16:51:20', '1', '2023-01-08 16:56:19', b'0'); | |
| 1881 | 1985 | 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 (2100, '查询粉丝', 'mp:user:query', 3, 0, 2099, '', '', '', 0, b'1', b'1', '1', '2023-01-08 17:16:59', '1', '2023-01-08 17:17:23', b'0'); |
| 1882 | 1986 | 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 (2101, '修改粉丝', 'mp:user:update', 3, 1, 2099, '', '', '', 0, b'1', b'1', '1', '2023-01-08 17:17:11', '1', '2023-01-08 17:17:11', b'0'); |
| 1883 | 1987 | 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 (2102, '同步粉丝', 'mp:user:sync', 3, 2, 2099, '', '', '', 0, b'1', b'1', '1', '2023-01-08 17:17:40', '1', '2023-01-08 17:17:40', 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,9 +14,9 @@ |
| 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 | - <spring.boot.version>2.7.7</spring.boot.version> | |
| 19 | + <spring.boot.version>2.7.8</spring.boot.version> | |
| 20 | 20 | <!-- Web 相关 --> |
| 21 | 21 | <knife4j.version>4.0.0</knife4j.version> |
| 22 | 22 | <swagger-annotations.version>1.6.8</swagger-annotations.version> |
| ... | ... | @@ -41,12 +41,12 @@ |
| 41 | 41 | <!-- Bpm 工作流相关 --> |
| 42 | 42 | <flowable.version>6.8.0</flowable.version> |
| 43 | 43 | <!-- 工具类相关 --> |
| 44 | - <captcha-plus.version>1.0.1</captcha-plus.version> | |
| 44 | + <captcha-plus.version>1.0.2</captcha-plus.version> | |
| 45 | 45 | <jsoup.version>1.15.3</jsoup.version> |
| 46 | 46 | <lombok.version>1.18.24</lombok.version> |
| 47 | 47 | <mapstruct.version>1.5.3.Final</mapstruct.version> |
| 48 | 48 | <hutool.version>5.8.11</hutool.version> |
| 49 | - <easyexcel.verion>3.1.5</easyexcel.verion> | |
| 49 | + <easyexcel.verion>3.2.0</easyexcel.verion> | |
| 50 | 50 | <velocity.version>2.3</velocity.version> |
| 51 | 51 | <screw.version>1.0.5</screw.version> |
| 52 | 52 | <fastjson.version>1.2.83</fastjson.version> | ... | ... |
yudao-example/yudao-sso-demo-by-code/pom.xml
| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 | <maven.compiler.target>8</maven.compiler.target> |
| 22 | 22 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| 23 | 23 | <!-- 统一依赖管理 --> |
| 24 | - <spring.boot.version>2.7.7</spring.boot.version> | |
| 24 | + <spring.boot.version>2.7.8</spring.boot.version> | |
| 25 | 25 | </properties> |
| 26 | 26 | |
| 27 | 27 | <dependencyManagement> | ... | ... |
yudao-example/yudao-sso-demo-by-password/pom.xml
| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 | <maven.compiler.target>8</maven.compiler.target> |
| 22 | 22 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| 23 | 23 | <!-- 统一依赖管理 --> |
| 24 | - <spring.boot.version>2.7.7</spring.boot.version> | |
| 24 | + <spring.boot.version>2.7.8</spring.boot.version> | |
| 25 | 25 | </properties> |
| 26 | 26 | |
| 27 | 27 | <dependencyManagement> | ... | ... |
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-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-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-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 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/notify/vo/template/NotifyTemplateUpdateReqVO.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 | +import javax.validation.constraints.*; | |
| 6 | + | |
| 7 | +@ApiModel("管理后台 - 站内信模版更新 Request VO") | |
| 8 | +@Data | |
| 9 | +@EqualsAndHashCode(callSuper = true) | |
| 10 | +@ToString(callSuper = true) | |
| 11 | +public class NotifyTemplateUpdateReqVO extends NotifyTemplateBaseVO { | |
| 12 | + | |
| 13 | + @ApiModelProperty(value = "ID", required = true, example = "1024") | |
| 14 | + @NotNull(message = "ID 不能为空") | |
| 15 | + private Long id; | |
| 16 | + | |
| 17 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/mail/MailAccountConvert.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.convert.mail; | |
| 2 | + | |
| 3 | +import cn.hutool.core.util.StrUtil; | |
| 4 | +import cn.hutool.extra.mail.MailAccount; | |
| 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.dal.dataobject.mail.MailAccountDO; | |
| 8 | +import org.mapstruct.Mapper; | |
| 9 | +import org.mapstruct.factory.Mappers; | |
| 10 | + | |
| 11 | +import java.util.List; | |
| 12 | + | |
| 13 | +@Mapper | |
| 14 | +public interface MailAccountConvert { | |
| 15 | + | |
| 16 | + MailAccountConvert INSTANCE = Mappers.getMapper(MailAccountConvert.class); | |
| 17 | + | |
| 18 | + MailAccountDO convert(MailAccountCreateReqVO bean); | |
| 19 | + | |
| 20 | + MailAccountDO convert(MailAccountUpdateReqVO bean); | |
| 21 | + | |
| 22 | + MailAccountRespVO convert(MailAccountDO bean); | |
| 23 | + | |
| 24 | + PageResult<MailAccountBaseVO> convertPage(PageResult<MailAccountDO> pageResult); | |
| 25 | + | |
| 26 | + List<MailAccountSimpleRespVO> convertList02(List<MailAccountDO> list); | |
| 27 | + | |
| 28 | + default MailAccount convert(MailAccountDO account, String nickname) { | |
| 29 | + String from = StrUtil.isNotEmpty(nickname) ? nickname + " <" + account.getMail() + ">" : account.getMail(); | |
| 30 | + return new MailAccount().setFrom(from).setAuth(true) | |
| 31 | + .setUser(account.getUsername()).setPass(account.getPassword()) | |
| 32 | + .setHost(account.getHost()).setPort(account.getPort()).setSslEnable(account.getSslEnable()); | |
| 33 | + } | |
| 34 | + | |
| 35 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/mail/MailLogConvert.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.convert.mail; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.log.MailLogRespVO; | |
| 5 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailLogDO; | |
| 6 | +import org.mapstruct.Mapper; | |
| 7 | +import org.mapstruct.factory.Mappers; | |
| 8 | + | |
| 9 | +@Mapper | |
| 10 | +public interface MailLogConvert { | |
| 11 | + | |
| 12 | + MailLogConvert INSTANCE = Mappers.getMapper(MailLogConvert.class); | |
| 13 | + | |
| 14 | + PageResult<MailLogRespVO> convertPage(PageResult<MailLogDO> pageResult); | |
| 15 | + | |
| 16 | + MailLogRespVO convert(MailLogDO bean); | |
| 17 | + | |
| 18 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/mail/MailTemplateConvert.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.convert.mail; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.template.*; | |
| 5 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO; | |
| 6 | +import org.mapstruct.Mapper; | |
| 7 | +import org.mapstruct.factory.Mappers; | |
| 8 | + | |
| 9 | +import java.util.List; | |
| 10 | + | |
| 11 | +@Mapper | |
| 12 | +public interface MailTemplateConvert { | |
| 13 | + | |
| 14 | + MailTemplateConvert INSTANCE = Mappers.getMapper(MailTemplateConvert.class); | |
| 15 | + | |
| 16 | + MailTemplateDO convert(MailTemplateUpdateReqVO bean); | |
| 17 | + | |
| 18 | + MailTemplateDO convert(MailTemplateCreateReqVO bean); | |
| 19 | + | |
| 20 | + MailTemplateRespVO convert(MailTemplateDO bean); | |
| 21 | + | |
| 22 | + PageResult<MailTemplateRespVO> convertPage(PageResult<MailTemplateDO> pageResult); | |
| 23 | + | |
| 24 | + List<MailTemplateSimpleRespVO> convertList02(List<MailTemplateDO> list); | |
| 25 | + | |
| 26 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/notify/NotifyMessageConvert.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.convert.notify; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.system.controller.admin.notify.vo.message.NotifyMessageRespVO; | |
| 5 | +import cn.iocoder.yudao.module.system.dal.dataobject.notify.NotifyMessageDO; | |
| 6 | +import org.mapstruct.Mapper; | |
| 7 | +import org.mapstruct.factory.Mappers; | |
| 8 | + | |
| 9 | +import java.util.List; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * 站内信 Convert | |
| 13 | + * | |
| 14 | + * @author xrcoder | |
| 15 | + */ | |
| 16 | +@Mapper | |
| 17 | +public interface NotifyMessageConvert { | |
| 18 | + | |
| 19 | + NotifyMessageConvert INSTANCE = Mappers.getMapper(NotifyMessageConvert.class); | |
| 20 | + | |
| 21 | + NotifyMessageRespVO convert(NotifyMessageDO bean); | |
| 22 | + | |
| 23 | + List<NotifyMessageRespVO> convertList(List<NotifyMessageDO> list); | |
| 24 | + | |
| 25 | + PageResult<NotifyMessageRespVO> convertPage(PageResult<NotifyMessageDO> page); | |
| 26 | + | |
| 27 | + | |
| 28 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/convert/notify/NotifyTemplateConvert.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.convert.notify; | |
| 2 | + | |
| 3 | +import java.util.*; | |
| 4 | + | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | + | |
| 7 | +import cn.iocoder.yudao.module.system.controller.admin.notify.vo.template.NotifyTemplateCreateReqVO; | |
| 8 | +import cn.iocoder.yudao.module.system.controller.admin.notify.vo.template.NotifyTemplateRespVO; | |
| 9 | +import cn.iocoder.yudao.module.system.controller.admin.notify.vo.template.NotifyTemplateUpdateReqVO; | |
| 10 | +import org.mapstruct.Mapper; | |
| 11 | +import org.mapstruct.factory.Mappers; | |
| 12 | +import cn.iocoder.yudao.module.system.dal.dataobject.notify.NotifyTemplateDO; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * 站内信模版 Convert | |
| 16 | + * | |
| 17 | + * @author xrcoder | |
| 18 | + */ | |
| 19 | +@Mapper | |
| 20 | +public interface NotifyTemplateConvert { | |
| 21 | + | |
| 22 | + NotifyTemplateConvert INSTANCE = Mappers.getMapper(NotifyTemplateConvert.class); | |
| 23 | + | |
| 24 | + NotifyTemplateDO convert(NotifyTemplateCreateReqVO bean); | |
| 25 | + | |
| 26 | + NotifyTemplateDO convert(NotifyTemplateUpdateReqVO bean); | |
| 27 | + | |
| 28 | + NotifyTemplateRespVO convert(NotifyTemplateDO bean); | |
| 29 | + | |
| 30 | + List<NotifyTemplateRespVO> convertList(List<NotifyTemplateDO> list); | |
| 31 | + | |
| 32 | + PageResult<NotifyTemplateRespVO> convertPage(PageResult<NotifyTemplateDO> page); | |
| 33 | + | |
| 34 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/mail/MailAccountDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.dal.dataobject.mail; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | |
| 4 | +import com.baomidou.mybatisplus.annotation.TableId; | |
| 5 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 6 | +import lombok.Data; | |
| 7 | +import lombok.EqualsAndHashCode; | |
| 8 | + | |
| 9 | +/** | |
| 10 | + * 邮箱账号 DO | |
| 11 | + * | |
| 12 | + * 用途:配置发送邮箱的账号 | |
| 13 | + * | |
| 14 | + * @author wangjingyi | |
| 15 | + * @since 2022-03-21 | |
| 16 | + */ | |
| 17 | +@TableName(value = "system_mail_account", autoResultMap = true) | |
| 18 | +@Data | |
| 19 | +@EqualsAndHashCode(callSuper = true) | |
| 20 | +public class MailAccountDO extends BaseDO { | |
| 21 | + | |
| 22 | + /** | |
| 23 | + * 主键 | |
| 24 | + */ | |
| 25 | + @TableId | |
| 26 | + private Long id; | |
| 27 | + /** | |
| 28 | + * 邮箱 | |
| 29 | + */ | |
| 30 | + private String mail; | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * 用户名 | |
| 34 | + */ | |
| 35 | + private String username; | |
| 36 | + /** | |
| 37 | + * 密码 | |
| 38 | + */ | |
| 39 | + private String password; | |
| 40 | + /** | |
| 41 | + * SMTP 服务器域名 | |
| 42 | + */ | |
| 43 | + private String host; | |
| 44 | + /** | |
| 45 | + * SMTP 服务器端口 | |
| 46 | + */ | |
| 47 | + private Integer port; | |
| 48 | + /** | |
| 49 | + * 是否开启 SSL | |
| 50 | + */ | |
| 51 | + private Boolean sslEnable; | |
| 52 | + | |
| 53 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/mail/MailLogDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.dal.dataobject.mail; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | |
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | |
| 5 | +import cn.iocoder.yudao.module.system.enums.mail.MailSendStatusEnum; | |
| 6 | +import com.baomidou.mybatisplus.annotation.TableField; | |
| 7 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 8 | +import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; | |
| 9 | +import lombok.*; | |
| 10 | + | |
| 11 | +import java.io.Serializable; | |
| 12 | +import java.util.Date; | |
| 13 | +import java.util.Map; | |
| 14 | + | |
| 15 | +/** | |
| 16 | + * 邮箱日志 DO | |
| 17 | + * 记录每一次邮件的发送 | |
| 18 | + * | |
| 19 | + * @author wangjingyi | |
| 20 | + * @since 2022-03-21 | |
| 21 | + */ | |
| 22 | +@TableName(value = "system_mail_log", autoResultMap = true) | |
| 23 | +@Data | |
| 24 | +@EqualsAndHashCode(callSuper = true) | |
| 25 | +@ToString(callSuper = true) | |
| 26 | +@Builder | |
| 27 | +@AllArgsConstructor | |
| 28 | +@NoArgsConstructor | |
| 29 | +public class MailLogDO extends BaseDO implements Serializable { | |
| 30 | + | |
| 31 | + /** | |
| 32 | + * 日志编号,自增 | |
| 33 | + */ | |
| 34 | + private Long id; | |
| 35 | + | |
| 36 | + /** | |
| 37 | + * 用户编码 | |
| 38 | + */ | |
| 39 | + private Long userId; | |
| 40 | + /** | |
| 41 | + * 用户类型 | |
| 42 | + * | |
| 43 | + * 枚举 {@link UserTypeEnum} | |
| 44 | + */ | |
| 45 | + private Integer userType; | |
| 46 | + /** | |
| 47 | + * 接收邮箱地址 | |
| 48 | + */ | |
| 49 | + private String toMail; | |
| 50 | + | |
| 51 | + /** | |
| 52 | + * 邮箱账号编号 | |
| 53 | + * | |
| 54 | + * 关联 {@link MailAccountDO#getId()} | |
| 55 | + */ | |
| 56 | + private Long accountId; | |
| 57 | + /** | |
| 58 | + * 发送邮箱地址 | |
| 59 | + * | |
| 60 | + * 冗余 {@link MailAccountDO#getMail()} | |
| 61 | + */ | |
| 62 | + private String fromMail; | |
| 63 | + | |
| 64 | + // ========= 模板相关字段 ========= | |
| 65 | + /** | |
| 66 | + * 模版编号 | |
| 67 | + * | |
| 68 | + * 关联 {@link MailTemplateDO#getId()} | |
| 69 | + */ | |
| 70 | + private Long templateId; | |
| 71 | + /** | |
| 72 | + * 模版编码 | |
| 73 | + * | |
| 74 | + * 冗余 {@link MailTemplateDO#getCode()} | |
| 75 | + */ | |
| 76 | + private String templateCode; | |
| 77 | + /** | |
| 78 | + * 模版发送人名称 | |
| 79 | + * | |
| 80 | + * 冗余 {@link MailTemplateDO#getNickname()} | |
| 81 | + */ | |
| 82 | + private String templateNickname; | |
| 83 | + /** | |
| 84 | + * 模版标题 | |
| 85 | + */ | |
| 86 | + private String templateTitle; | |
| 87 | + /** | |
| 88 | + * 模版内容 | |
| 89 | + * | |
| 90 | + * 基于 {@link MailTemplateDO#getContent()} 格式化后的内容 | |
| 91 | + */ | |
| 92 | + private String templateContent; | |
| 93 | + /** | |
| 94 | + * 模版参数 | |
| 95 | + * | |
| 96 | + * 基于 {@link MailTemplateDO#getParams()} 输入后的参数 | |
| 97 | + */ | |
| 98 | + @TableField(typeHandler = JacksonTypeHandler.class) | |
| 99 | + private Map<String, Object> templateParams; | |
| 100 | + | |
| 101 | + // ========= 发送相关字段 ========= | |
| 102 | + /** | |
| 103 | + * 发送状态 | |
| 104 | + * | |
| 105 | + * 枚举 {@link MailSendStatusEnum} | |
| 106 | + */ | |
| 107 | + private Integer sendStatus; | |
| 108 | + /** | |
| 109 | + * 发送时间 | |
| 110 | + */ | |
| 111 | + private Date sendTime; | |
| 112 | + /** | |
| 113 | + * 发送返回的消息 ID | |
| 114 | + */ | |
| 115 | + private String sendMessageId; | |
| 116 | + /** | |
| 117 | + * 发送异常 | |
| 118 | + */ | |
| 119 | + private String sendException; | |
| 120 | + | |
| 121 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/mail/MailTemplateDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.dal.dataobject.mail; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | |
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | |
| 5 | +import com.baomidou.mybatisplus.annotation.TableField; | |
| 6 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 7 | +import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; | |
| 8 | +import lombok.Data; | |
| 9 | +import lombok.EqualsAndHashCode; | |
| 10 | + | |
| 11 | +import java.util.List; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 邮件模版 DO | |
| 15 | + * | |
| 16 | + * @author wangjingyi | |
| 17 | + * @since 2022-03-21 | |
| 18 | + */ | |
| 19 | +@TableName(value = "system_mail_template", autoResultMap = true) | |
| 20 | +@Data | |
| 21 | +@EqualsAndHashCode(callSuper = true) | |
| 22 | +public class MailTemplateDO extends BaseDO { | |
| 23 | + | |
| 24 | + /** | |
| 25 | + * 主键 | |
| 26 | + */ | |
| 27 | + private Long id; | |
| 28 | + /** | |
| 29 | + * 模版名称 | |
| 30 | + */ | |
| 31 | + private String name; | |
| 32 | + /** | |
| 33 | + * 模版编号 | |
| 34 | + */ | |
| 35 | + private String code; | |
| 36 | + /** | |
| 37 | + * 发送的邮箱账号编号 | |
| 38 | + * | |
| 39 | + * 关联 {@link MailAccountDO#getId()} | |
| 40 | + */ | |
| 41 | + private Long accountId; | |
| 42 | + | |
| 43 | + /** | |
| 44 | + * 发送人名称 | |
| 45 | + */ | |
| 46 | + private String nickname; | |
| 47 | + /** | |
| 48 | + * 标题 | |
| 49 | + */ | |
| 50 | + private String title; | |
| 51 | + /** | |
| 52 | + * 内容 | |
| 53 | + */ | |
| 54 | + private String content; | |
| 55 | + /** | |
| 56 | + * 参数数组(自动根据内容生成) | |
| 57 | + */ | |
| 58 | + @TableField(typeHandler = JacksonTypeHandler.class) | |
| 59 | + private List<String> params; | |
| 60 | + /** | |
| 61 | + * 状态 | |
| 62 | + * | |
| 63 | + * 枚举 {@link CommonStatusEnum} | |
| 64 | + */ | |
| 65 | + private Integer status; | |
| 66 | + /** | |
| 67 | + * 备注 | |
| 68 | + */ | |
| 69 | + private String remark; | |
| 70 | + | |
| 71 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/notify/NotifyMessageDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.dal.dataobject.notify; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | |
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | |
| 5 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO; | |
| 6 | +import com.baomidou.mybatisplus.annotation.KeySequence; | |
| 7 | +import com.baomidou.mybatisplus.annotation.TableField; | |
| 8 | +import com.baomidou.mybatisplus.annotation.TableId; | |
| 9 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 10 | +import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; | |
| 11 | +import lombok.*; | |
| 12 | + | |
| 13 | +import java.time.LocalDateTime; | |
| 14 | +import java.util.Date; | |
| 15 | +import java.util.Map; | |
| 16 | + | |
| 17 | +/** | |
| 18 | + * 站内信 DO | |
| 19 | + * | |
| 20 | + * @author xrcoder | |
| 21 | + */ | |
| 22 | +@TableName(value = "system_notify_message", autoResultMap = true) | |
| 23 | +@KeySequence("system_notify_message_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | |
| 24 | +@Data | |
| 25 | +@EqualsAndHashCode(callSuper = true) | |
| 26 | +@ToString(callSuper = true) | |
| 27 | +@Builder | |
| 28 | +@NoArgsConstructor | |
| 29 | +@AllArgsConstructor | |
| 30 | +public class NotifyMessageDO extends BaseDO { | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * 站内信编号,自增 | |
| 34 | + */ | |
| 35 | + @TableId | |
| 36 | + private Long id; | |
| 37 | + /** | |
| 38 | + * 用户编号 | |
| 39 | + * | |
| 40 | + * 关联 MemberUserDO 的 id 字段、或者 AdminUserDO 的 id 字段 | |
| 41 | + */ | |
| 42 | + private Long userId; | |
| 43 | + /** | |
| 44 | + * 用户类型 | |
| 45 | + * | |
| 46 | + * 枚举 {@link UserTypeEnum} | |
| 47 | + */ | |
| 48 | + private Integer userType; | |
| 49 | + | |
| 50 | + // ========= 模板相关字段 ========= | |
| 51 | + | |
| 52 | + /** | |
| 53 | + * 模版编号 | |
| 54 | + * | |
| 55 | + * 关联 {@link NotifyTemplateDO#getId()} | |
| 56 | + */ | |
| 57 | + private Long templateId; | |
| 58 | + /** | |
| 59 | + * 模版编码 | |
| 60 | + * | |
| 61 | + * 关联 {@link NotifyTemplateDO#getCode()} | |
| 62 | + */ | |
| 63 | + private String templateCode; | |
| 64 | + /** | |
| 65 | + * 模版类型 | |
| 66 | + * | |
| 67 | + * 冗余 {@link NotifyTemplateDO#getType()} | |
| 68 | + */ | |
| 69 | + private Integer templateType; | |
| 70 | + /** | |
| 71 | + * 模版发送人名称 | |
| 72 | + * | |
| 73 | + * 冗余 {@link NotifyTemplateDO#getNickname()} | |
| 74 | + */ | |
| 75 | + private String templateNickname; | |
| 76 | + /** | |
| 77 | + * 模版内容 | |
| 78 | + * | |
| 79 | + * 基于 {@link NotifyTemplateDO#getContent()} 格式化后的内容 | |
| 80 | + */ | |
| 81 | + private String templateContent; | |
| 82 | + /** | |
| 83 | + * 模版参数 | |
| 84 | + * | |
| 85 | + * 基于 {@link NotifyTemplateDO#getParams()} 输入后的参数 | |
| 86 | + */ | |
| 87 | + @TableField(typeHandler = JacksonTypeHandler.class) | |
| 88 | + private Map<String, Object> templateParams; | |
| 89 | + | |
| 90 | + // ========= 读取相关字段 ========= | |
| 91 | + | |
| 92 | + /** | |
| 93 | + * 是否已读 | |
| 94 | + */ | |
| 95 | + private Boolean readStatus; | |
| 96 | + /** | |
| 97 | + * 阅读时间 | |
| 98 | + */ | |
| 99 | + private LocalDateTime readTime; | |
| 100 | + | |
| 101 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/dataobject/notify/NotifyTemplateDO.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.dal.dataobject.notify; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | |
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | |
| 5 | +import com.baomidou.mybatisplus.annotation.KeySequence; | |
| 6 | +import com.baomidou.mybatisplus.annotation.TableField; | |
| 7 | +import com.baomidou.mybatisplus.annotation.TableId; | |
| 8 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 9 | +import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; | |
| 10 | +import lombok.*; | |
| 11 | + | |
| 12 | +import java.util.List; | |
| 13 | + | |
| 14 | +/** | |
| 15 | + * 站内信模版 DO | |
| 16 | + * | |
| 17 | + * @author xrcoder | |
| 18 | + */ | |
| 19 | +@TableName(value = "system_notify_template", autoResultMap = true) | |
| 20 | +@KeySequence("system_notify_template_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 | |
| 21 | +@Data | |
| 22 | +@EqualsAndHashCode(callSuper = true) | |
| 23 | +@ToString(callSuper = true) | |
| 24 | +@Builder | |
| 25 | +@NoArgsConstructor | |
| 26 | +@AllArgsConstructor | |
| 27 | +public class NotifyTemplateDO extends BaseDO { | |
| 28 | + | |
| 29 | + /** | |
| 30 | + * ID | |
| 31 | + */ | |
| 32 | + @TableId | |
| 33 | + private Long id; | |
| 34 | + /** | |
| 35 | + * 模版名称 | |
| 36 | + */ | |
| 37 | + private String name; | |
| 38 | + /** | |
| 39 | + * 模版编码 | |
| 40 | + */ | |
| 41 | + private String code; | |
| 42 | + /** | |
| 43 | + * 模版类型 | |
| 44 | + * | |
| 45 | + * 对应 system_notify_template_type 字典 | |
| 46 | + */ | |
| 47 | + private Integer type; | |
| 48 | + /** | |
| 49 | + * 发送人名称 | |
| 50 | + */ | |
| 51 | + private String nickname; | |
| 52 | + /** | |
| 53 | + * 模版内容 | |
| 54 | + */ | |
| 55 | + private String content; | |
| 56 | + /** | |
| 57 | + * 参数数组 | |
| 58 | + */ | |
| 59 | + @TableField(typeHandler = JacksonTypeHandler.class) | |
| 60 | + private List<String> params; | |
| 61 | + /** | |
| 62 | + * 状态 | |
| 63 | + * | |
| 64 | + * 枚举 {@link CommonStatusEnum} | |
| 65 | + */ | |
| 66 | + private Integer status; | |
| 67 | + /** | |
| 68 | + * 备注 | |
| 69 | + */ | |
| 70 | + private String remark; | |
| 71 | + | |
| 72 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/mail/MailAccountMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.dal.mysql.mail; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 5 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 6 | +import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; | |
| 7 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.MailAccountPageReqVO; | |
| 8 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailAccountDO; | |
| 9 | +import org.apache.ibatis.annotations.Mapper; | |
| 10 | + | |
| 11 | +@Mapper | |
| 12 | +public interface MailAccountMapper extends BaseMapperX<MailAccountDO> { | |
| 13 | + | |
| 14 | + default PageResult<MailAccountDO> selectPage(MailAccountPageReqVO pageReqVO) { | |
| 15 | + return selectPage(pageReqVO, new LambdaQueryWrapperX<MailAccountDO>() | |
| 16 | + .likeIfPresent(MailAccountDO::getMail, pageReqVO.getMail()) | |
| 17 | + .likeIfPresent(MailAccountDO::getUsername , pageReqVO.getUsername())); | |
| 18 | + } | |
| 19 | + | |
| 20 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/mail/MailLogMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.dal.mysql.mail; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 5 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 6 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.log.MailLogPageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailLogDO; | |
| 8 | +import org.apache.ibatis.annotations.Mapper; | |
| 9 | + | |
| 10 | +@Mapper | |
| 11 | +public interface MailLogMapper extends BaseMapperX<MailLogDO> { | |
| 12 | + | |
| 13 | + default PageResult<MailLogDO> selectPage(MailLogPageReqVO reqVO) { | |
| 14 | + return selectPage(reqVO, new LambdaQueryWrapperX<MailLogDO>() | |
| 15 | + .eqIfPresent(MailLogDO::getUserId, reqVO.getUserId()) | |
| 16 | + .eqIfPresent(MailLogDO::getUserType, reqVO.getUserType()) | |
| 17 | + .likeIfPresent(MailLogDO::getToMail, reqVO.getToMail()) | |
| 18 | + .eqIfPresent(MailLogDO::getAccountId, reqVO.getAccountId()) | |
| 19 | + .eqIfPresent(MailLogDO::getTemplateId, reqVO.getTemplateId()) | |
| 20 | + .eqIfPresent(MailLogDO::getSendStatus, reqVO.getSendStatus()) | |
| 21 | + .betweenIfPresent(MailLogDO::getSendTime, reqVO.getSendTime()) | |
| 22 | + .orderByDesc(MailLogDO::getId)); | |
| 23 | + } | |
| 24 | + | |
| 25 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/mail/MailTemplateMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.dal.mysql.mail; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 5 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 6 | +import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; | |
| 7 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.template.MailTemplatePageReqVO; | |
| 8 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO; | |
| 9 | +import cn.iocoder.yudao.module.system.dal.dataobject.sms.SmsTemplateDO; | |
| 10 | +import org.apache.ibatis.annotations.Mapper; | |
| 11 | +import org.apache.ibatis.annotations.Select; | |
| 12 | + | |
| 13 | +import java.util.Date; | |
| 14 | + | |
| 15 | +@Mapper | |
| 16 | +public interface MailTemplateMapper extends BaseMapperX<MailTemplateDO> { | |
| 17 | + | |
| 18 | + default PageResult<MailTemplateDO> selectPage(MailTemplatePageReqVO pageReqVO){ | |
| 19 | + return selectPage(pageReqVO , new LambdaQueryWrapperX<MailTemplateDO>() | |
| 20 | + .eqIfPresent(MailTemplateDO::getStatus, pageReqVO.getStatus()) | |
| 21 | + .likeIfPresent(MailTemplateDO::getCode, pageReqVO.getCode()) | |
| 22 | + .likeIfPresent(MailTemplateDO::getName, pageReqVO.getName()) | |
| 23 | + .eqIfPresent(MailTemplateDO::getAccountId, pageReqVO.getAccountId()) | |
| 24 | + .betweenIfPresent(MailTemplateDO::getCreateTime, pageReqVO.getCreateTime())); | |
| 25 | + } | |
| 26 | + | |
| 27 | + default Long selectCountByAccountId(Long accountId) { | |
| 28 | + return selectCount(MailTemplateDO::getAccountId, accountId); | |
| 29 | + } | |
| 30 | + | |
| 31 | + default MailTemplateDO selectByCode(String code) { | |
| 32 | + return selectOne(MailTemplateDO::getCode, code); | |
| 33 | + } | |
| 34 | + | |
| 35 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/notify/NotifyMessageMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.dal.mysql.notify; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 5 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 6 | +import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; | |
| 7 | +import cn.iocoder.yudao.module.system.controller.admin.notify.vo.message.NotifyMessageMyPageReqVO; | |
| 8 | +import cn.iocoder.yudao.module.system.controller.admin.notify.vo.message.NotifyMessagePageReqVO; | |
| 9 | +import cn.iocoder.yudao.module.system.dal.dataobject.notify.NotifyMessageDO; | |
| 10 | +import org.apache.ibatis.annotations.Mapper; | |
| 11 | + | |
| 12 | +import java.time.LocalDateTime; | |
| 13 | +import java.util.Collection; | |
| 14 | +import java.util.List; | |
| 15 | + | |
| 16 | +@Mapper | |
| 17 | +public interface NotifyMessageMapper extends BaseMapperX<NotifyMessageDO> { | |
| 18 | + | |
| 19 | + default PageResult<NotifyMessageDO> selectPage(NotifyMessagePageReqVO reqVO) { | |
| 20 | + return selectPage(reqVO, new LambdaQueryWrapperX<NotifyMessageDO>() | |
| 21 | + .eqIfPresent(NotifyMessageDO::getUserId, reqVO.getUserId()) | |
| 22 | + .eqIfPresent(NotifyMessageDO::getUserType, reqVO.getUserType()) | |
| 23 | + .likeIfPresent(NotifyMessageDO::getTemplateCode, reqVO.getTemplateCode()) | |
| 24 | + .eqIfPresent(NotifyMessageDO::getTemplateType, reqVO.getTemplateType()) | |
| 25 | + .betweenIfPresent(NotifyMessageDO::getCreateTime, reqVO.getCreateTime()) | |
| 26 | + .orderByDesc(NotifyMessageDO::getId)); | |
| 27 | + } | |
| 28 | + | |
| 29 | + default PageResult<NotifyMessageDO> selectPage(NotifyMessageMyPageReqVO reqVO, Long userId, Integer userType) { | |
| 30 | + return selectPage(reqVO, new LambdaQueryWrapperX<NotifyMessageDO>() | |
| 31 | + .eqIfPresent(NotifyMessageDO::getReadStatus, reqVO.getReadStatus()) | |
| 32 | + .betweenIfPresent(NotifyMessageDO::getCreateTime, reqVO.getCreateTime()) | |
| 33 | + .eq(NotifyMessageDO::getUserId, userId) | |
| 34 | + .eq(NotifyMessageDO::getUserType, userType) | |
| 35 | + .orderByDesc(NotifyMessageDO::getId)); | |
| 36 | + } | |
| 37 | + | |
| 38 | + default int updateListRead(Collection<Long> ids, Long userId, Integer userType) { | |
| 39 | + return update(new NotifyMessageDO().setReadStatus(true).setReadTime(LocalDateTime.now()), | |
| 40 | + new LambdaQueryWrapperX<NotifyMessageDO>() | |
| 41 | + .in(NotifyMessageDO::getId, ids) | |
| 42 | + .eq(NotifyMessageDO::getUserId, userId) | |
| 43 | + .eq(NotifyMessageDO::getUserType, userType) | |
| 44 | + .eq(NotifyMessageDO::getReadStatus, false)); | |
| 45 | + } | |
| 46 | + | |
| 47 | + default int updateListRead(Long userId, Integer userType) { | |
| 48 | + return update(new NotifyMessageDO().setReadStatus(true).setReadTime(LocalDateTime.now()), | |
| 49 | + new LambdaQueryWrapperX<NotifyMessageDO>() | |
| 50 | + .eq(NotifyMessageDO::getUserId, userId) | |
| 51 | + .eq(NotifyMessageDO::getUserType, userType) | |
| 52 | + .eq(NotifyMessageDO::getReadStatus, false)); | |
| 53 | + } | |
| 54 | + | |
| 55 | + default List<NotifyMessageDO> selectUnreadListByUserIdAndUserType(Long userId, Integer userType, Integer size) { | |
| 56 | + return selectList(new QueryWrapperX<NotifyMessageDO>() // 由于要使用 limitN 语句,所以只能用 QueryWrapperX | |
| 57 | + .eq("user_id", userId) | |
| 58 | + .eq("user_type", userType) | |
| 59 | + .eq("read_status", false) | |
| 60 | + .orderByDesc("id").limitN(size)); | |
| 61 | + } | |
| 62 | + | |
| 63 | + default Long selectUnreadCountByUserIdAndUserType(Long userId, Integer userType) { | |
| 64 | + return selectCount(new LambdaQueryWrapperX<NotifyMessageDO>() | |
| 65 | + .eq(NotifyMessageDO::getReadStatus, false) | |
| 66 | + .eq(NotifyMessageDO::getUserId, userId) | |
| 67 | + .eq(NotifyMessageDO::getUserType, userType)); | |
| 68 | + } | |
| 69 | + | |
| 70 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/notify/NotifyTemplateMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.dal.mysql.notify; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 5 | +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 6 | +import cn.iocoder.yudao.module.system.controller.admin.notify.vo.template.NotifyTemplatePageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.notify.NotifyTemplateDO; | |
| 8 | +import org.apache.ibatis.annotations.Mapper; | |
| 9 | + | |
| 10 | +@Mapper | |
| 11 | +public interface NotifyTemplateMapper extends BaseMapperX<NotifyTemplateDO> { | |
| 12 | + | |
| 13 | + default NotifyTemplateDO selectByCode(String code) { | |
| 14 | + return selectOne(NotifyTemplateDO::getCode, code); | |
| 15 | + } | |
| 16 | + | |
| 17 | + default PageResult<NotifyTemplateDO> selectPage(NotifyTemplatePageReqVO reqVO) { | |
| 18 | + return selectPage(reqVO, new LambdaQueryWrapperX<NotifyTemplateDO>() | |
| 19 | + .likeIfPresent(NotifyTemplateDO::getCode, reqVO.getCode()) | |
| 20 | + .likeIfPresent(NotifyTemplateDO::getName, reqVO.getName()) | |
| 21 | + .eqIfPresent(NotifyTemplateDO::getStatus, reqVO.getStatus()) | |
| 22 | + .betweenIfPresent(NotifyTemplateDO::getCreateTime, reqVO.getCreateTime()) | |
| 23 | + .orderByDesc(NotifyTemplateDO::getId)); | |
| 24 | + } | |
| 25 | + | |
| 26 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/mysql/sms/SmsCodeMapper.java
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/consumer/mail/MailAccountRefreshConsumer.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.mq.consumer.mail; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.mq.core.pubsub.AbstractChannelMessageListener; | |
| 4 | +import cn.iocoder.yudao.module.system.mq.message.mail.MailAccountRefreshMessage; | |
| 5 | +import cn.iocoder.yudao.module.system.mq.message.mail.MailTemplateRefreshMessage; | |
| 6 | +import cn.iocoder.yudao.module.system.service.mail.MailAccountService; | |
| 7 | +import cn.iocoder.yudao.module.system.service.mail.MailTemplateService; | |
| 8 | +import lombok.extern.slf4j.Slf4j; | |
| 9 | +import org.springframework.stereotype.Component; | |
| 10 | + | |
| 11 | +import javax.annotation.Resource; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 针对 {@link MailAccountRefreshMessage} 的消费者 | |
| 15 | + * | |
| 16 | + * @author wangjingyi | |
| 17 | + */ | |
| 18 | +@Component | |
| 19 | +@Slf4j | |
| 20 | +public class MailAccountRefreshConsumer extends AbstractChannelMessageListener<MailAccountRefreshMessage> { | |
| 21 | + | |
| 22 | + @Resource | |
| 23 | + private MailAccountService mailAccountService; | |
| 24 | + | |
| 25 | + @Override | |
| 26 | + public void onMessage(MailAccountRefreshMessage message) { | |
| 27 | + log.info("[onMessage][收到 Mail Account 刷新信息]"); | |
| 28 | + mailAccountService.initLocalCache(); | |
| 29 | + } | |
| 30 | + | |
| 31 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/consumer/mail/MailSendConsumer.java
| ... | ... | @@ -2,17 +2,29 @@ package cn.iocoder.yudao.module.system.mq.consumer.mail; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.mq.core.stream.AbstractStreamMessageListener; |
| 4 | 4 | import cn.iocoder.yudao.module.system.mq.message.mail.MailSendMessage; |
| 5 | +import cn.iocoder.yudao.module.system.mq.message.sms.SmsSendMessage; | |
| 6 | +import cn.iocoder.yudao.module.system.service.mail.MailSendService; | |
| 5 | 7 | import lombok.extern.slf4j.Slf4j; |
| 6 | 8 | import org.springframework.stereotype.Component; |
| 7 | 9 | |
| 8 | -// TODO 芋艿:这个暂未实现 | |
| 10 | +import javax.annotation.Resource; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 针对 {@link MailSendMessage} 的消费者 | |
| 14 | + * | |
| 15 | + * @author 芋道源码 | |
| 16 | + */ | |
| 9 | 17 | @Component |
| 10 | 18 | @Slf4j |
| 11 | 19 | public class MailSendConsumer extends AbstractStreamMessageListener<MailSendMessage> { |
| 12 | 20 | |
| 21 | + @Resource | |
| 22 | + private MailSendService mailSendService; | |
| 23 | + | |
| 13 | 24 | @Override |
| 14 | 25 | public void onMessage(MailSendMessage message) { |
| 15 | 26 | log.info("[onMessage][消息内容({})]", message); |
| 27 | + mailSendService.doSendMail(message); | |
| 16 | 28 | } |
| 17 | 29 | |
| 18 | 30 | } | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/consumer/mail/MailTemplateRefreshConsumer.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.mq.consumer.mail; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.mq.core.pubsub.AbstractChannelMessageListener; | |
| 4 | +import cn.iocoder.yudao.module.system.mq.message.mail.MailTemplateRefreshMessage; | |
| 5 | +import cn.iocoder.yudao.module.system.service.mail.MailTemplateService; | |
| 6 | +import lombok.extern.slf4j.Slf4j; | |
| 7 | +import org.springframework.stereotype.Component; | |
| 8 | + | |
| 9 | +import javax.annotation.Resource; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * 针对 {@link MailTemplateRefreshMessage} 的消费者 | |
| 13 | + * | |
| 14 | + * @author wangjingyi | |
| 15 | + */ | |
| 16 | +@Component | |
| 17 | +@Slf4j | |
| 18 | +public class MailTemplateRefreshConsumer extends AbstractChannelMessageListener<MailTemplateRefreshMessage> { | |
| 19 | + | |
| 20 | + @Resource | |
| 21 | + private MailTemplateService mailTemplateService; | |
| 22 | + | |
| 23 | + @Override | |
| 24 | + public void onMessage(MailTemplateRefreshMessage message) { | |
| 25 | + log.info("[onMessage][收到 Mail Template 刷新信息]"); | |
| 26 | + mailTemplateService.initLocalCache(); | |
| 27 | + } | |
| 28 | + | |
| 29 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/consumer/notify/NotifyTemplateRefreshConsumer.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.mq.consumer.notify; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.mq.core.pubsub.AbstractChannelMessageListener; | |
| 4 | +import cn.iocoder.yudao.module.system.mq.message.notify.NotifyTemplateRefreshMessage; | |
| 5 | +import cn.iocoder.yudao.module.system.service.notify.NotifyTemplateService; | |
| 6 | +import lombok.extern.slf4j.Slf4j; | |
| 7 | +import org.springframework.stereotype.Component; | |
| 8 | + | |
| 9 | +import javax.annotation.Resource; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * 针对 {@link NotifyTemplateRefreshMessage} 的消费者 | |
| 13 | + * | |
| 14 | + * @author xrcoder | |
| 15 | + */ | |
| 16 | +@Component | |
| 17 | +@Slf4j | |
| 18 | +public class NotifyTemplateRefreshConsumer extends AbstractChannelMessageListener<NotifyTemplateRefreshMessage> { | |
| 19 | + | |
| 20 | + @Resource | |
| 21 | + private NotifyTemplateService notifyTemplateService; | |
| 22 | + | |
| 23 | + @Override | |
| 24 | + public void onMessage(NotifyTemplateRefreshMessage message) { | |
| 25 | + log.info("[onMessage][收到 NotifyTemplate 刷新消息]"); | |
| 26 | + notifyTemplateService.initLocalCache(); | |
| 27 | + } | |
| 28 | + | |
| 29 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/message/mail/MailAccountRefreshMessage.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.mq.message.mail; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.mq.core.pubsub.AbstractChannelMessage; | |
| 4 | +import lombok.Data; | |
| 5 | +import lombok.EqualsAndHashCode; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * 邮箱账号的数据刷新 Message | |
| 9 | + * | |
| 10 | + * @author wangjingyi | |
| 11 | + */ | |
| 12 | +@Data | |
| 13 | +@EqualsAndHashCode(callSuper = true) | |
| 14 | +public class MailAccountRefreshMessage extends AbstractChannelMessage { | |
| 15 | + | |
| 16 | + @Override | |
| 17 | + public String getChannel() { | |
| 18 | + return "system.mail-account.refresh"; | |
| 19 | + } | |
| 20 | + | |
| 21 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/message/mail/MailSendMessage.java
| ... | ... | @@ -4,8 +4,8 @@ import cn.iocoder.yudao.framework.mq.core.stream.AbstractStreamMessage; |
| 4 | 4 | import lombok.Data; |
| 5 | 5 | import lombok.EqualsAndHashCode; |
| 6 | 6 | |
| 7 | +import javax.validation.constraints.NotEmpty; | |
| 7 | 8 | import javax.validation.constraints.NotNull; |
| 8 | -import java.util.Map; | |
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * 邮箱发送消息 |
| ... | ... | @@ -17,28 +17,35 @@ import java.util.Map; |
| 17 | 17 | public class MailSendMessage extends AbstractStreamMessage { |
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | - * 邮箱地址 | |
| 20 | + * 邮件日志编号 | |
| 21 | 21 | */ |
| 22 | - @NotNull(message = "邮箱地址不能为空") | |
| 23 | - private String address; | |
| 22 | + @NotNull(message = "邮件日志编号不能为空") | |
| 23 | + private Long logId; | |
| 24 | 24 | /** |
| 25 | - * 短信模板编号 | |
| 25 | + * 接收邮件地址 | |
| 26 | 26 | */ |
| 27 | - @NotNull(message = "短信模板编号不能为空") | |
| 28 | - private String templateCode; | |
| 27 | + @NotNull(message = "接收邮件地址不能为空") | |
| 28 | + private String mail; | |
| 29 | 29 | /** |
| 30 | - * 短信模板参数 | |
| 30 | + * 邮件账号编号 | |
| 31 | 31 | */ |
| 32 | - private Map<String, Object> templateParams; | |
| 32 | + @NotNull(message = "邮件账号编号不能为空") | |
| 33 | + private Long accountId; | |
| 33 | 34 | |
| 34 | 35 | /** |
| 35 | - * 用户编号,允许空 | |
| 36 | + * 邮件发件人 | |
| 36 | 37 | */ |
| 37 | - private Integer userId; | |
| 38 | + private String nickname; | |
| 38 | 39 | /** |
| 39 | - * 用户类型,允许空 | |
| 40 | + * 邮件标题 | |
| 40 | 41 | */ |
| 41 | - private Integer userType; | |
| 42 | + @NotEmpty(message = "邮件标题不能为空") | |
| 43 | + private String title; | |
| 44 | + /** | |
| 45 | + * 邮件内容 | |
| 46 | + */ | |
| 47 | + @NotEmpty(message = "邮件内容不能为空") | |
| 48 | + private String content; | |
| 42 | 49 | |
| 43 | 50 | @Override |
| 44 | 51 | public String getStreamKey() { | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/message/mail/MailTemplateRefreshMessage.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.mq.message.mail; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.mq.core.pubsub.AbstractChannelMessage; | |
| 4 | +import lombok.Data; | |
| 5 | +import lombok.EqualsAndHashCode; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * 邮箱模板的数据刷新 Message | |
| 9 | + * | |
| 10 | + * @author wangjingyi | |
| 11 | + */ | |
| 12 | +@Data | |
| 13 | +@EqualsAndHashCode(callSuper = true) | |
| 14 | +public class MailTemplateRefreshMessage extends AbstractChannelMessage { | |
| 15 | + | |
| 16 | + @Override | |
| 17 | + public String getChannel() { | |
| 18 | + return "system.mail-template.refresh"; | |
| 19 | + } | |
| 20 | + | |
| 21 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/message/notify/NotifyTemplateRefreshMessage.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.mq.message.notify; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.mq.core.pubsub.AbstractChannelMessage; | |
| 4 | +import lombok.Data; | |
| 5 | +import lombok.EqualsAndHashCode; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * 站内信模板的数据刷新 Message | |
| 9 | + * | |
| 10 | + * @author xrcoder | |
| 11 | + */ | |
| 12 | +@Data | |
| 13 | +@EqualsAndHashCode(callSuper = true) | |
| 14 | +public class NotifyTemplateRefreshMessage extends AbstractChannelMessage { | |
| 15 | + | |
| 16 | + @Override | |
| 17 | + public String getChannel() { | |
| 18 | + return "system.notify-template.refresh"; | |
| 19 | + } | |
| 20 | + | |
| 21 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/producer/mail/MailProducer.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.mq.producer.mail; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.mq.core.RedisMQTemplate; | |
| 4 | +import cn.iocoder.yudao.module.system.mq.message.mail.MailAccountRefreshMessage; | |
| 5 | +import cn.iocoder.yudao.module.system.mq.message.mail.MailSendMessage; | |
| 6 | +import cn.iocoder.yudao.module.system.mq.message.mail.MailTemplateRefreshMessage; | |
| 7 | +import lombok.extern.slf4j.Slf4j; | |
| 8 | +import org.springframework.stereotype.Component; | |
| 9 | + | |
| 10 | +import javax.annotation.Resource; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * Mail 邮件相关消息的 Producer | |
| 14 | + * | |
| 15 | + * @author wangjingyi | |
| 16 | + * @since 2021/4/19 13:33 | |
| 17 | + */ | |
| 18 | +@Slf4j | |
| 19 | +@Component | |
| 20 | +public class MailProducer { | |
| 21 | + | |
| 22 | + @Resource | |
| 23 | + private RedisMQTemplate redisMQTemplate; | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 发送 {@link MailTemplateRefreshMessage} 消息 | |
| 27 | + */ | |
| 28 | + public void sendMailTemplateRefreshMessage() { | |
| 29 | + MailTemplateRefreshMessage message = new MailTemplateRefreshMessage(); | |
| 30 | + redisMQTemplate.send(message); | |
| 31 | + } | |
| 32 | + | |
| 33 | + /** | |
| 34 | + * 发送 {@link MailAccountRefreshMessage} 消息 | |
| 35 | + */ | |
| 36 | + public void sendMailAccountRefreshMessage() { | |
| 37 | + MailAccountRefreshMessage message = new MailAccountRefreshMessage(); | |
| 38 | + redisMQTemplate.send(message); | |
| 39 | + } | |
| 40 | + | |
| 41 | + /** | |
| 42 | + * 发送 {@link MailSendMessage} 消息 | |
| 43 | + * | |
| 44 | + * @param sendLogId 发送日志编码 | |
| 45 | + * @param mail 接收邮件地址 | |
| 46 | + * @param accountId 邮件账号编号 | |
| 47 | + * @param nickname 邮件发件人 | |
| 48 | + * @param title 邮件标题 | |
| 49 | + * @param content 邮件内容 | |
| 50 | + */ | |
| 51 | + public void sendMailSendMessage(Long sendLogId, String mail, Long accountId, | |
| 52 | + String nickname, String title, String content) { | |
| 53 | + MailSendMessage message = new MailSendMessage() | |
| 54 | + .setLogId(sendLogId).setMail(mail).setAccountId(accountId) | |
| 55 | + .setNickname(nickname).setTitle(title).setContent(content); | |
| 56 | + redisMQTemplate.send(message); | |
| 57 | + } | |
| 58 | + | |
| 59 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/mq/producer/notify/NotifyProducer.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.mq.producer.notify; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.mq.core.RedisMQTemplate; | |
| 4 | +import cn.iocoder.yudao.module.system.mq.message.notify.NotifyTemplateRefreshMessage; | |
| 5 | +import lombok.extern.slf4j.Slf4j; | |
| 6 | +import org.springframework.stereotype.Component; | |
| 7 | + | |
| 8 | +import javax.annotation.Resource; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * Notify 站内信相关消息的 Producer | |
| 12 | + * | |
| 13 | + * @author xrcoder | |
| 14 | + * @since 2022-08-06 | |
| 15 | + */ | |
| 16 | +@Slf4j | |
| 17 | +@Component | |
| 18 | +public class NotifyProducer { | |
| 19 | + | |
| 20 | + @Resource | |
| 21 | + private RedisMQTemplate redisMQTemplate; | |
| 22 | + | |
| 23 | + | |
| 24 | + /** | |
| 25 | + * 发送 {@link NotifyTemplateRefreshMessage} 消息 | |
| 26 | + */ | |
| 27 | + public void sendNotifyTemplateRefreshMessage() { | |
| 28 | + NotifyTemplateRefreshMessage message = new NotifyTemplateRefreshMessage(); | |
| 29 | + redisMQTemplate.send(message); | |
| 30 | + } | |
| 31 | + | |
| 32 | + | |
| 33 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/mail/MailAccountService.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.service.mail; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.MailAccountCreateReqVO; | |
| 5 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.MailAccountPageReqVO; | |
| 6 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.MailAccountUpdateReqVO; | |
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailAccountDO; | |
| 8 | + | |
| 9 | +import javax.validation.Valid; | |
| 10 | +import java.util.List; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 邮箱账号 Service 接口 | |
| 14 | + * | |
| 15 | + * @author wangjingyi | |
| 16 | + * @since 2022-03-21 | |
| 17 | + */ | |
| 18 | +public interface MailAccountService { | |
| 19 | + | |
| 20 | + /** | |
| 21 | + * 初始化邮箱账号的本地缓存 | |
| 22 | + */ | |
| 23 | + void initLocalCache(); | |
| 24 | + | |
| 25 | + /** | |
| 26 | + * 从缓存中获取邮箱账号 | |
| 27 | + * | |
| 28 | + * @param id 编号 | |
| 29 | + * @return 邮箱账号 | |
| 30 | + */ | |
| 31 | + MailAccountDO getMailAccountFromCache(Long id); | |
| 32 | + | |
| 33 | + /** | |
| 34 | + * 创建邮箱账号 | |
| 35 | + * | |
| 36 | + * @param createReqVO 邮箱账号信息 | |
| 37 | + * @return 编号 | |
| 38 | + */ | |
| 39 | + Long createMailAccount(@Valid MailAccountCreateReqVO createReqVO); | |
| 40 | + | |
| 41 | + /** | |
| 42 | + * 修改邮箱账号 | |
| 43 | + * | |
| 44 | + * @param updateReqVO 邮箱账号信息 | |
| 45 | + */ | |
| 46 | + void updateMailAccount(@Valid MailAccountUpdateReqVO updateReqVO); | |
| 47 | + | |
| 48 | + /** | |
| 49 | + * 删除邮箱账号 | |
| 50 | + * | |
| 51 | + * @param id 编号 | |
| 52 | + */ | |
| 53 | + void deleteMailAccount(Long id); | |
| 54 | + | |
| 55 | + /** | |
| 56 | + * 获取邮箱账号信息 | |
| 57 | + * | |
| 58 | + * @param id 编号 | |
| 59 | + * @return 邮箱账号信息 | |
| 60 | + */ | |
| 61 | + MailAccountDO getMailAccount(Long id); | |
| 62 | + | |
| 63 | + /** | |
| 64 | + * 获取邮箱账号分页信息 | |
| 65 | + * | |
| 66 | + * @param pageReqVO 邮箱账号分页参数 | |
| 67 | + * @return 邮箱账号分页信息 | |
| 68 | + */ | |
| 69 | + PageResult<MailAccountDO> getMailAccountPage(MailAccountPageReqVO pageReqVO); | |
| 70 | + | |
| 71 | + /** | |
| 72 | + * 获取邮箱数组信息 | |
| 73 | + * | |
| 74 | + * @return 邮箱账号信息数组 | |
| 75 | + */ | |
| 76 | + List<MailAccountDO> getMailAccountList(); | |
| 77 | + | |
| 78 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/mail/MailAccountServiceImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.service.mail; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.MailAccountCreateReqVO; | |
| 5 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.MailAccountPageReqVO; | |
| 6 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.MailAccountUpdateReqVO; | |
| 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.dal.mysql.mail.MailAccountMapper; | |
| 10 | +import cn.iocoder.yudao.module.system.mq.producer.mail.MailProducer; | |
| 11 | +import lombok.Getter; | |
| 12 | +import lombok.extern.slf4j.Slf4j; | |
| 13 | +import org.springframework.stereotype.Service; | |
| 14 | +import org.springframework.validation.annotation.Validated; | |
| 15 | + | |
| 16 | +import javax.annotation.PostConstruct; | |
| 17 | +import javax.annotation.Resource; | |
| 18 | +import java.util.List; | |
| 19 | +import java.util.Map; | |
| 20 | + | |
| 21 | +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 22 | +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap; | |
| 23 | +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; | |
| 24 | + | |
| 25 | +/** | |
| 26 | + * 邮箱账号 Service 实现类 | |
| 27 | + * | |
| 28 | + * @author wangjingyi | |
| 29 | + * @since 2022-03-21 | |
| 30 | + */ | |
| 31 | +@Service | |
| 32 | +@Validated | |
| 33 | +@Slf4j | |
| 34 | +public class MailAccountServiceImpl implements MailAccountService { | |
| 35 | + | |
| 36 | + @Resource | |
| 37 | + private MailAccountMapper mailAccountMapper; | |
| 38 | + | |
| 39 | + @Resource | |
| 40 | + private MailTemplateService mailTemplateService; | |
| 41 | + | |
| 42 | + @Resource | |
| 43 | + private MailProducer mailProducer; | |
| 44 | + | |
| 45 | + /** | |
| 46 | + * 邮箱账号缓存 | |
| 47 | + * key:邮箱账号编码 {@link MailAccountDO#getId()} | |
| 48 | + * | |
| 49 | + * 这里声明 volatile 修饰的原因是,每次刷新时,直接修改指向 | |
| 50 | + */ | |
| 51 | + @Getter | |
| 52 | + private volatile Map<Long, MailAccountDO> mailAccountCache; | |
| 53 | + | |
| 54 | + @Override | |
| 55 | + @PostConstruct | |
| 56 | + public void initLocalCache() { | |
| 57 | + // 第一步:查询数据 | |
| 58 | + List<MailAccountDO> accounts = mailAccountMapper.selectList(); | |
| 59 | + log.info("[initLocalCache][缓存邮箱账号,数量:{}]", accounts.size()); | |
| 60 | + | |
| 61 | + // 第二步:构建缓存 | |
| 62 | + mailAccountCache = convertMap(accounts, MailAccountDO::getId); | |
| 63 | + } | |
| 64 | + | |
| 65 | + @Override | |
| 66 | + public MailAccountDO getMailAccountFromCache(Long id) { | |
| 67 | + return mailAccountCache.get(id); | |
| 68 | + } | |
| 69 | + | |
| 70 | + @Override | |
| 71 | + public Long createMailAccount(MailAccountCreateReqVO createReqVO) { | |
| 72 | + // 插入 | |
| 73 | + MailAccountDO account = MailAccountConvert.INSTANCE.convert(createReqVO); | |
| 74 | + mailAccountMapper.insert(account); | |
| 75 | + | |
| 76 | + // 发送刷新消息 | |
| 77 | + mailProducer.sendMailAccountRefreshMessage(); | |
| 78 | + return account.getId(); | |
| 79 | + } | |
| 80 | + | |
| 81 | + @Override | |
| 82 | + public void updateMailAccount(MailAccountUpdateReqVO updateReqVO) { | |
| 83 | + // 校验是否存在 | |
| 84 | + validateMailAccountExists(updateReqVO.getId()); | |
| 85 | + | |
| 86 | + // 更新 | |
| 87 | + MailAccountDO updateObj = MailAccountConvert.INSTANCE.convert(updateReqVO); | |
| 88 | + mailAccountMapper.updateById(updateObj); | |
| 89 | + // 发送刷新消息 | |
| 90 | + mailProducer.sendMailAccountRefreshMessage(); | |
| 91 | + } | |
| 92 | + | |
| 93 | + @Override | |
| 94 | + public void deleteMailAccount(Long id) { | |
| 95 | + // 校验是否存在账号 | |
| 96 | + validateMailAccountExists(id); | |
| 97 | + // 校验是否存在关联模版 | |
| 98 | + if (mailTemplateService.countByAccountId(id) > 0) { | |
| 99 | + throw exception(MAIL_ACCOUNT_RELATE_TEMPLATE_EXISTS); | |
| 100 | + } | |
| 101 | + | |
| 102 | + // 删除 | |
| 103 | + mailAccountMapper.deleteById(id); | |
| 104 | + // 发送刷新消息 | |
| 105 | + mailProducer.sendMailAccountRefreshMessage(); | |
| 106 | + } | |
| 107 | + | |
| 108 | + private void validateMailAccountExists(Long id) { | |
| 109 | + if (mailAccountMapper.selectById(id) == null) { | |
| 110 | + throw exception(MAIL_ACCOUNT_NOT_EXISTS); | |
| 111 | + } | |
| 112 | + } | |
| 113 | + | |
| 114 | + @Override | |
| 115 | + public MailAccountDO getMailAccount(Long id) { | |
| 116 | + return mailAccountMapper.selectById(id); | |
| 117 | + } | |
| 118 | + | |
| 119 | + @Override | |
| 120 | + public PageResult<MailAccountDO> getMailAccountPage(MailAccountPageReqVO pageReqVO) { | |
| 121 | + return mailAccountMapper.selectPage(pageReqVO); | |
| 122 | + } | |
| 123 | + | |
| 124 | + @Override | |
| 125 | + public List<MailAccountDO> getMailAccountList() { | |
| 126 | + return mailAccountMapper.selectList(); | |
| 127 | + } | |
| 128 | + | |
| 129 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/mail/MailLogService.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.service.mail; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.log.MailLogPageReqVO; | |
| 5 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailAccountDO; | |
| 6 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailLogDO; | |
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO; | |
| 8 | + | |
| 9 | +import java.util.Map; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * 邮件日志 Service 接口 | |
| 13 | + * | |
| 14 | + * @author wangjingyi | |
| 15 | + * @since 2022-03-21 | |
| 16 | + */ | |
| 17 | +public interface MailLogService { | |
| 18 | + | |
| 19 | + /** | |
| 20 | + * 邮件日志分页 | |
| 21 | + * | |
| 22 | + * @param pageVO 分页参数 | |
| 23 | + * @return 分页结果 | |
| 24 | + */ | |
| 25 | + PageResult<MailLogDO> getMailLogPage(MailLogPageReqVO pageVO); | |
| 26 | + | |
| 27 | + /** | |
| 28 | + * 获得指定编号的邮件日志 | |
| 29 | + * | |
| 30 | + * @param id 日志编号 | |
| 31 | + * @return 邮件日志 | |
| 32 | + */ | |
| 33 | + MailLogDO getMailLog(Long id); | |
| 34 | + | |
| 35 | + /** | |
| 36 | + * 创建邮件日志 | |
| 37 | + * | |
| 38 | + * @param userId 用户编码 | |
| 39 | + * @param userType 用户类型 | |
| 40 | + * @param toMail 收件人邮件 | |
| 41 | + * @param account 邮件账号信息 | |
| 42 | + * @param template 模版信息 | |
| 43 | + * @param templateContent 模版内容 | |
| 44 | + * @param templateParams 模版参数 | |
| 45 | + * @param isSend 是否发送成功 | |
| 46 | + * @return 日志编号 | |
| 47 | + */ | |
| 48 | + Long createMailLog(Long userId, Integer userType, String toMail, | |
| 49 | + MailAccountDO account, MailTemplateDO template , | |
| 50 | + String templateContent, Map<String, Object> templateParams, Boolean isSend); | |
| 51 | + | |
| 52 | + /** | |
| 53 | + * 更新邮件发送结果 | |
| 54 | + * | |
| 55 | + * @param logId 日志编号 | |
| 56 | + * @param messageId 发送后的消息编号 | |
| 57 | + * @param exception 发送异常 | |
| 58 | + */ | |
| 59 | + void updateMailSendResult(Long logId, String messageId, Exception exception); | |
| 60 | + | |
| 61 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/mail/MailLogServiceImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.service.mail; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.log.MailLogPageReqVO; | |
| 5 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailAccountDO; | |
| 6 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailLogDO; | |
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO; | |
| 8 | +import cn.iocoder.yudao.module.system.dal.mysql.mail.MailLogMapper; | |
| 9 | +import cn.iocoder.yudao.module.system.enums.mail.MailSendStatusEnum; | |
| 10 | +import org.springframework.stereotype.Service; | |
| 11 | +import org.springframework.validation.annotation.Validated; | |
| 12 | + | |
| 13 | +import javax.annotation.Resource; | |
| 14 | +import java.util.Date; | |
| 15 | +import java.util.Map; | |
| 16 | +import java.util.Objects; | |
| 17 | + | |
| 18 | +import static cn.hutool.core.exceptions.ExceptionUtil.getRootCauseMessage; | |
| 19 | + | |
| 20 | +/** | |
| 21 | + * 邮件日志 Service 实现类 | |
| 22 | + * | |
| 23 | + * @author wangjingyi | |
| 24 | + * @since 2022-03-21 | |
| 25 | + */ | |
| 26 | +@Service | |
| 27 | +@Validated | |
| 28 | +public class MailLogServiceImpl implements MailLogService { | |
| 29 | + | |
| 30 | + @Resource | |
| 31 | + private MailLogMapper mailLogMapper; | |
| 32 | + | |
| 33 | + @Override | |
| 34 | + public PageResult<MailLogDO> getMailLogPage(MailLogPageReqVO pageVO) { | |
| 35 | + return mailLogMapper.selectPage(pageVO); | |
| 36 | + } | |
| 37 | + | |
| 38 | + @Override | |
| 39 | + public MailLogDO getMailLog(Long id) { | |
| 40 | + return mailLogMapper.selectById(id); | |
| 41 | + } | |
| 42 | + | |
| 43 | + @Override | |
| 44 | + public Long createMailLog(Long userId, Integer userType, String toMail, | |
| 45 | + MailAccountDO account, MailTemplateDO template, | |
| 46 | + String templateContent, Map<String, Object> templateParams, Boolean isSend) { | |
| 47 | + MailLogDO.MailLogDOBuilder logDOBuilder = MailLogDO.builder(); | |
| 48 | + // 根据是否要发送,设置状态 | |
| 49 | + logDOBuilder.sendStatus(Objects.equals(isSend, true) ? MailSendStatusEnum.INIT.getStatus() | |
| 50 | + : MailSendStatusEnum.IGNORE.getStatus()) | |
| 51 | + // 用户信息 | |
| 52 | + .userId(userId).userType(userType).toMail(toMail) | |
| 53 | + .accountId(account.getId()).fromMail(account.getMail()) | |
| 54 | + // 模板相关字段 | |
| 55 | + .templateId(template.getId()).templateCode(template.getCode()).templateNickname(template.getNickname()) | |
| 56 | + .templateTitle(template.getTitle()).templateContent(templateContent).templateParams(templateParams); | |
| 57 | + | |
| 58 | + // 插入数据库 | |
| 59 | + MailLogDO logDO = logDOBuilder.build(); | |
| 60 | + mailLogMapper.insert(logDO); | |
| 61 | + return logDO.getId(); | |
| 62 | + } | |
| 63 | + | |
| 64 | + @Override | |
| 65 | + public void updateMailSendResult(Long logId, String messageId, Exception exception) { | |
| 66 | + // 1. 成功 | |
| 67 | + if (exception == null) { | |
| 68 | + mailLogMapper.updateById(new MailLogDO().setId(logId).setSendTime(new Date()) | |
| 69 | + .setSendStatus(MailSendStatusEnum.SUCCESS.getStatus()).setSendMessageId(messageId)); | |
| 70 | + return; | |
| 71 | + } | |
| 72 | + // 2. 失败 | |
| 73 | + mailLogMapper.updateById(new MailLogDO().setId(logId).setSendTime(new Date()) | |
| 74 | + .setSendStatus(MailSendStatusEnum.FAILURE.getStatus()).setSendException(getRootCauseMessage(exception))); | |
| 75 | + | |
| 76 | + } | |
| 77 | + | |
| 78 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/mail/MailSendService.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.service.mail; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.module.system.mq.message.mail.MailSendMessage; | |
| 4 | + | |
| 5 | +import java.util.Map; | |
| 6 | + | |
| 7 | +/** | |
| 8 | + * 邮件发送 Service 接口 | |
| 9 | + * | |
| 10 | + * @author wangjingyi | |
| 11 | + * @since 2022-03-21 | |
| 12 | + */ | |
| 13 | +public interface MailSendService { | |
| 14 | + | |
| 15 | + /** | |
| 16 | + * 发送单条邮件给管理后台的用户 | |
| 17 | + * | |
| 18 | + * @param mail 邮箱 | |
| 19 | + * @param userId 用户编码 | |
| 20 | + * @param templateCode 邮件模版编码 | |
| 21 | + * @param templateParams 邮件模版参数 | |
| 22 | + * @return 发送日志编号 | |
| 23 | + */ | |
| 24 | + Long sendSingleMailToAdmin(String mail, Long userId, | |
| 25 | + String templateCode, Map<String, Object> templateParams); | |
| 26 | + | |
| 27 | + /** | |
| 28 | + * 发送单条邮件给用户 APP 的用户 | |
| 29 | + * | |
| 30 | + * @param mail 邮箱 | |
| 31 | + * @param userId 用户编码 | |
| 32 | + * @param templateCode 邮件模版编码 | |
| 33 | + * @param templateParams 邮件模版参数 | |
| 34 | + * @return 发送日志编号 | |
| 35 | + */ | |
| 36 | + Long sendSingleMailToMember(String mail, Long userId, | |
| 37 | + String templateCode, Map<String, Object> templateParams); | |
| 38 | + | |
| 39 | + /** | |
| 40 | + * 发送单条邮件给用户 | |
| 41 | + * | |
| 42 | + * @param mail 邮箱 | |
| 43 | + * @param userId 用户编码 | |
| 44 | + * @param userType 用户类型 | |
| 45 | + * @param templateCode 邮件模版编码 | |
| 46 | + * @param templateParams 邮件模版参数 | |
| 47 | + * @return 发送日志编号 | |
| 48 | + */ | |
| 49 | + Long sendSingleMail(String mail, Long userId, Integer userType, | |
| 50 | + String templateCode, Map<String, Object> templateParams); | |
| 51 | + | |
| 52 | + /** | |
| 53 | + * 执行真正的邮件发送 | |
| 54 | + * 注意,该方法仅仅提供给 MQ Consumer 使用 | |
| 55 | + * | |
| 56 | + * @param message 邮件 | |
| 57 | + */ | |
| 58 | + void doSendMail(MailSendMessage message); | |
| 59 | + | |
| 60 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/mail/MailSendServiceImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.service.mail; | |
| 2 | + | |
| 3 | +import cn.hutool.core.util.StrUtil; | |
| 4 | +import cn.hutool.extra.mail.MailAccount; | |
| 5 | +import cn.hutool.extra.mail.MailUtil; | |
| 6 | +import cn.iocoder.yudao.framework.common.core.KeyValue; | |
| 7 | +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | |
| 8 | +import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | |
| 9 | +import cn.iocoder.yudao.module.system.convert.mail.MailAccountConvert; | |
| 10 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailAccountDO; | |
| 11 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO; | |
| 12 | +import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; | |
| 13 | +import cn.iocoder.yudao.module.system.mq.message.mail.MailSendMessage; | |
| 14 | +import cn.iocoder.yudao.module.system.mq.producer.mail.MailProducer; | |
| 15 | +import cn.iocoder.yudao.module.system.service.member.MemberService; | |
| 16 | +import cn.iocoder.yudao.module.system.service.user.AdminUserService; | |
| 17 | +import com.google.common.annotations.VisibleForTesting; | |
| 18 | +import lombok.extern.slf4j.Slf4j; | |
| 19 | +import org.springframework.stereotype.Service; | |
| 20 | +import org.springframework.validation.annotation.Validated; | |
| 21 | + | |
| 22 | +import javax.annotation.Resource; | |
| 23 | +import java.util.List; | |
| 24 | +import java.util.Map; | |
| 25 | +import java.util.stream.Collectors; | |
| 26 | + | |
| 27 | +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 28 | +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; | |
| 29 | + | |
| 30 | +/** | |
| 31 | + * 邮箱模版 服务实现类 | |
| 32 | + * | |
| 33 | + * @author wangjingyi | |
| 34 | + * @since 2022-03-21 | |
| 35 | + */ | |
| 36 | +@Service | |
| 37 | +@Validated | |
| 38 | +@Slf4j | |
| 39 | +public class MailSendServiceImpl implements MailSendService { | |
| 40 | + | |
| 41 | + @Resource | |
| 42 | + private AdminUserService adminUserService; | |
| 43 | + @Resource | |
| 44 | + private MemberService memberService; | |
| 45 | + | |
| 46 | + @Resource | |
| 47 | + private MailAccountService mailAccountService; | |
| 48 | + @Resource | |
| 49 | + private MailTemplateService mailTemplateService; | |
| 50 | + | |
| 51 | + @Resource | |
| 52 | + private MailLogService mailLogService; | |
| 53 | + @Resource | |
| 54 | + private MailProducer mailProducer; | |
| 55 | + | |
| 56 | + @Override | |
| 57 | + public Long sendSingleMailToAdmin(String mail, Long userId, | |
| 58 | + String templateCode, Map<String, Object> templateParams) { | |
| 59 | + // 如果 mail 为空,则加载用户编号对应的邮箱 | |
| 60 | + if (StrUtil.isEmpty(mail)) { | |
| 61 | + AdminUserDO user = adminUserService.getUser(userId); | |
| 62 | + if (user != null) { | |
| 63 | + mail = user.getEmail(); | |
| 64 | + } | |
| 65 | + } | |
| 66 | + // 执行发送 | |
| 67 | + return sendSingleMail(mail, userId, UserTypeEnum.ADMIN.getValue(), templateCode, templateParams); | |
| 68 | + } | |
| 69 | + | |
| 70 | + @Override | |
| 71 | + public Long sendSingleMailToMember(String mail, Long userId, | |
| 72 | + String templateCode, Map<String, Object> templateParams) { | |
| 73 | + // 如果 mail 为空,则加载用户编号对应的邮箱 | |
| 74 | + if (StrUtil.isEmpty(mail)) { | |
| 75 | + mail = memberService.getMemberUserEmail(userId); | |
| 76 | + } | |
| 77 | + // 执行发送 | |
| 78 | + return sendSingleMail(mail, userId, UserTypeEnum.MEMBER.getValue(), templateCode, templateParams); | |
| 79 | + } | |
| 80 | + | |
| 81 | + @Override | |
| 82 | + public Long sendSingleMail(String mail, Long userId, Integer userType, | |
| 83 | + String templateCode, Map<String, Object> templateParams) { | |
| 84 | + // 校验邮箱模版是否合法 | |
| 85 | + MailTemplateDO template = checkMailTemplateValid(templateCode); | |
| 86 | + // 校验邮箱账号是否合法 | |
| 87 | + MailAccountDO account = checkMailAccountValid(template.getAccountId()); | |
| 88 | + | |
| 89 | + // 校验邮箱是否存在 | |
| 90 | + mail = checkMail(mail); | |
| 91 | + checkTemplateParams(template, templateParams); | |
| 92 | + | |
| 93 | + // 创建发送日志。如果模板被禁用,则不发送短信,只记录日志 | |
| 94 | + Boolean isSend = CommonStatusEnum.ENABLE.getStatus().equals(template.getStatus()); | |
| 95 | + String content = mailTemplateService.formatMailTemplateContent(template.getContent(), templateParams); | |
| 96 | + Long sendLogId = mailLogService.createMailLog(userId, userType, mail, | |
| 97 | + account, template, content, templateParams, isSend); | |
| 98 | + // 发送 MQ 消息,异步执行发送短信 | |
| 99 | + if (isSend) { | |
| 100 | + mailProducer.sendMailSendMessage(sendLogId, mail, account.getId(), | |
| 101 | + template.getNickname(), template.getTitle(), content); | |
| 102 | + } | |
| 103 | + return sendLogId; | |
| 104 | + } | |
| 105 | + | |
| 106 | + @Override | |
| 107 | + public void doSendMail(MailSendMessage message) { | |
| 108 | + // 1. 创建发送账号 | |
| 109 | + MailAccountDO account = checkMailAccountValid(message.getAccountId()); | |
| 110 | + MailAccount mailAccount = MailAccountConvert.INSTANCE.convert(account, message.getNickname()); | |
| 111 | + // 2. 发送邮件 | |
| 112 | + try { | |
| 113 | + String messageId = MailUtil.send(mailAccount, message.getMail(), | |
| 114 | + message.getTitle(), message.getContent(),true); | |
| 115 | + // 3. 更新结果(成功) | |
| 116 | + mailLogService.updateMailSendResult(message.getLogId(), messageId, null); | |
| 117 | + } catch (Exception e) { | |
| 118 | + // 3. 更新结果(异常) | |
| 119 | + mailLogService.updateMailSendResult(message.getLogId(), null, e); | |
| 120 | + } | |
| 121 | + } | |
| 122 | + | |
| 123 | + @VisibleForTesting | |
| 124 | + public MailTemplateDO checkMailTemplateValid(String templateCode) { | |
| 125 | + // 获得邮件模板。考虑到效率,从缓存中获取 | |
| 126 | + MailTemplateDO template = mailTemplateService.getMailTemplateByCodeFromCache(templateCode); | |
| 127 | + // 邮件模板不存在 | |
| 128 | + if (template == null) { | |
| 129 | + throw exception(MAIL_TEMPLATE_NOT_EXISTS); | |
| 130 | + } | |
| 131 | + return template; | |
| 132 | + } | |
| 133 | + | |
| 134 | + @VisibleForTesting | |
| 135 | + public MailAccountDO checkMailAccountValid(Long accountId) { | |
| 136 | + // 获得邮箱账号。考虑到效率,从缓存中获取 | |
| 137 | + MailAccountDO account = mailAccountService.getMailAccountFromCache(accountId); | |
| 138 | + // 邮箱账号不存在 | |
| 139 | + if (account == null) { | |
| 140 | + throw exception(MAIL_ACCOUNT_NOT_EXISTS); | |
| 141 | + } | |
| 142 | + return account; | |
| 143 | + } | |
| 144 | + | |
| 145 | + @VisibleForTesting | |
| 146 | + public String checkMail(String mail) { | |
| 147 | + if (StrUtil.isEmpty(mail)) { | |
| 148 | + throw exception(MAIL_SEND_MAIL_NOT_EXISTS); | |
| 149 | + } | |
| 150 | + return mail; | |
| 151 | + } | |
| 152 | + | |
| 153 | + /** | |
| 154 | + * 校验邮件参数是否确实 | |
| 155 | + * | |
| 156 | + * @param template 邮箱模板 | |
| 157 | + * @param templateParams 参数列表 | |
| 158 | + */ | |
| 159 | + @VisibleForTesting | |
| 160 | + public void checkTemplateParams(MailTemplateDO template, Map<String, Object> templateParams) { | |
| 161 | + template.getParams().forEach(key -> { | |
| 162 | + Object value = templateParams.get(key); | |
| 163 | + if (value == null) { | |
| 164 | + throw exception(MAIL_SEND_TEMPLATE_PARAM_MISS, key); | |
| 165 | + } | |
| 166 | + }); | |
| 167 | + } | |
| 168 | + | |
| 169 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/mail/MailTemplateService.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.service.mail; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.template.MailTemplateCreateReqVO; | |
| 5 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.template.MailTemplatePageReqVO; | |
| 6 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.template.MailTemplateUpdateReqVO; | |
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO; | |
| 8 | + | |
| 9 | +import javax.validation.Valid; | |
| 10 | +import java.util.List; | |
| 11 | +import java.util.Map; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 邮件模版 Service 接口 | |
| 15 | + * | |
| 16 | + * @author wangjingyi | |
| 17 | + * @since 2022-03-21 | |
| 18 | + */ | |
| 19 | +public interface MailTemplateService { | |
| 20 | + | |
| 21 | + /** | |
| 22 | + * 初始化邮件模版的本地缓存 | |
| 23 | + */ | |
| 24 | + void initLocalCache(); | |
| 25 | + | |
| 26 | + /** | |
| 27 | + * 邮件模版创建 | |
| 28 | + * | |
| 29 | + * @param createReqVO 邮件信息 | |
| 30 | + * @return 编号 | |
| 31 | + */ | |
| 32 | + Long createMailTemplate(@Valid MailTemplateCreateReqVO createReqVO); | |
| 33 | + | |
| 34 | + /** | |
| 35 | + * 邮件模版修改 | |
| 36 | + * | |
| 37 | + * @param updateReqVO 邮件信息 | |
| 38 | + */ | |
| 39 | + void updateMailTemplate(@Valid MailTemplateUpdateReqVO updateReqVO); | |
| 40 | + | |
| 41 | + /** | |
| 42 | + * 邮件模版删除 | |
| 43 | + * | |
| 44 | + * @param id 编号 | |
| 45 | + */ | |
| 46 | + void deleteMailTemplate(Long id); | |
| 47 | + | |
| 48 | + /** | |
| 49 | + * 获取邮件模版 | |
| 50 | + * | |
| 51 | + * @param id 编号 | |
| 52 | + * @return 邮件模版 | |
| 53 | + */ | |
| 54 | + MailTemplateDO getMailTemplate(Long id); | |
| 55 | + | |
| 56 | + /** | |
| 57 | + * 获取邮件模版分页 | |
| 58 | + * | |
| 59 | + * @param pageReqVO 模版信息 | |
| 60 | + * @return 邮件模版分页信息 | |
| 61 | + */ | |
| 62 | + PageResult<MailTemplateDO> getMailTemplatePage(MailTemplatePageReqVO pageReqVO); | |
| 63 | + | |
| 64 | + /** | |
| 65 | + * 获取邮件模板数组 | |
| 66 | + * | |
| 67 | + * @return 模版数组 | |
| 68 | + */ | |
| 69 | + List<MailTemplateDO> getMailTemplateList(); | |
| 70 | + | |
| 71 | + /** | |
| 72 | + * 从缓存中获取邮件模版 | |
| 73 | + * | |
| 74 | + * @param code 模板编码 | |
| 75 | + * @return 邮件模板 | |
| 76 | + */ | |
| 77 | + MailTemplateDO getMailTemplateByCodeFromCache(String code); | |
| 78 | + | |
| 79 | + /** | |
| 80 | + * 邮件模版内容合成 | |
| 81 | + * | |
| 82 | + * @param content 邮件模版 | |
| 83 | + * @param params 合成参数 | |
| 84 | + * @return 格式化后的内容 | |
| 85 | + */ | |
| 86 | + String formatMailTemplateContent(String content, Map<String, Object> params); | |
| 87 | + | |
| 88 | + /** | |
| 89 | + * 获得指定邮件账号下的邮件模板数量 | |
| 90 | + * | |
| 91 | + * @param accountId 账号编号 | |
| 92 | + * @return 数量 | |
| 93 | + */ | |
| 94 | + long countByAccountId(Long accountId); | |
| 95 | + | |
| 96 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/mail/MailTemplateServiceImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.service.mail; | |
| 2 | + | |
| 3 | +import cn.hutool.core.util.ObjUtil; | |
| 4 | +import cn.hutool.core.util.ReUtil; | |
| 5 | +import cn.hutool.core.util.StrUtil; | |
| 6 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 7 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.template.MailTemplateCreateReqVO; | |
| 8 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.template.MailTemplatePageReqVO; | |
| 9 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.template.MailTemplateUpdateReqVO; | |
| 10 | +import cn.iocoder.yudao.module.system.convert.mail.MailTemplateConvert; | |
| 11 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO; | |
| 12 | +import cn.iocoder.yudao.module.system.dal.mysql.mail.MailTemplateMapper; | |
| 13 | +import cn.iocoder.yudao.module.system.mq.producer.mail.MailProducer; | |
| 14 | +import com.google.common.annotations.VisibleForTesting; | |
| 15 | +import lombok.Getter; | |
| 16 | +import lombok.extern.slf4j.Slf4j; | |
| 17 | +import org.springframework.stereotype.Service; | |
| 18 | +import org.springframework.validation.annotation.Validated; | |
| 19 | + | |
| 20 | +import javax.annotation.PostConstruct; | |
| 21 | +import javax.annotation.Resource; | |
| 22 | +import javax.validation.Valid; | |
| 23 | +import java.util.List; | |
| 24 | +import java.util.Map; | |
| 25 | +import java.util.regex.Pattern; | |
| 26 | + | |
| 27 | +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 28 | +import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertMap; | |
| 29 | +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; | |
| 30 | + | |
| 31 | +/** | |
| 32 | + * 邮箱模版 Service 实现类 | |
| 33 | + * | |
| 34 | + * @author wangjingyi | |
| 35 | + * @since 2022-03-21 | |
| 36 | + */ | |
| 37 | +@Service | |
| 38 | +@Validated | |
| 39 | +@Slf4j | |
| 40 | +public class MailTemplateServiceImpl implements MailTemplateService { | |
| 41 | + | |
| 42 | + /** | |
| 43 | + * 正则表达式,匹配 {} 中的变量 | |
| 44 | + */ | |
| 45 | + private static final Pattern PATTERN_PARAMS = Pattern.compile("\\{(.*?)}"); | |
| 46 | + | |
| 47 | + @Resource | |
| 48 | + private MailTemplateMapper mailTemplateMapper; | |
| 49 | + | |
| 50 | + @Resource | |
| 51 | + private MailProducer mailProducer; | |
| 52 | + | |
| 53 | + /** | |
| 54 | + * 邮件模板缓存 | |
| 55 | + * key:邮件模版标识 {@link MailTemplateDO#getCode()} | |
| 56 | + * | |
| 57 | + * 这里声明 volatile 修饰的原因是,每次刷新时,直接修改指向 | |
| 58 | + */ | |
| 59 | + @Getter | |
| 60 | + private volatile Map<String, MailTemplateDO> mailTemplateCache; | |
| 61 | + | |
| 62 | + @Override | |
| 63 | + @PostConstruct | |
| 64 | + public void initLocalCache() { | |
| 65 | + // 第一步:查询数据 | |
| 66 | + List<MailTemplateDO> templates = mailTemplateMapper.selectList(); | |
| 67 | + log.info("[initLocalCache][缓存邮件模版,数量:{}]", templates.size()); | |
| 68 | + | |
| 69 | + // 第二步:构建缓存 | |
| 70 | + mailTemplateCache = convertMap(templates, MailTemplateDO::getCode); | |
| 71 | + } | |
| 72 | + | |
| 73 | + @Override | |
| 74 | + public Long createMailTemplate(MailTemplateCreateReqVO createReqVO) { | |
| 75 | + // 校验 code 是否唯一 | |
| 76 | + validateCodeUnique(null, createReqVO.getCode()); | |
| 77 | + | |
| 78 | + // 插入 | |
| 79 | + MailTemplateDO template = MailTemplateConvert.INSTANCE.convert(createReqVO) | |
| 80 | + .setParams(parseTemplateContentParams(createReqVO.getContent())); | |
| 81 | + mailTemplateMapper.insert(template); | |
| 82 | + // 发送刷新消息 | |
| 83 | + mailProducer.sendMailTemplateRefreshMessage(); | |
| 84 | + return template.getId(); | |
| 85 | + } | |
| 86 | + | |
| 87 | + @Override | |
| 88 | + public void updateMailTemplate(@Valid MailTemplateUpdateReqVO updateReqVO) { | |
| 89 | + // 校验是否存在 | |
| 90 | + validateMailTemplateExists(updateReqVO.getId()); | |
| 91 | + // 校验 code 是否唯一 | |
| 92 | + validateCodeUnique(updateReqVO.getId(),updateReqVO.getCode()); | |
| 93 | + | |
| 94 | + // 更新 | |
| 95 | + MailTemplateDO updateObj = MailTemplateConvert.INSTANCE.convert(updateReqVO) | |
| 96 | + .setParams(parseTemplateContentParams(updateReqVO.getContent())); | |
| 97 | + mailTemplateMapper.updateById(updateObj); | |
| 98 | + // 发送刷新消息 | |
| 99 | + mailProducer.sendMailTemplateRefreshMessage(); | |
| 100 | + } | |
| 101 | + | |
| 102 | + @VisibleForTesting | |
| 103 | + public void validateCodeUnique(Long id, String code) { | |
| 104 | + MailTemplateDO template = mailTemplateMapper.selectByCode(code); | |
| 105 | + if (template == null) { | |
| 106 | + return; | |
| 107 | + } | |
| 108 | + // 存在 template 记录的情况下 | |
| 109 | + if (id == null // 新增时,说明重复 | |
| 110 | + || ObjUtil.notEqual(id, template.getId())) { // 更新时,如果 id 不一致,说明重复 | |
| 111 | + throw exception(MAIL_TEMPLATE_CODE_EXISTS); | |
| 112 | + } | |
| 113 | + } | |
| 114 | + | |
| 115 | + @Override | |
| 116 | + public void deleteMailTemplate(Long id) { | |
| 117 | + // 校验是否存在 | |
| 118 | + validateMailTemplateExists(id); | |
| 119 | + | |
| 120 | + // 删除 | |
| 121 | + mailTemplateMapper.deleteById(id); | |
| 122 | + // 发送刷新消息 | |
| 123 | + mailProducer.sendMailTemplateRefreshMessage(); | |
| 124 | + } | |
| 125 | + | |
| 126 | + private void validateMailTemplateExists(Long id) { | |
| 127 | + if (mailTemplateMapper.selectById(id) == null) { | |
| 128 | + throw exception(MAIL_TEMPLATE_NOT_EXISTS); | |
| 129 | + } | |
| 130 | + } | |
| 131 | + | |
| 132 | + @Override | |
| 133 | + public MailTemplateDO getMailTemplate(Long id) {return mailTemplateMapper.selectById(id);} | |
| 134 | + | |
| 135 | + @Override | |
| 136 | + public PageResult<MailTemplateDO> getMailTemplatePage(MailTemplatePageReqVO pageReqVO) { | |
| 137 | + return mailTemplateMapper.selectPage(pageReqVO); | |
| 138 | + } | |
| 139 | + | |
| 140 | + @Override | |
| 141 | + public List<MailTemplateDO> getMailTemplateList() {return mailTemplateMapper.selectList();} | |
| 142 | + | |
| 143 | + @Override | |
| 144 | + public MailTemplateDO getMailTemplateByCodeFromCache(String code) { | |
| 145 | + return mailTemplateCache.get(code); | |
| 146 | + } | |
| 147 | + | |
| 148 | + @Override | |
| 149 | + public String formatMailTemplateContent(String content, Map<String, Object> params) { | |
| 150 | + return StrUtil.format(content, params); | |
| 151 | + } | |
| 152 | + | |
| 153 | + @VisibleForTesting | |
| 154 | + public List<String> parseTemplateContentParams(String content) { | |
| 155 | + return ReUtil.findAllGroup1(PATTERN_PARAMS, content); | |
| 156 | + } | |
| 157 | + | |
| 158 | + @Override | |
| 159 | + public long countByAccountId(Long accountId) { | |
| 160 | + return mailTemplateMapper.selectCountByAccountId(accountId); | |
| 161 | + } | |
| 162 | + | |
| 163 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/member/MemberService.java
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/member/MemberServiceImpl.java
| ... | ... | @@ -21,14 +21,27 @@ public class MemberServiceImpl implements MemberService { |
| 21 | 21 | |
| 22 | 22 | @Override |
| 23 | 23 | public String getMemberUserMobile(Long id) { |
| 24 | - if (id == null) { | |
| 24 | + Object user = getMemberUser(id); | |
| 25 | + if (user == null) { | |
| 25 | 26 | return null; |
| 26 | 27 | } |
| 27 | - Object user = ReflectUtil.invoke(getMemberUserApi(), "getUser", id); | |
| 28 | + return ReflectUtil.invoke(user, "getMobile"); | |
| 29 | + } | |
| 30 | + | |
| 31 | + @Override | |
| 32 | + public String getMemberUserEmail(Long id) { | |
| 33 | + Object user = getMemberUser(id); | |
| 28 | 34 | if (user == null) { |
| 29 | 35 | return null; |
| 30 | 36 | } |
| 31 | - return ReflectUtil.invoke(user, "getMobile"); | |
| 37 | + return ReflectUtil.invoke(user, "getEmail"); | |
| 38 | + } | |
| 39 | + | |
| 40 | + private Object getMemberUser(Long id) { | |
| 41 | + if (id == null) { | |
| 42 | + return null; | |
| 43 | + } | |
| 44 | + return ReflectUtil.invoke(getMemberUserApi(), "getUser", id); | |
| 32 | 45 | } |
| 33 | 46 | |
| 34 | 47 | private Object getMemberUserApi() { | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/notify/NotifyMessageService.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.service.notify; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.system.controller.admin.notify.vo.message.NotifyMessageMyPageReqVO; | |
| 5 | +import cn.iocoder.yudao.module.system.controller.admin.notify.vo.message.NotifyMessagePageReqVO; | |
| 6 | +import cn.iocoder.yudao.module.system.dal.dataobject.notify.NotifyMessageDO; | |
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.notify.NotifyTemplateDO; | |
| 8 | + | |
| 9 | +import java.util.Collection; | |
| 10 | +import java.util.List; | |
| 11 | +import java.util.Map; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 站内信 Service 接口 | |
| 15 | + * | |
| 16 | + * @author xrcoder | |
| 17 | + */ | |
| 18 | +public interface NotifyMessageService { | |
| 19 | + | |
| 20 | + /** | |
| 21 | + * 创建站内信 | |
| 22 | + * | |
| 23 | + * @param userId 用户编号 | |
| 24 | + * @param userType 用户类型 | |
| 25 | + * @param template 模版信息 | |
| 26 | + * @param templateContent 模版内容 | |
| 27 | + * @param templateParams 模版参数 | |
| 28 | + * @return 站内信编号 | |
| 29 | + */ | |
| 30 | + Long createNotifyMessage(Long userId, Integer userType, | |
| 31 | + NotifyTemplateDO template, String templateContent, Map<String, Object> templateParams); | |
| 32 | + | |
| 33 | + /** | |
| 34 | + * 获得站内信分页 | |
| 35 | + * | |
| 36 | + * @param pageReqVO 分页查询 | |
| 37 | + * @return 站内信分页 | |
| 38 | + */ | |
| 39 | + PageResult<NotifyMessageDO> getNotifyMessagePage(NotifyMessagePageReqVO pageReqVO); | |
| 40 | + | |
| 41 | + /** | |
| 42 | + * 获得【我的】站内信分页 | |
| 43 | + * | |
| 44 | + * @param pageReqVO 分页查询 | |
| 45 | + * @param userId 用户编号 | |
| 46 | + * @param userType 用户类型 | |
| 47 | + * @return 站内信分页 | |
| 48 | + */ | |
| 49 | + PageResult<NotifyMessageDO> getMyMyNotifyMessagePage(NotifyMessageMyPageReqVO pageReqVO, Long userId, Integer userType); | |
| 50 | + | |
| 51 | + /** | |
| 52 | + * 获得站内信 | |
| 53 | + * | |
| 54 | + * @param id 编号 | |
| 55 | + * @return 站内信 | |
| 56 | + */ | |
| 57 | + NotifyMessageDO getNotifyMessage(Long id); | |
| 58 | + | |
| 59 | + /** | |
| 60 | + * 获得【我的】未读站内信列表 | |
| 61 | + * | |
| 62 | + * @param userId 用户编号 | |
| 63 | + * @param userType 用户类型 | |
| 64 | + * @param size 数量 | |
| 65 | + * @return 站内信列表 | |
| 66 | + */ | |
| 67 | + List<NotifyMessageDO> getUnreadNotifyMessageList(Long userId, Integer userType, Integer size); | |
| 68 | + | |
| 69 | + /** | |
| 70 | + * 统计用户未读站内信条数 | |
| 71 | + * | |
| 72 | + * @param userId 用户编号 | |
| 73 | + * @param userType 用户类型 | |
| 74 | + * @return 返回未读站内信条数 | |
| 75 | + */ | |
| 76 | + Long getUnreadNotifyMessageCount(Long userId, Integer userType); | |
| 77 | + | |
| 78 | + /** | |
| 79 | + * 标记站内信为已读 | |
| 80 | + * | |
| 81 | + * @param ids 站内信编号集合 | |
| 82 | + * @param userId 用户编号 | |
| 83 | + * @param userType 用户类型 | |
| 84 | + * @return 更新到的条数 | |
| 85 | + */ | |
| 86 | + int updateNotifyMessageRead(Collection<Long> ids, Long userId, Integer userType); | |
| 87 | + | |
| 88 | + /** | |
| 89 | + * 标记所有站内信为已读 | |
| 90 | + * | |
| 91 | + * @param userId 用户编号 | |
| 92 | + * @param userType 用户类型 | |
| 93 | + * @return 更新到的条数 | |
| 94 | + */ | |
| 95 | + int updateAllNotifyMessageRead(Long userId, Integer userType); | |
| 96 | + | |
| 97 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/notify/NotifyMessageServiceImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.service.notify; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.system.controller.admin.notify.vo.message.NotifyMessageMyPageReqVO; | |
| 5 | +import cn.iocoder.yudao.module.system.controller.admin.notify.vo.message.NotifyMessagePageReqVO; | |
| 6 | +import cn.iocoder.yudao.module.system.dal.dataobject.notify.NotifyMessageDO; | |
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.notify.NotifyTemplateDO; | |
| 8 | +import cn.iocoder.yudao.module.system.dal.mysql.notify.NotifyMessageMapper; | |
| 9 | +import org.springframework.stereotype.Service; | |
| 10 | +import org.springframework.validation.annotation.Validated; | |
| 11 | + | |
| 12 | +import javax.annotation.Resource; | |
| 13 | +import java.util.Collection; | |
| 14 | +import java.util.List; | |
| 15 | +import java.util.Map; | |
| 16 | + | |
| 17 | +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 18 | + | |
| 19 | +/** | |
| 20 | + * 站内信 Service 实现类 | |
| 21 | + * | |
| 22 | + * @author xrcoder | |
| 23 | + */ | |
| 24 | +@Service | |
| 25 | +@Validated | |
| 26 | +public class NotifyMessageServiceImpl implements NotifyMessageService { | |
| 27 | + | |
| 28 | + @Resource | |
| 29 | + private NotifyMessageMapper notifyMessageMapper; | |
| 30 | + | |
| 31 | + @Override | |
| 32 | + public Long createNotifyMessage(Long userId, Integer userType, | |
| 33 | + NotifyTemplateDO template, String templateContent, Map<String, Object> templateParams) { | |
| 34 | + NotifyMessageDO message = new NotifyMessageDO().setUserId(userId).setUserType(userType) | |
| 35 | + .setTemplateId(template.getId()).setTemplateCode(template.getCode()) | |
| 36 | + .setTemplateType(template.getType()).setTemplateNickname(template.getNickname()) | |
| 37 | + .setTemplateContent(templateContent).setTemplateParams(templateParams).setReadStatus(false); | |
| 38 | + notifyMessageMapper.insert(message); | |
| 39 | + return message.getId(); | |
| 40 | + } | |
| 41 | + | |
| 42 | + @Override | |
| 43 | + public PageResult<NotifyMessageDO> getNotifyMessagePage(NotifyMessagePageReqVO pageReqVO) { | |
| 44 | + return notifyMessageMapper.selectPage(pageReqVO); | |
| 45 | + } | |
| 46 | + | |
| 47 | + @Override | |
| 48 | + public PageResult<NotifyMessageDO> getMyMyNotifyMessagePage(NotifyMessageMyPageReqVO pageReqVO, Long userId, Integer userType) { | |
| 49 | + return notifyMessageMapper.selectPage(pageReqVO, userId, userType); | |
| 50 | + } | |
| 51 | + | |
| 52 | + @Override | |
| 53 | + public NotifyMessageDO getNotifyMessage(Long id) { | |
| 54 | + return notifyMessageMapper.selectById(id); | |
| 55 | + } | |
| 56 | + | |
| 57 | + @Override | |
| 58 | + public List<NotifyMessageDO> getUnreadNotifyMessageList(Long userId, Integer userType, Integer size) { | |
| 59 | + return notifyMessageMapper.selectUnreadListByUserIdAndUserType(userId, userType, size); | |
| 60 | + } | |
| 61 | + | |
| 62 | + @Override | |
| 63 | + public Long getUnreadNotifyMessageCount(Long userId, Integer userType) { | |
| 64 | + return notifyMessageMapper.selectUnreadCountByUserIdAndUserType(userId, userType); | |
| 65 | + } | |
| 66 | + | |
| 67 | + @Override | |
| 68 | + public int updateNotifyMessageRead(Collection<Long> ids, Long userId, Integer userType) { | |
| 69 | + return notifyMessageMapper.updateListRead(ids, userId, userType); | |
| 70 | + } | |
| 71 | + | |
| 72 | + @Override | |
| 73 | + public int updateAllNotifyMessageRead(Long userId, Integer userType) { | |
| 74 | + return notifyMessageMapper.updateListRead(userId, userType); | |
| 75 | + } | |
| 76 | + | |
| 77 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/notify/NotifySendService.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.service.notify; | |
| 2 | + | |
| 3 | +import java.util.List; | |
| 4 | +import java.util.Map; | |
| 5 | + | |
| 6 | +/** | |
| 7 | + * 站内信发送 Service 接口 | |
| 8 | + * | |
| 9 | + * @author xrcoder | |
| 10 | + */ | |
| 11 | +public interface NotifySendService { | |
| 12 | + | |
| 13 | + /** | |
| 14 | + * 发送单条站内信给管理后台的用户 | |
| 15 | + * | |
| 16 | + * 在 mobile 为空时,使用 userId 加载对应管理员的手机号 | |
| 17 | + * | |
| 18 | + * @param userId 用户编号 | |
| 19 | + * @param templateCode 短信模板编号 | |
| 20 | + * @param templateParams 短信模板参数 | |
| 21 | + * @return 发送日志编号 | |
| 22 | + */ | |
| 23 | + Long sendSingleNotifyToAdmin(Long userId, | |
| 24 | + String templateCode, Map<String, Object> templateParams); | |
| 25 | + /** | |
| 26 | + * 发送单条站内信给用户 APP 的用户 | |
| 27 | + * | |
| 28 | + * 在 mobile 为空时,使用 userId 加载对应会员的手机号 | |
| 29 | + * | |
| 30 | + * @param userId 用户编号 | |
| 31 | + * @param templateCode 站内信模板编号 | |
| 32 | + * @param templateParams 站内信模板参数 | |
| 33 | + * @return 发送日志编号 | |
| 34 | + */ | |
| 35 | + Long sendSingleNotifyToMember(Long userId, | |
| 36 | + String templateCode, Map<String, Object> templateParams); | |
| 37 | + | |
| 38 | + /** | |
| 39 | + * 发送单条站内信给用户 | |
| 40 | + * | |
| 41 | + * @param userId 用户编号 | |
| 42 | + * @param userType 用户类型 | |
| 43 | + * @param templateCode 站内信模板编号 | |
| 44 | + * @param templateParams 站内信模板参数 | |
| 45 | + * @return 发送日志编号 | |
| 46 | + */ | |
| 47 | + Long sendSingleNotify( Long userId, Integer userType, | |
| 48 | + String templateCode, Map<String, Object> templateParams); | |
| 49 | + | |
| 50 | + default void sendBatchNotify(List<String> mobiles, List<Long> userIds, Integer userType, | |
| 51 | + String templateCode, Map<String, Object> templateParams) { | |
| 52 | + throw new UnsupportedOperationException("暂时不支持该操作,感兴趣可以实现该功能哟!"); | |
| 53 | + } | |
| 54 | + | |
| 55 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/notify/NotifySendServiceImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.service.notify; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | |
| 4 | +import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | |
| 5 | +import cn.iocoder.yudao.module.system.dal.dataobject.notify.NotifyTemplateDO; | |
| 6 | +import com.google.common.annotations.VisibleForTesting; | |
| 7 | +import lombok.extern.slf4j.Slf4j; | |
| 8 | +import org.springframework.stereotype.Service; | |
| 9 | +import org.springframework.validation.annotation.Validated; | |
| 10 | + | |
| 11 | +import javax.annotation.Resource; | |
| 12 | +import java.util.Map; | |
| 13 | +import java.util.Objects; | |
| 14 | + | |
| 15 | +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 16 | +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; | |
| 17 | + | |
| 18 | +/** | |
| 19 | + * 站内信发送 Service 实现类 | |
| 20 | + * | |
| 21 | + * @author xrcoder | |
| 22 | + */ | |
| 23 | +@Service | |
| 24 | +@Validated | |
| 25 | +@Slf4j | |
| 26 | +public class NotifySendServiceImpl implements NotifySendService { | |
| 27 | + | |
| 28 | + @Resource | |
| 29 | + private NotifyTemplateService notifyTemplateService; | |
| 30 | + | |
| 31 | + @Resource | |
| 32 | + private NotifyMessageService notifyMessageService; | |
| 33 | + | |
| 34 | + @Override | |
| 35 | + public Long sendSingleNotifyToAdmin(Long userId, String templateCode, Map<String, Object> templateParams) { | |
| 36 | + return sendSingleNotify(userId, UserTypeEnum.ADMIN.getValue(), templateCode, templateParams); | |
| 37 | + } | |
| 38 | + | |
| 39 | + @Override | |
| 40 | + public Long sendSingleNotifyToMember(Long userId, String templateCode, Map<String, Object> templateParams) { | |
| 41 | + return sendSingleNotify(userId, UserTypeEnum.MEMBER.getValue(), templateCode, templateParams); | |
| 42 | + } | |
| 43 | + | |
| 44 | + @Override | |
| 45 | + public Long sendSingleNotify(Long userId, Integer userType, String templateCode, Map<String, Object> templateParams) { | |
| 46 | + // 校验模版 | |
| 47 | + NotifyTemplateDO template = checkNotifyTemplateValid(templateCode); | |
| 48 | + if (Objects.equals(template.getStatus(), CommonStatusEnum.DISABLE.getStatus())) { | |
| 49 | + log.info("[sendSingleNotify][模版({})已经关闭,无法给用户({}/{})发送]", templateCode, userId, userType); | |
| 50 | + return null; | |
| 51 | + } | |
| 52 | + // 校验参数 | |
| 53 | + checkTemplateParams(template, templateParams); | |
| 54 | + | |
| 55 | + // 发送站内信 | |
| 56 | + String content = notifyTemplateService.formatNotifyTemplateContent(template.getContent(), templateParams); | |
| 57 | + return notifyMessageService.createNotifyMessage(userId, userType, template, content, templateParams); | |
| 58 | + } | |
| 59 | + | |
| 60 | + @VisibleForTesting | |
| 61 | + public NotifyTemplateDO checkNotifyTemplateValid(String templateCode) { | |
| 62 | + // 获得站内信模板。考虑到效率,从缓存中获取 | |
| 63 | + NotifyTemplateDO template = notifyTemplateService.getNotifyTemplateByCodeFromCache(templateCode); | |
| 64 | + // 站内信模板不存在 | |
| 65 | + if (template == null) { | |
| 66 | + throw exception(NOTICE_NOT_FOUND); | |
| 67 | + } | |
| 68 | + return template; | |
| 69 | + } | |
| 70 | + | |
| 71 | + /** | |
| 72 | + * 校验站内信模版参数是否确实 | |
| 73 | + * | |
| 74 | + * @param template 邮箱模板 | |
| 75 | + * @param templateParams 参数列表 | |
| 76 | + */ | |
| 77 | + @VisibleForTesting | |
| 78 | + public void checkTemplateParams(NotifyTemplateDO template, Map<String, Object> templateParams) { | |
| 79 | + template.getParams().forEach(key -> { | |
| 80 | + Object value = templateParams.get(key); | |
| 81 | + if (value == null) { | |
| 82 | + throw exception(NOTIFY_SEND_TEMPLATE_PARAM_MISS, key); | |
| 83 | + } | |
| 84 | + }); | |
| 85 | + } | |
| 86 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/notify/NotifyTemplateService.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.service.notify; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.system.controller.admin.notify.vo.template.NotifyTemplateCreateReqVO; | |
| 5 | +import cn.iocoder.yudao.module.system.controller.admin.notify.vo.template.NotifyTemplatePageReqVO; | |
| 6 | +import cn.iocoder.yudao.module.system.controller.admin.notify.vo.template.NotifyTemplateUpdateReqVO; | |
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.notify.NotifyTemplateDO; | |
| 8 | + | |
| 9 | +import javax.validation.Valid; | |
| 10 | +import java.util.Map; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 站内信模版 Service 接口 | |
| 14 | + * | |
| 15 | + * @author xrcoder | |
| 16 | + */ | |
| 17 | +public interface NotifyTemplateService { | |
| 18 | + | |
| 19 | + /** | |
| 20 | + * 初始化站内信模板的本地缓存 | |
| 21 | + */ | |
| 22 | + void initLocalCache(); | |
| 23 | + | |
| 24 | + /** | |
| 25 | + * 获得站内信模板,从缓存中 | |
| 26 | + * | |
| 27 | + * @param code 模板编码 | |
| 28 | + * @return 站内信模板 | |
| 29 | + */ | |
| 30 | + NotifyTemplateDO getNotifyTemplateByCodeFromCache(String code); | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * 创建站内信模版 | |
| 34 | + * | |
| 35 | + * @param createReqVO 创建信息 | |
| 36 | + * @return 编号 | |
| 37 | + */ | |
| 38 | + Long createNotifyTemplate(@Valid NotifyTemplateCreateReqVO createReqVO); | |
| 39 | + | |
| 40 | + /** | |
| 41 | + * 更新站内信模版 | |
| 42 | + * | |
| 43 | + * @param updateReqVO 更新信息 | |
| 44 | + */ | |
| 45 | + void updateNotifyTemplate(@Valid NotifyTemplateUpdateReqVO updateReqVO); | |
| 46 | + | |
| 47 | + /** | |
| 48 | + * 删除站内信模版 | |
| 49 | + * | |
| 50 | + * @param id 编号 | |
| 51 | + */ | |
| 52 | + void deleteNotifyTemplate(Long id); | |
| 53 | + | |
| 54 | + /** | |
| 55 | + * 获得站内信模版 | |
| 56 | + * | |
| 57 | + * @param id 编号 | |
| 58 | + * @return 站内信模版 | |
| 59 | + */ | |
| 60 | + NotifyTemplateDO getNotifyTemplate(Long id); | |
| 61 | + | |
| 62 | + /** | |
| 63 | + * 获得站内信模版分页 | |
| 64 | + * | |
| 65 | + * @param pageReqVO 分页查询 | |
| 66 | + * @return 站内信模版分页 | |
| 67 | + */ | |
| 68 | + PageResult<NotifyTemplateDO> getNotifyTemplatePage(NotifyTemplatePageReqVO pageReqVO); | |
| 69 | + | |
| 70 | + /** | |
| 71 | + * 格式化站内信内容 | |
| 72 | + * | |
| 73 | + * @param content 站内信模板的内容 | |
| 74 | + * @param params 站内信内容的参数 | |
| 75 | + * @return 格式化后的内容 | |
| 76 | + */ | |
| 77 | + String formatNotifyTemplateContent(String content, Map<String, Object> params); | |
| 78 | + | |
| 79 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/notify/NotifyTemplateServiceImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.service.notify; | |
| 2 | + | |
| 3 | +import cn.hutool.core.util.ReUtil; | |
| 4 | +import cn.hutool.core.util.StrUtil; | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | +import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; | |
| 7 | +import cn.iocoder.yudao.module.system.controller.admin.notify.vo.template.NotifyTemplateCreateReqVO; | |
| 8 | +import cn.iocoder.yudao.module.system.controller.admin.notify.vo.template.NotifyTemplatePageReqVO; | |
| 9 | +import cn.iocoder.yudao.module.system.controller.admin.notify.vo.template.NotifyTemplateUpdateReqVO; | |
| 10 | +import cn.iocoder.yudao.module.system.convert.notify.NotifyTemplateConvert; | |
| 11 | +import cn.iocoder.yudao.module.system.dal.dataobject.notify.NotifyTemplateDO; | |
| 12 | +import cn.iocoder.yudao.module.system.dal.mysql.notify.NotifyTemplateMapper; | |
| 13 | +import cn.iocoder.yudao.module.system.mq.producer.notify.NotifyProducer; | |
| 14 | +import com.google.common.annotations.VisibleForTesting; | |
| 15 | +import lombok.extern.slf4j.Slf4j; | |
| 16 | +import org.springframework.stereotype.Service; | |
| 17 | +import org.springframework.validation.annotation.Validated; | |
| 18 | + | |
| 19 | +import javax.annotation.PostConstruct; | |
| 20 | +import javax.annotation.Resource; | |
| 21 | +import java.util.List; | |
| 22 | +import java.util.Map; | |
| 23 | +import java.util.regex.Pattern; | |
| 24 | + | |
| 25 | +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 26 | +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; | |
| 27 | + | |
| 28 | +/** | |
| 29 | + * 站内信模版 Service 实现类 | |
| 30 | + * | |
| 31 | + * @author xrcoder | |
| 32 | + */ | |
| 33 | +@Service | |
| 34 | +@Validated | |
| 35 | +@Slf4j | |
| 36 | +public class NotifyTemplateServiceImpl implements NotifyTemplateService { | |
| 37 | + | |
| 38 | + /** | |
| 39 | + * 正则表达式,匹配 {} 中的变量 | |
| 40 | + */ | |
| 41 | + private static final Pattern PATTERN_PARAMS = Pattern.compile("\\{(.*?)}"); | |
| 42 | + | |
| 43 | + @Resource | |
| 44 | + private NotifyTemplateMapper notifyTemplateMapper; | |
| 45 | + | |
| 46 | + @Resource | |
| 47 | + private NotifyProducer notifyProducer; | |
| 48 | + | |
| 49 | + /** | |
| 50 | + * 站内信模板缓存 | |
| 51 | + * key:站内信模板编码 {@link NotifyTemplateDO#getCode()} | |
| 52 | + * <p> | |
| 53 | + * 这里声明 volatile 修饰的原因是,每次刷新时,直接修改指向 | |
| 54 | + */ | |
| 55 | + private volatile Map<String, NotifyTemplateDO> notifyTemplateCache; | |
| 56 | + | |
| 57 | + /** | |
| 58 | + * 初始化站内信模板的本地缓存 | |
| 59 | + */ | |
| 60 | + @Override | |
| 61 | + @PostConstruct | |
| 62 | + public void initLocalCache() { | |
| 63 | + // 第一步:查询数据 | |
| 64 | + List<NotifyTemplateDO> templates = notifyTemplateMapper.selectList(); | |
| 65 | + log.info("[initLocalCache][缓存站内信模版,数量为:{}]", templates.size()); | |
| 66 | + | |
| 67 | + // 第二步:构建缓存 | |
| 68 | + notifyTemplateCache = CollectionUtils.convertMap(templates, NotifyTemplateDO::getCode); | |
| 69 | + } | |
| 70 | + | |
| 71 | + @Override | |
| 72 | + public NotifyTemplateDO getNotifyTemplateByCodeFromCache(String code) { | |
| 73 | + return notifyTemplateCache.get(code); | |
| 74 | + } | |
| 75 | + | |
| 76 | + @Override | |
| 77 | + public Long createNotifyTemplate(NotifyTemplateCreateReqVO createReqVO) { | |
| 78 | + // 校验站内信编码是否重复 | |
| 79 | + checkNotifyTemplateCodeDuplicate(null, createReqVO.getCode()); | |
| 80 | + | |
| 81 | + // 插入 | |
| 82 | + NotifyTemplateDO notifyTemplate = NotifyTemplateConvert.INSTANCE.convert(createReqVO); | |
| 83 | + notifyTemplate.setParams(parseTemplateContentParams(notifyTemplate.getContent())); | |
| 84 | + notifyTemplateMapper.insert(notifyTemplate); | |
| 85 | + | |
| 86 | + // 发送刷新消息 | |
| 87 | + notifyProducer.sendNotifyTemplateRefreshMessage(); | |
| 88 | + return notifyTemplate.getId(); | |
| 89 | + } | |
| 90 | + | |
| 91 | + @Override | |
| 92 | + public void updateNotifyTemplate(NotifyTemplateUpdateReqVO updateReqVO) { | |
| 93 | + // 校验存在 | |
| 94 | + validateNotifyTemplateExists(updateReqVO.getId()); | |
| 95 | + // 校验站内信编码是否重复 | |
| 96 | + checkNotifyTemplateCodeDuplicate(updateReqVO.getId(), updateReqVO.getCode()); | |
| 97 | + | |
| 98 | + // 更新 | |
| 99 | + NotifyTemplateDO updateObj = NotifyTemplateConvert.INSTANCE.convert(updateReqVO); | |
| 100 | + updateObj.setParams(parseTemplateContentParams(updateObj.getContent())); | |
| 101 | + notifyTemplateMapper.updateById(updateObj); | |
| 102 | + | |
| 103 | + // 发送刷新消息 | |
| 104 | + notifyProducer.sendNotifyTemplateRefreshMessage(); | |
| 105 | + } | |
| 106 | + | |
| 107 | + @VisibleForTesting | |
| 108 | + public List<String> parseTemplateContentParams(String content) { | |
| 109 | + return ReUtil.findAllGroup1(PATTERN_PARAMS, content); | |
| 110 | + } | |
| 111 | + | |
| 112 | + @Override | |
| 113 | + public void deleteNotifyTemplate(Long id) { | |
| 114 | + // 校验存在 | |
| 115 | + validateNotifyTemplateExists(id); | |
| 116 | + // 删除 | |
| 117 | + notifyTemplateMapper.deleteById(id); | |
| 118 | + // 发送刷新消息 | |
| 119 | + notifyProducer.sendNotifyTemplateRefreshMessage(); | |
| 120 | + } | |
| 121 | + | |
| 122 | + private void validateNotifyTemplateExists(Long id) { | |
| 123 | + if (notifyTemplateMapper.selectById(id) == null) { | |
| 124 | + throw exception(NOTIFY_TEMPLATE_NOT_EXISTS); | |
| 125 | + } | |
| 126 | + } | |
| 127 | + | |
| 128 | + @Override | |
| 129 | + public NotifyTemplateDO getNotifyTemplate(Long id) { | |
| 130 | + return notifyTemplateMapper.selectById(id); | |
| 131 | + } | |
| 132 | + | |
| 133 | + @Override | |
| 134 | + public PageResult<NotifyTemplateDO> getNotifyTemplatePage(NotifyTemplatePageReqVO pageReqVO) { | |
| 135 | + return notifyTemplateMapper.selectPage(pageReqVO); | |
| 136 | + } | |
| 137 | + | |
| 138 | + @VisibleForTesting | |
| 139 | + public void checkNotifyTemplateCodeDuplicate(Long id, String code) { | |
| 140 | + NotifyTemplateDO template = notifyTemplateMapper.selectByCode(code); | |
| 141 | + if (template == null) { | |
| 142 | + return; | |
| 143 | + } | |
| 144 | + // 如果 id 为空,说明不用比较是否为相同 id 的字典类型 | |
| 145 | + if (id == null) { | |
| 146 | + throw exception(NOTIFY_TEMPLATE_CODE_DUPLICATE, code); | |
| 147 | + } | |
| 148 | + if (!template.getId().equals(id)) { | |
| 149 | + throw exception(NOTIFY_TEMPLATE_CODE_DUPLICATE, code); | |
| 150 | + } | |
| 151 | + } | |
| 152 | + | |
| 153 | + /** | |
| 154 | + * 格式化站内信内容 | |
| 155 | + * | |
| 156 | + * @param content 站内信模板的内容 | |
| 157 | + * @param params 站内信内容的参数 | |
| 158 | + * @return 格式化后的内容 | |
| 159 | + */ | |
| 160 | + @Override | |
| 161 | + public String formatNotifyTemplateContent(String content, Map<String, Object> params) { | |
| 162 | + return StrUtil.format(content, params); | |
| 163 | + } | |
| 164 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsChannelServiceImpl.java
| ... | ... | @@ -81,7 +81,7 @@ public class SmsChannelServiceImpl implements SmsChannelService { |
| 81 | 81 | public void deleteSmsChannel(Long id) { |
| 82 | 82 | // 校验存在 |
| 83 | 83 | this.validateSmsChannelExists(id); |
| 84 | - // 校验是否有字典数据 | |
| 84 | + // 校验是否有在使用该账号的模版 | |
| 85 | 85 | if (smsTemplateService.countByChannelId(id) > 0) { |
| 86 | 86 | throw exception(SMS_CHANNEL_HAS_CHILDREN); |
| 87 | 87 | } | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/sms/SmsTemplateServiceImpl.java
yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/mail/MailAccountServiceImplTest.java
0 → 100755
| 1 | +package cn.iocoder.yudao.module.system.service.mail; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; | |
| 5 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.MailAccountCreateReqVO; | |
| 6 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.MailAccountPageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.account.MailAccountUpdateReqVO; | |
| 8 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailAccountDO; | |
| 9 | +import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO; | |
| 10 | +import cn.iocoder.yudao.module.system.dal.mysql.mail.MailAccountMapper; | |
| 11 | +import cn.iocoder.yudao.module.system.mq.producer.mail.MailProducer; | |
| 12 | +import org.junit.jupiter.api.Test; | |
| 13 | +import org.springframework.boot.test.mock.mockito.MockBean; | |
| 14 | +import org.springframework.context.annotation.Import; | |
| 15 | + | |
| 16 | +import javax.annotation.Resource; | |
| 17 | + | |
| 18 | +import java.util.Map; | |
| 19 | + | |
| 20 | +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; | |
| 21 | +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; | |
| 22 | +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; | |
| 23 | +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; | |
| 24 | +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.MAIL_ACCOUNT_NOT_EXISTS; | |
| 25 | +import static org.junit.jupiter.api.Assertions.*; | |
| 26 | +import static org.mockito.Mockito.verify; | |
| 27 | + | |
| 28 | +/** | |
| 29 | +* {@link MailAccountServiceImpl} 的单元测试类 | |
| 30 | +* | |
| 31 | +* @author 芋道源码 | |
| 32 | +*/ | |
| 33 | +@Import(MailAccountServiceImpl.class) | |
| 34 | +public class MailAccountServiceImplTest extends BaseDbUnitTest { | |
| 35 | + | |
| 36 | + @Resource | |
| 37 | + private MailAccountServiceImpl mailAccountService; | |
| 38 | + | |
| 39 | + @Resource | |
| 40 | + private MailAccountMapper mailAccountMapper; | |
| 41 | + | |
| 42 | + @MockBean | |
| 43 | + private MailTemplateService mailTemplateService; | |
| 44 | + @MockBean | |
| 45 | + private MailProducer mailProducer; | |
| 46 | + | |
| 47 | + @Test | |
| 48 | + public void testInitLocalCache() { | |
| 49 | + MailAccountDO accountDO1 = randomPojo(MailAccountDO.class); | |
| 50 | + mailAccountMapper.insert(accountDO1); | |
| 51 | + MailAccountDO accountDO02 = randomPojo(MailAccountDO.class); | |
| 52 | + mailAccountMapper.insert(accountDO02); | |
| 53 | + | |
| 54 | + // 调用 | |
| 55 | + mailAccountService.initLocalCache(); | |
| 56 | + // 断言 mailAccountCache 缓存 | |
| 57 | + Map<Long, MailAccountDO> mailAccountCache = mailAccountService.getMailAccountCache(); | |
| 58 | + assertPojoEquals(accountDO1, mailAccountCache.get(accountDO1.getId())); | |
| 59 | + assertPojoEquals(accountDO02, mailAccountCache.get(accountDO02.getId())); | |
| 60 | + } | |
| 61 | + | |
| 62 | + @Test | |
| 63 | + public void testCreateMailAccount_success() { | |
| 64 | + // 准备参数 | |
| 65 | + MailAccountCreateReqVO reqVO = randomPojo(MailAccountCreateReqVO.class, o -> o.setMail(randomEmail())); | |
| 66 | + | |
| 67 | + // 调用 | |
| 68 | + Long mailAccountId = mailAccountService.createMailAccount(reqVO); | |
| 69 | + // 断言 | |
| 70 | + assertNotNull(mailAccountId); | |
| 71 | + // 校验记录的属性是否正确 | |
| 72 | + MailAccountDO mailAccount = mailAccountMapper.selectById(mailAccountId); | |
| 73 | + assertPojoEquals(reqVO, mailAccount); | |
| 74 | + verify(mailProducer).sendMailAccountRefreshMessage(); | |
| 75 | + } | |
| 76 | + | |
| 77 | + @Test | |
| 78 | + public void testUpdateMailAccount_success() { | |
| 79 | + // mock 数据 | |
| 80 | + MailAccountDO dbMailAccount = randomPojo(MailAccountDO.class); | |
| 81 | + mailAccountMapper.insert(dbMailAccount);// @Sql: 先插入出一条存在的数据 | |
| 82 | + // 准备参数 | |
| 83 | + MailAccountUpdateReqVO reqVO = randomPojo(MailAccountUpdateReqVO.class, o -> { | |
| 84 | + o.setId(dbMailAccount.getId()); // 设置更新的 ID | |
| 85 | + o.setMail(randomEmail()); | |
| 86 | + }); | |
| 87 | + | |
| 88 | + // 调用 | |
| 89 | + mailAccountService.updateMailAccount(reqVO); | |
| 90 | + // 校验是否更新正确 | |
| 91 | + MailAccountDO mailAccount = mailAccountMapper.selectById(reqVO.getId()); // 获取最新的 | |
| 92 | + assertPojoEquals(reqVO, mailAccount); | |
| 93 | + verify(mailProducer).sendMailAccountRefreshMessage(); | |
| 94 | + } | |
| 95 | + | |
| 96 | + @Test | |
| 97 | + public void testUpdateMailAccount_notExists() { | |
| 98 | + // 准备参数 | |
| 99 | + MailAccountUpdateReqVO reqVO = randomPojo(MailAccountUpdateReqVO.class); | |
| 100 | + | |
| 101 | + // 调用, 并断言异常 | |
| 102 | + assertServiceException(() -> mailAccountService.updateMailAccount(reqVO), MAIL_ACCOUNT_NOT_EXISTS); | |
| 103 | + } | |
| 104 | + | |
| 105 | + @Test | |
| 106 | + public void testDeleteMailAccount_success() { | |
| 107 | + // mock 数据 | |
| 108 | + MailAccountDO dbMailAccount = randomPojo(MailAccountDO.class); | |
| 109 | + mailAccountMapper.insert(dbMailAccount);// @Sql: 先插入出一条存在的数据 | |
| 110 | + // 准备参数 | |
| 111 | + Long id = dbMailAccount.getId(); | |
| 112 | + | |
| 113 | + // 调用 | |
| 114 | + mailAccountService.deleteMailAccount(id); | |
| 115 | + // 校验数据不存在了 | |
| 116 | + assertNull(mailAccountMapper.selectById(id)); | |
| 117 | + verify(mailProducer).sendMailAccountRefreshMessage(); | |
| 118 | + } | |
| 119 | + | |
| 120 | + @Test | |
| 121 | + public void testDeleteMailAccount_notExists() { | |
| 122 | + // 准备参数 | |
| 123 | + Long id = randomLongId(); | |
| 124 | + | |
| 125 | + // 调用, 并断言异常 | |
| 126 | + assertServiceException(() -> mailAccountService.deleteMailAccount(id), MAIL_ACCOUNT_NOT_EXISTS); | |
| 127 | + } | |
| 128 | + | |
| 129 | + @Test | |
| 130 | + public void testGetMailAccountPage() { | |
| 131 | + // mock 数据 | |
| 132 | + MailAccountDO dbMailAccount = randomPojo(MailAccountDO.class, o -> { // 等会查询到 | |
| 133 | + o.setMail("768@qq.com"); | |
| 134 | + o.setUsername("yunai"); | |
| 135 | + }); | |
| 136 | + mailAccountMapper.insert(dbMailAccount); | |
| 137 | + // 测试 mail 不匹配 | |
| 138 | + mailAccountMapper.insert(cloneIgnoreId(dbMailAccount, o -> o.setMail("788@qq.com"))); | |
| 139 | + // 测试 username 不匹配 | |
| 140 | + mailAccountMapper.insert(cloneIgnoreId(dbMailAccount, o -> o.setUsername("tudou"))); | |
| 141 | + // 准备参数 | |
| 142 | + MailAccountPageReqVO reqVO = new MailAccountPageReqVO(); | |
| 143 | + reqVO.setMail("768"); | |
| 144 | + reqVO.setUsername("yu"); | |
| 145 | + | |
| 146 | + // 调用 | |
| 147 | + PageResult<MailAccountDO> pageResult = mailAccountService.getMailAccountPage(reqVO); | |
| 148 | + // 断言 | |
| 149 | + assertEquals(1, pageResult.getTotal()); | |
| 150 | + assertEquals(1, pageResult.getList().size()); | |
| 151 | + assertPojoEquals(dbMailAccount, pageResult.getList().get(0)); | |
| 152 | + } | |
| 153 | + | |
| 154 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/mail/MailLogServiceImplTest.java
0 → 100755
| 1 | +package cn.iocoder.yudao.module.system.service.mail; | |
| 2 | + | |
| 3 | +import cn.hutool.core.map.MapUtil; | |
| 4 | +import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; | |
| 7 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.log.MailLogPageReqVO; | |
| 8 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailAccountDO; | |
| 9 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailLogDO; | |
| 10 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO; | |
| 11 | +import cn.iocoder.yudao.module.system.dal.mysql.mail.MailLogMapper; | |
| 12 | +import cn.iocoder.yudao.module.system.enums.mail.MailSendStatusEnum; | |
| 13 | +import org.junit.jupiter.api.Test; | |
| 14 | +import org.springframework.context.annotation.Import; | |
| 15 | + | |
| 16 | +import javax.annotation.Resource; | |
| 17 | +import java.util.Map; | |
| 18 | + | |
| 19 | +import static cn.hutool.core.util.RandomUtil.randomEle; | |
| 20 | +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.buildTime; | |
| 21 | +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; | |
| 22 | +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; | |
| 23 | +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; | |
| 24 | +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; | |
| 25 | +import static org.junit.jupiter.api.Assertions.*; | |
| 26 | + | |
| 27 | +/** | |
| 28 | +* {@link MailLogServiceImpl} 的单元测试类 | |
| 29 | +* | |
| 30 | +* @author 芋道源码 | |
| 31 | +*/ | |
| 32 | +@Import(MailLogServiceImpl.class) | |
| 33 | +public class MailLogServiceImplTest extends BaseDbUnitTest { | |
| 34 | + | |
| 35 | + @Resource | |
| 36 | + private MailLogServiceImpl mailLogService; | |
| 37 | + | |
| 38 | + @Resource | |
| 39 | + private MailLogMapper mailLogMapper; | |
| 40 | + | |
| 41 | + @Test | |
| 42 | + public void testCreateMailLog() { | |
| 43 | + // 准备参数 | |
| 44 | + Long userId = randomLongId(); | |
| 45 | + Integer userType = randomEle(UserTypeEnum.values()).getValue(); | |
| 46 | + String toMail = randomEmail(); | |
| 47 | + MailAccountDO account = randomPojo(MailAccountDO.class); | |
| 48 | + MailTemplateDO template = randomPojo(MailTemplateDO.class); | |
| 49 | + String templateContent = randomString(); | |
| 50 | + Map<String, Object> templateParams = randomTemplateParams(); | |
| 51 | + Boolean isSend = true; | |
| 52 | + // mock 方法 | |
| 53 | + | |
| 54 | + // 调用 | |
| 55 | + Long logId = mailLogService.createMailLog(userId, userType, toMail, account, template, templateContent, templateParams, isSend); | |
| 56 | + // 断言 | |
| 57 | + MailLogDO log = mailLogMapper.selectById(logId); | |
| 58 | + assertNotNull(log); | |
| 59 | + assertEquals(MailSendStatusEnum.INIT.getStatus(), log.getSendStatus()); | |
| 60 | + assertEquals(userId, log.getUserId()); | |
| 61 | + assertEquals(userType, log.getUserType()); | |
| 62 | + assertEquals(toMail, log.getToMail()); | |
| 63 | + assertEquals(account.getId(), log.getAccountId()); | |
| 64 | + assertEquals(account.getMail(), log.getFromMail()); | |
| 65 | + assertEquals(template.getId(), log.getTemplateId()); | |
| 66 | + assertEquals(template.getCode(), log.getTemplateCode()); | |
| 67 | + assertEquals(template.getNickname(), log.getTemplateNickname()); | |
| 68 | + assertEquals(template.getTitle(), log.getTemplateTitle()); | |
| 69 | + assertEquals(templateContent, log.getTemplateContent()); | |
| 70 | + assertEquals(templateParams, log.getTemplateParams()); | |
| 71 | + } | |
| 72 | + | |
| 73 | + @Test | |
| 74 | + public void testUpdateMailSendResult_success() { | |
| 75 | + // mock 数据 | |
| 76 | + MailLogDO log = randomPojo(MailLogDO.class, o -> { | |
| 77 | + o.setSendStatus(MailSendStatusEnum.INIT.getStatus()); | |
| 78 | + o.setSendTime(null).setSendMessageId(null).setSendException(null) | |
| 79 | + .setTemplateParams(randomTemplateParams()); | |
| 80 | + }); | |
| 81 | + mailLogMapper.insert(log); | |
| 82 | + // 准备参数 | |
| 83 | + Long logId = log.getId(); | |
| 84 | + String messageId = randomString(); | |
| 85 | + | |
| 86 | + // 调用 | |
| 87 | + mailLogService.updateMailSendResult(logId, messageId, null); | |
| 88 | + // 断言 | |
| 89 | + MailLogDO dbLog = mailLogMapper.selectById(logId); | |
| 90 | + assertEquals(MailSendStatusEnum.SUCCESS.getStatus(), dbLog.getSendStatus()); | |
| 91 | + assertNotNull(dbLog.getSendTime()); | |
| 92 | + assertEquals(messageId, dbLog.getSendMessageId()); | |
| 93 | + assertNull(dbLog.getSendException()); | |
| 94 | + } | |
| 95 | + | |
| 96 | + @Test | |
| 97 | + public void testUpdateMailSendResult_exception() { | |
| 98 | + // mock 数据 | |
| 99 | + MailLogDO log = randomPojo(MailLogDO.class, o -> { | |
| 100 | + o.setSendStatus(MailSendStatusEnum.INIT.getStatus()); | |
| 101 | + o.setSendTime(null).setSendMessageId(null).setSendException(null) | |
| 102 | + .setTemplateParams(randomTemplateParams()); | |
| 103 | + }); | |
| 104 | + mailLogMapper.insert(log); | |
| 105 | + // 准备参数 | |
| 106 | + Long logId = log.getId(); | |
| 107 | + Exception exception = new NullPointerException("测试异常"); | |
| 108 | + | |
| 109 | + // 调用 | |
| 110 | + mailLogService.updateMailSendResult(logId, null, exception); | |
| 111 | + // 断言 | |
| 112 | + MailLogDO dbLog = mailLogMapper.selectById(logId); | |
| 113 | + assertEquals(MailSendStatusEnum.FAILURE.getStatus(), dbLog.getSendStatus()); | |
| 114 | + assertNotNull(dbLog.getSendTime()); | |
| 115 | + assertNull(dbLog.getSendMessageId()); | |
| 116 | + assertEquals("NullPointerException: 测试异常", dbLog.getSendException()); | |
| 117 | + } | |
| 118 | + | |
| 119 | + @Test | |
| 120 | + public void testGetMailLogPage() { | |
| 121 | + // mock 数据 | |
| 122 | + MailLogDO dbMailLog = randomPojo(MailLogDO.class, o -> { // 等会查询到 | |
| 123 | + o.setUserId(1L); | |
| 124 | + o.setUserType(UserTypeEnum.ADMIN.getValue()); | |
| 125 | + o.setToMail("768@qq.com"); | |
| 126 | + o.setAccountId(10L); | |
| 127 | + o.setTemplateId(100L); | |
| 128 | + o.setSendStatus(MailSendStatusEnum.INIT.getStatus()); | |
| 129 | + o.setSendTime(buildTime(2023, 2, 10)); | |
| 130 | + o.setTemplateParams(randomTemplateParams()); | |
| 131 | + }); | |
| 132 | + mailLogMapper.insert(dbMailLog); | |
| 133 | + // 测试 userId 不匹配 | |
| 134 | + mailLogMapper.insert(cloneIgnoreId(dbMailLog, o -> o.setUserId(2L))); | |
| 135 | + // 测试 userType 不匹配 | |
| 136 | + mailLogMapper.insert(cloneIgnoreId(dbMailLog, o -> o.setUserType(UserTypeEnum.MEMBER.getValue()))); | |
| 137 | + // 测试 toMail 不匹配 | |
| 138 | + mailLogMapper.insert(cloneIgnoreId(dbMailLog, o -> o.setToMail("788@.qq.com"))); | |
| 139 | + // 测试 accountId 不匹配 | |
| 140 | + mailLogMapper.insert(cloneIgnoreId(dbMailLog, o -> o.setAccountId(11L))); | |
| 141 | + // 测试 templateId 不匹配 | |
| 142 | + mailLogMapper.insert(cloneIgnoreId(dbMailLog, o -> o.setTemplateId(101L))); | |
| 143 | + // 测试 sendStatus 不匹配 | |
| 144 | + mailLogMapper.insert(cloneIgnoreId(dbMailLog, o -> o.setSendStatus(MailSendStatusEnum.SUCCESS.getStatus()))); | |
| 145 | + // 测试 sendTime 不匹配 | |
| 146 | + mailLogMapper.insert(cloneIgnoreId(dbMailLog, o -> o.setSendTime(buildTime(2023, 3, 10)))); | |
| 147 | + // 准备参数 | |
| 148 | + MailLogPageReqVO reqVO = new MailLogPageReqVO(); | |
| 149 | + reqVO.setUserId(1L); | |
| 150 | + reqVO.setUserType(UserTypeEnum.ADMIN.getValue()); | |
| 151 | + reqVO.setToMail("768"); | |
| 152 | + reqVO.setAccountId(10L); | |
| 153 | + reqVO.setTemplateId(100L); | |
| 154 | + reqVO.setSendStatus(MailSendStatusEnum.INIT.getStatus()); | |
| 155 | + reqVO.setSendTime((buildBetweenTime(2023, 2, 1, 2023, 2, 15))); | |
| 156 | + | |
| 157 | + // 调用 | |
| 158 | + PageResult<MailLogDO> pageResult = mailLogService.getMailLogPage(reqVO); | |
| 159 | + // 断言 | |
| 160 | + assertEquals(1, pageResult.getTotal()); | |
| 161 | + assertEquals(1, pageResult.getList().size()); | |
| 162 | + assertPojoEquals(dbMailLog, pageResult.getList().get(0)); | |
| 163 | + } | |
| 164 | + | |
| 165 | + private static Map<String, Object> randomTemplateParams() { | |
| 166 | + return MapUtil.<String, Object>builder().put(randomString(), randomString()) | |
| 167 | + .put(randomString(), randomString()).build(); | |
| 168 | + } | |
| 169 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/mail/MailSendServiceImplTest.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.service.mail; | |
| 2 | + | |
| 3 | +import cn.hutool.core.map.MapUtil; | |
| 4 | +import cn.hutool.extra.mail.MailAccount; | |
| 5 | +import cn.hutool.extra.mail.MailUtil; | |
| 6 | +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | |
| 7 | +import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | |
| 8 | +import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest; | |
| 9 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailAccountDO; | |
| 10 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO; | |
| 11 | +import cn.iocoder.yudao.module.system.mq.producer.mail.MailProducer; | |
| 12 | +import org.assertj.core.util.Lists; | |
| 13 | +import org.junit.jupiter.api.Disabled; | |
| 14 | +import org.junit.jupiter.api.Test; | |
| 15 | +import org.mockito.InjectMocks; | |
| 16 | +import org.mockito.Mock; | |
| 17 | + | |
| 18 | +import java.util.HashMap; | |
| 19 | +import java.util.Map; | |
| 20 | + | |
| 21 | +import static cn.hutool.core.util.RandomUtil.randomEle; | |
| 22 | +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; | |
| 23 | +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; | |
| 24 | +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; | |
| 25 | +import static org.junit.jupiter.api.Assertions.assertEquals; | |
| 26 | +import static org.mockito.ArgumentMatchers.eq; | |
| 27 | +import static org.mockito.Mockito.*; | |
| 28 | + | |
| 29 | +class MailSendServiceImplTest extends BaseMockitoUnitTest { | |
| 30 | + | |
| 31 | + @InjectMocks | |
| 32 | + private MailSendServiceImpl mailSendService; | |
| 33 | + | |
| 34 | + @Mock | |
| 35 | + private MailAccountService mailAccountService; | |
| 36 | + @Mock | |
| 37 | + private MailTemplateService mailTemplateService; | |
| 38 | + @Mock | |
| 39 | + private MailLogService mailLogService; | |
| 40 | + @Mock | |
| 41 | + private MailProducer mailProducer; | |
| 42 | + | |
| 43 | + /** | |
| 44 | + * 用于快速测试你的邮箱账号是否正常 | |
| 45 | + */ | |
| 46 | + @Test | |
| 47 | + @Disabled | |
| 48 | + public void testDemo() { | |
| 49 | + MailAccount mailAccount = new MailAccount() | |
| 50 | +// .setFrom("奥特曼 <ydym_test@163.com>") | |
| 51 | + .setFrom("ydym_test@163.com") // 邮箱地址 | |
| 52 | + .setHost("smtp.163.com").setPort(465).setSslEnable(true) // SMTP 服务器 | |
| 53 | + .setAuth(true).setUser("ydym_test@163.com").setPass("WBZTEINMIFVRYSOE"); // 登录账号密码 | |
| 54 | + String messageId = MailUtil.send(mailAccount, "7685413@qq.com", "主题", "内容", false); | |
| 55 | + System.out.println("发送结果:" + messageId); | |
| 56 | + } | |
| 57 | + | |
| 58 | + /** | |
| 59 | + * 发送成功,当短信模板开启时 | |
| 60 | + */ | |
| 61 | + @Test | |
| 62 | + public void testSendSingleMail_successWhenMailTemplateEnable() { | |
| 63 | + // 准备参数 | |
| 64 | + String mail = randomEmail(); | |
| 65 | + Long userId = randomLongId(); | |
| 66 | + Integer userType = randomEle(UserTypeEnum.values()).getValue(); | |
| 67 | + String templateCode = randomString(); | |
| 68 | + Map<String, Object> templateParams = MapUtil.<String, Object>builder().put("code", "1234") | |
| 69 | + .put("op", "login").build(); | |
| 70 | + // mock MailTemplateService 的方法 | |
| 71 | + MailTemplateDO template = randomPojo(MailTemplateDO.class, o -> { | |
| 72 | + o.setStatus(CommonStatusEnum.ENABLE.getStatus()); | |
| 73 | + o.setContent("验证码为{code}, 操作为{op}"); | |
| 74 | + o.setParams(Lists.newArrayList("code", "op")); | |
| 75 | + }); | |
| 76 | + when(mailTemplateService.getMailTemplateByCodeFromCache(eq(templateCode))).thenReturn(template); | |
| 77 | + String content = randomString(); | |
| 78 | + when(mailTemplateService.formatMailTemplateContent(eq(template.getContent()), eq(templateParams))) | |
| 79 | + .thenReturn(content); | |
| 80 | + // mock MailAccountService 的方法 | |
| 81 | + MailAccountDO account = randomPojo(MailAccountDO.class); | |
| 82 | + when(mailAccountService.getMailAccountFromCache(eq(template.getAccountId()))).thenReturn(account); | |
| 83 | + // mock MailLogService 的方法 | |
| 84 | + Long mailLogId = randomLongId(); | |
| 85 | + when(mailLogService.createMailLog(eq(userId), eq(userType), eq(mail), | |
| 86 | + eq(account), eq(template), eq(content), eq(templateParams), eq(true))).thenReturn(mailLogId); | |
| 87 | + | |
| 88 | + // 调用 | |
| 89 | + Long resultMailLogId = mailSendService.sendSingleMail(mail, userId, userType, templateCode, templateParams); | |
| 90 | + // 断言 | |
| 91 | + assertEquals(mailLogId, resultMailLogId); | |
| 92 | + // 断言调用 | |
| 93 | + verify(mailProducer).sendMailSendMessage(eq(mailLogId), eq(mail), | |
| 94 | + eq(account.getId()), eq(template.getNickname()), eq(template.getTitle()), eq(content)); | |
| 95 | + } | |
| 96 | + | |
| 97 | + /** | |
| 98 | + * 发送成功,当短信模板关闭时 | |
| 99 | + */ | |
| 100 | + @Test | |
| 101 | + public void testSendSingleMail_successWhenSmsTemplateDisable() { | |
| 102 | + // 准备参数 | |
| 103 | + String mail = randomEmail(); | |
| 104 | + Long userId = randomLongId(); | |
| 105 | + Integer userType = randomEle(UserTypeEnum.values()).getValue(); | |
| 106 | + String templateCode = randomString(); | |
| 107 | + Map<String, Object> templateParams = MapUtil.<String, Object>builder().put("code", "1234") | |
| 108 | + .put("op", "login").build(); | |
| 109 | + // mock MailTemplateService 的方法 | |
| 110 | + MailTemplateDO template = randomPojo(MailTemplateDO.class, o -> { | |
| 111 | + o.setStatus(CommonStatusEnum.DISABLE.getStatus()); | |
| 112 | + o.setContent("验证码为{code}, 操作为{op}"); | |
| 113 | + o.setParams(Lists.newArrayList("code", "op")); | |
| 114 | + }); | |
| 115 | + when(mailTemplateService.getMailTemplateByCodeFromCache(eq(templateCode))).thenReturn(template); | |
| 116 | + String content = randomString(); | |
| 117 | + when(mailTemplateService.formatMailTemplateContent(eq(template.getContent()), eq(templateParams))) | |
| 118 | + .thenReturn(content); | |
| 119 | + // mock MailAccountService 的方法 | |
| 120 | + MailAccountDO account = randomPojo(MailAccountDO.class); | |
| 121 | + when(mailAccountService.getMailAccountFromCache(eq(template.getAccountId()))).thenReturn(account); | |
| 122 | + // mock MailLogService 的方法 | |
| 123 | + Long mailLogId = randomLongId(); | |
| 124 | + when(mailLogService.createMailLog(eq(userId), eq(userType), eq(mail), | |
| 125 | + eq(account), eq(template), eq(content), eq(templateParams), eq(false))).thenReturn(mailLogId); | |
| 126 | + | |
| 127 | + // 调用 | |
| 128 | + Long resultMailLogId = mailSendService.sendSingleMail(mail, userId, userType, templateCode, templateParams); | |
| 129 | + // 断言 | |
| 130 | + assertEquals(mailLogId, resultMailLogId); | |
| 131 | + // 断言调用 | |
| 132 | + verify(mailProducer, times(0)).sendMailSendMessage(anyLong(), anyString(), | |
| 133 | + anyLong(), anyString(), anyString(), anyString()); | |
| 134 | + } | |
| 135 | + | |
| 136 | + @Test | |
| 137 | + public void testCheckMailTemplateValid_notExists() { | |
| 138 | + // 准备参数 | |
| 139 | + String templateCode = randomString(); | |
| 140 | + // mock 方法 | |
| 141 | + | |
| 142 | + // 调用,并断言异常 | |
| 143 | + assertServiceException(() -> mailSendService.checkMailTemplateValid(templateCode), | |
| 144 | + MAIL_TEMPLATE_NOT_EXISTS); | |
| 145 | + } | |
| 146 | + | |
| 147 | + @Test | |
| 148 | + public void testCheckTemplateParams_paramMiss() { | |
| 149 | + // 准备参数 | |
| 150 | + MailTemplateDO template = randomPojo(MailTemplateDO.class, | |
| 151 | + o -> o.setParams(Lists.newArrayList("code"))); | |
| 152 | + Map<String, Object> templateParams = new HashMap<>(); | |
| 153 | + // mock 方法 | |
| 154 | + | |
| 155 | + // 调用,并断言异常 | |
| 156 | + assertServiceException(() -> mailSendService.checkTemplateParams(template, templateParams), | |
| 157 | + MAIL_SEND_TEMPLATE_PARAM_MISS, "code"); | |
| 158 | + } | |
| 159 | + | |
| 160 | + @Test | |
| 161 | + public void testCheckMail_notExists() { | |
| 162 | + // 准备参数 | |
| 163 | + // mock 方法 | |
| 164 | + | |
| 165 | + // 调用,并断言异常 | |
| 166 | + assertServiceException(() -> mailSendService.checkMail(null), | |
| 167 | + MAIL_SEND_MAIL_NOT_EXISTS); | |
| 168 | + } | |
| 169 | + | |
| 170 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/mail/MailTemplateServiceImplTest.java
0 → 100755
| 1 | +package cn.iocoder.yudao.module.system.service.mail; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | |
| 4 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 5 | +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; | |
| 6 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.template.MailTemplateCreateReqVO; | |
| 7 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.template.MailTemplatePageReqVO; | |
| 8 | +import cn.iocoder.yudao.module.system.controller.admin.mail.vo.template.MailTemplateUpdateReqVO; | |
| 9 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailAccountDO; | |
| 10 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO; | |
| 11 | +import cn.iocoder.yudao.module.system.dal.mysql.mail.MailTemplateMapper; | |
| 12 | +import cn.iocoder.yudao.module.system.mq.producer.mail.MailProducer; | |
| 13 | +import org.junit.jupiter.api.Test; | |
| 14 | +import org.springframework.boot.test.mock.mockito.MockBean; | |
| 15 | +import org.springframework.context.annotation.Import; | |
| 16 | + | |
| 17 | +import javax.annotation.Resource; | |
| 18 | + | |
| 19 | +import java.util.Map; | |
| 20 | + | |
| 21 | +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; | |
| 22 | +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; | |
| 23 | +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; | |
| 24 | +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; | |
| 25 | +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; | |
| 26 | +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomLongId; | |
| 27 | +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.randomPojo; | |
| 28 | +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.MAIL_TEMPLATE_NOT_EXISTS; | |
| 29 | +import static org.junit.jupiter.api.Assertions.*; | |
| 30 | + | |
| 31 | +/** | |
| 32 | +* {@link MailTemplateServiceImpl} 的单元测试类 | |
| 33 | +* | |
| 34 | +* @author 芋道源码 | |
| 35 | +*/ | |
| 36 | +@Import(MailTemplateServiceImpl.class) | |
| 37 | +public class MailTemplateServiceImplTest extends BaseDbUnitTest { | |
| 38 | + | |
| 39 | + @Resource | |
| 40 | + private MailTemplateServiceImpl mailTemplateService; | |
| 41 | + | |
| 42 | + @Resource | |
| 43 | + private MailTemplateMapper mailTemplateMapper; | |
| 44 | + | |
| 45 | + @MockBean | |
| 46 | + private MailProducer mailProducer; | |
| 47 | + | |
| 48 | + @Test | |
| 49 | + public void testInitLocalCache() { | |
| 50 | + MailTemplateDO templateDO01 = randomPojo(MailTemplateDO.class); | |
| 51 | + mailTemplateMapper.insert(templateDO01); | |
| 52 | + MailTemplateDO templateDO02 = randomPojo(MailTemplateDO.class); | |
| 53 | + mailTemplateMapper.insert(templateDO02); | |
| 54 | + | |
| 55 | + // 调用 | |
| 56 | + mailTemplateService.initLocalCache(); | |
| 57 | + // 断言 mailTemplateCache 缓存 | |
| 58 | + Map<String, MailTemplateDO> mailTemplateCache = mailTemplateService.getMailTemplateCache(); | |
| 59 | + assertPojoEquals(templateDO01, mailTemplateCache.get(templateDO01.getCode())); | |
| 60 | + assertPojoEquals(templateDO02, mailTemplateCache.get(templateDO02.getCode())); | |
| 61 | + } | |
| 62 | + | |
| 63 | + @Test | |
| 64 | + public void testCreateMailTemplate_success() { | |
| 65 | + // 准备参数 | |
| 66 | + MailTemplateCreateReqVO reqVO = randomPojo(MailTemplateCreateReqVO.class); | |
| 67 | + | |
| 68 | + // 调用 | |
| 69 | + Long mailTemplateId = mailTemplateService.createMailTemplate(reqVO); | |
| 70 | + // 断言 | |
| 71 | + assertNotNull(mailTemplateId); | |
| 72 | + // 校验记录的属性是否正确 | |
| 73 | + MailTemplateDO mailTemplate = mailTemplateMapper.selectById(mailTemplateId); | |
| 74 | + assertPojoEquals(reqVO, mailTemplate); | |
| 75 | + } | |
| 76 | + | |
| 77 | + @Test | |
| 78 | + public void testUpdateMailTemplate_success() { | |
| 79 | + // mock 数据 | |
| 80 | + MailTemplateDO dbMailTemplate = randomPojo(MailTemplateDO.class); | |
| 81 | + mailTemplateMapper.insert(dbMailTemplate);// @Sql: 先插入出一条存在的数据 | |
| 82 | + // 准备参数 | |
| 83 | + MailTemplateUpdateReqVO reqVO = randomPojo(MailTemplateUpdateReqVO.class, o -> { | |
| 84 | + o.setId(dbMailTemplate.getId()); // 设置更新的 ID | |
| 85 | + }); | |
| 86 | + | |
| 87 | + // 调用 | |
| 88 | + mailTemplateService.updateMailTemplate(reqVO); | |
| 89 | + // 校验是否更新正确 | |
| 90 | + MailTemplateDO mailTemplate = mailTemplateMapper.selectById(reqVO.getId()); // 获取最新的 | |
| 91 | + assertPojoEquals(reqVO, mailTemplate); | |
| 92 | + } | |
| 93 | + | |
| 94 | + @Test | |
| 95 | + public void testUpdateMailTemplate_notExists() { | |
| 96 | + // 准备参数 | |
| 97 | + MailTemplateUpdateReqVO reqVO = randomPojo(MailTemplateUpdateReqVO.class); | |
| 98 | + | |
| 99 | + // 调用, 并断言异常 | |
| 100 | + assertServiceException(() -> mailTemplateService.updateMailTemplate(reqVO), MAIL_TEMPLATE_NOT_EXISTS); | |
| 101 | + } | |
| 102 | + | |
| 103 | + @Test | |
| 104 | + public void testDeleteMailTemplate_success() { | |
| 105 | + // mock 数据 | |
| 106 | + MailTemplateDO dbMailTemplate = randomPojo(MailTemplateDO.class); | |
| 107 | + mailTemplateMapper.insert(dbMailTemplate);// @Sql: 先插入出一条存在的数据 | |
| 108 | + // 准备参数 | |
| 109 | + Long id = dbMailTemplate.getId(); | |
| 110 | + | |
| 111 | + // 调用 | |
| 112 | + mailTemplateService.deleteMailTemplate(id); | |
| 113 | + // 校验数据不存在了 | |
| 114 | + assertNull(mailTemplateMapper.selectById(id)); | |
| 115 | + } | |
| 116 | + | |
| 117 | + @Test | |
| 118 | + public void testDeleteMailTemplate_notExists() { | |
| 119 | + // 准备参数 | |
| 120 | + Long id = randomLongId(); | |
| 121 | + | |
| 122 | + // 调用, 并断言异常 | |
| 123 | + assertServiceException(() -> mailTemplateService.deleteMailTemplate(id), MAIL_TEMPLATE_NOT_EXISTS); | |
| 124 | + } | |
| 125 | + | |
| 126 | + @Test | |
| 127 | + public void testGetMailTemplatePage() { | |
| 128 | + // mock 数据 | |
| 129 | + MailTemplateDO dbMailTemplate = randomPojo(MailTemplateDO.class, o -> { // 等会查询到 | |
| 130 | + o.setName("源码"); | |
| 131 | + o.setCode("test_01"); | |
| 132 | + o.setAccountId(1L); | |
| 133 | + o.setStatus(CommonStatusEnum.ENABLE.getStatus()); | |
| 134 | + o.setCreateTime(buildTime(2023, 2, 3)); | |
| 135 | + }); | |
| 136 | + mailTemplateMapper.insert(dbMailTemplate); | |
| 137 | + // 测试 name 不匹配 | |
| 138 | + mailTemplateMapper.insert(cloneIgnoreId(dbMailTemplate, o -> o.setName("芋道"))); | |
| 139 | + // 测试 code 不匹配 | |
| 140 | + mailTemplateMapper.insert(cloneIgnoreId(dbMailTemplate, o -> o.setCode("test_02"))); | |
| 141 | + // 测试 accountId 不匹配 | |
| 142 | + mailTemplateMapper.insert(cloneIgnoreId(dbMailTemplate, o -> o.setAccountId(2L))); | |
| 143 | + // 测试 status 不匹配 | |
| 144 | + mailTemplateMapper.insert(cloneIgnoreId(dbMailTemplate, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); | |
| 145 | + // 测试 createTime 不匹配 | |
| 146 | + mailTemplateMapper.insert(cloneIgnoreId(dbMailTemplate, o -> o.setCreateTime(buildTime(2023, 1, 5)))); | |
| 147 | + // 准备参数 | |
| 148 | + MailTemplatePageReqVO reqVO = new MailTemplatePageReqVO(); | |
| 149 | + reqVO.setName("源"); | |
| 150 | + reqVO.setCode("est_01"); | |
| 151 | + reqVO.setAccountId(1L); | |
| 152 | + reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); | |
| 153 | + reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 5)); | |
| 154 | + | |
| 155 | + // 调用 | |
| 156 | + PageResult<MailTemplateDO> pageResult = mailTemplateService.getMailTemplatePage(reqVO); | |
| 157 | + // 断言 | |
| 158 | + assertEquals(1, pageResult.getTotal()); | |
| 159 | + assertEquals(1, pageResult.getList().size()); | |
| 160 | + assertPojoEquals(dbMailTemplate, pageResult.getList().get(0)); | |
| 161 | + } | |
| 162 | + | |
| 163 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/notify/NotifyMessageServiceImplTest.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.service.notify; | |
| 2 | + | |
| 3 | +import cn.hutool.core.map.MapUtil; | |
| 4 | +import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | |
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | +import cn.iocoder.yudao.framework.mybatis.core.enums.SqlConstants; | |
| 7 | +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; | |
| 8 | +import cn.iocoder.yudao.module.system.controller.admin.notify.vo.message.NotifyMessageMyPageReqVO; | |
| 9 | +import cn.iocoder.yudao.module.system.controller.admin.notify.vo.message.NotifyMessagePageReqVO; | |
| 10 | +import cn.iocoder.yudao.module.system.dal.dataobject.notify.NotifyMessageDO; | |
| 11 | +import cn.iocoder.yudao.module.system.dal.dataobject.notify.NotifyTemplateDO; | |
| 12 | +import cn.iocoder.yudao.module.system.dal.mysql.notify.NotifyMessageMapper; | |
| 13 | +import com.baomidou.mybatisplus.annotation.DbType; | |
| 14 | +import org.junit.jupiter.api.Test; | |
| 15 | +import org.springframework.context.annotation.Import; | |
| 16 | + | |
| 17 | +import javax.annotation.Resource; | |
| 18 | +import java.util.Arrays; | |
| 19 | +import java.util.Collection; | |
| 20 | +import java.util.List; | |
| 21 | +import java.util.Map; | |
| 22 | + | |
| 23 | +import static cn.hutool.core.util.RandomUtil.randomEle; | |
| 24 | +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; | |
| 25 | +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; | |
| 26 | +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; | |
| 27 | +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; | |
| 28 | +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; | |
| 29 | +import static org.junit.jupiter.api.Assertions.*; | |
| 30 | + | |
| 31 | +/** | |
| 32 | +* {@link NotifyMessageServiceImpl} 的单元测试类 | |
| 33 | +* | |
| 34 | +* @author 芋道源码 | |
| 35 | +*/ | |
| 36 | +@Import(NotifyMessageServiceImpl.class) | |
| 37 | +public class NotifyMessageServiceImplTest extends BaseDbUnitTest { | |
| 38 | + | |
| 39 | + @Resource | |
| 40 | + private NotifyMessageServiceImpl notifyMessageService; | |
| 41 | + | |
| 42 | + @Resource | |
| 43 | + private NotifyMessageMapper notifyMessageMapper; | |
| 44 | + | |
| 45 | + @Test | |
| 46 | + public void testCreateNotifyMessage_success() { | |
| 47 | + // 准备参数 | |
| 48 | + Long userId = randomLongId(); | |
| 49 | + Integer userType = randomEle(UserTypeEnum.values()).getValue(); | |
| 50 | + NotifyTemplateDO template = randomPojo(NotifyTemplateDO.class); | |
| 51 | + String templateContent = randomString(); | |
| 52 | + Map<String, Object> templateParams = randomTemplateParams(); | |
| 53 | + // mock 方法 | |
| 54 | + | |
| 55 | + // 调用 | |
| 56 | + Long messageId = notifyMessageService.createNotifyMessage(userId, userType, | |
| 57 | + template, templateContent, templateParams); | |
| 58 | + // 断言 | |
| 59 | + NotifyMessageDO message = notifyMessageMapper.selectById(messageId); | |
| 60 | + assertNotNull(message); | |
| 61 | + assertEquals(userId, message.getUserId()); | |
| 62 | + assertEquals(userType, message.getUserType()); | |
| 63 | + assertEquals(template.getId(), message.getTemplateId()); | |
| 64 | + assertEquals(template.getCode(), message.getTemplateCode()); | |
| 65 | + assertEquals(template.getType(), message.getTemplateType()); | |
| 66 | + assertEquals(template.getNickname(), message.getTemplateNickname()); | |
| 67 | + assertEquals(templateContent, message.getTemplateContent()); | |
| 68 | + assertEquals(templateParams, message.getTemplateParams()); | |
| 69 | + assertEquals(false, message.getReadStatus()); | |
| 70 | + assertNull(message.getReadTime()); | |
| 71 | + } | |
| 72 | + | |
| 73 | + @Test | |
| 74 | + public void testGetNotifyMessagePage() { | |
| 75 | + // mock 数据 | |
| 76 | + NotifyMessageDO dbNotifyMessage = randomPojo(NotifyMessageDO.class, o -> { // 等会查询到 | |
| 77 | + o.setUserId(1L); | |
| 78 | + o.setUserType(UserTypeEnum.ADMIN.getValue()); | |
| 79 | + o.setTemplateCode("test_01"); | |
| 80 | + o.setTemplateType(10); | |
| 81 | + o.setCreateTime(buildTime(2022, 1, 2)); | |
| 82 | + o.setTemplateParams(randomTemplateParams()); | |
| 83 | + }); | |
| 84 | + notifyMessageMapper.insert(dbNotifyMessage); | |
| 85 | + // 测试 userId 不匹配 | |
| 86 | + notifyMessageMapper.insert(cloneIgnoreId(dbNotifyMessage, o -> o.setUserId(2L))); | |
| 87 | + // 测试 userType 不匹配 | |
| 88 | + notifyMessageMapper.insert(cloneIgnoreId(dbNotifyMessage, o -> o.setUserType(UserTypeEnum.MEMBER.getValue()))); | |
| 89 | + // 测试 templateCode 不匹配 | |
| 90 | + notifyMessageMapper.insert(cloneIgnoreId(dbNotifyMessage, o -> o.setTemplateCode("test_11"))); | |
| 91 | + // 测试 templateType 不匹配 | |
| 92 | + notifyMessageMapper.insert(cloneIgnoreId(dbNotifyMessage, o -> o.setTemplateType(20))); | |
| 93 | + // 测试 createTime 不匹配 | |
| 94 | + notifyMessageMapper.insert(cloneIgnoreId(dbNotifyMessage, o -> o.setCreateTime(buildTime(2022, 2, 1)))); | |
| 95 | + // 准备参数 | |
| 96 | + NotifyMessagePageReqVO reqVO = new NotifyMessagePageReqVO(); | |
| 97 | + reqVO.setUserId(1L); | |
| 98 | + reqVO.setUserType(UserTypeEnum.ADMIN.getValue()); | |
| 99 | + reqVO.setTemplateCode("est_01"); | |
| 100 | + reqVO.setTemplateType(10); | |
| 101 | + reqVO.setCreateTime(buildBetweenTime(2022, 1, 1, 2022, 1, 10)); | |
| 102 | + | |
| 103 | + // 调用 | |
| 104 | + PageResult<NotifyMessageDO> pageResult = notifyMessageService.getNotifyMessagePage(reqVO); | |
| 105 | + // 断言 | |
| 106 | + assertEquals(1, pageResult.getTotal()); | |
| 107 | + assertEquals(1, pageResult.getList().size()); | |
| 108 | + assertPojoEquals(dbNotifyMessage, pageResult.getList().get(0)); | |
| 109 | + } | |
| 110 | + | |
| 111 | + @Test | |
| 112 | + public void testGetMyNotifyMessagePage() { | |
| 113 | + // mock 数据 | |
| 114 | + NotifyMessageDO dbNotifyMessage = randomPojo(NotifyMessageDO.class, o -> { // 等会查询到 | |
| 115 | + o.setUserId(1L); | |
| 116 | + o.setUserType(UserTypeEnum.ADMIN.getValue()); | |
| 117 | + o.setReadStatus(true); | |
| 118 | + o.setCreateTime(buildTime(2022, 1, 2)); | |
| 119 | + o.setTemplateParams(randomTemplateParams()); | |
| 120 | + }); | |
| 121 | + notifyMessageMapper.insert(dbNotifyMessage); | |
| 122 | + // 测试 userId 不匹配 | |
| 123 | + notifyMessageMapper.insert(cloneIgnoreId(dbNotifyMessage, o -> o.setUserId(2L))); | |
| 124 | + // 测试 userType 不匹配 | |
| 125 | + notifyMessageMapper.insert(cloneIgnoreId(dbNotifyMessage, o -> o.setUserType(UserTypeEnum.MEMBER.getValue()))); | |
| 126 | + // 测试 readStatus 不匹配 | |
| 127 | + notifyMessageMapper.insert(cloneIgnoreId(dbNotifyMessage, o -> o.setReadStatus(false))); | |
| 128 | + // 测试 createTime 不匹配 | |
| 129 | + notifyMessageMapper.insert(cloneIgnoreId(dbNotifyMessage, o -> o.setCreateTime(buildTime(2022, 2, 1)))); | |
| 130 | + // 准备参数 | |
| 131 | + Long userId = 1L; | |
| 132 | + Integer userType = UserTypeEnum.ADMIN.getValue(); | |
| 133 | + NotifyMessageMyPageReqVO reqVO = new NotifyMessageMyPageReqVO(); | |
| 134 | + reqVO.setReadStatus(true); | |
| 135 | + reqVO.setCreateTime(buildBetweenTime(2022, 1, 1, 2022, 1, 10)); | |
| 136 | + | |
| 137 | + // 调用 | |
| 138 | + PageResult<NotifyMessageDO> pageResult = notifyMessageService.getMyMyNotifyMessagePage(reqVO, userId, userType); | |
| 139 | + // 断言 | |
| 140 | + assertEquals(1, pageResult.getTotal()); | |
| 141 | + assertEquals(1, pageResult.getList().size()); | |
| 142 | + assertPojoEquals(dbNotifyMessage, pageResult.getList().get(0)); | |
| 143 | + } | |
| 144 | + | |
| 145 | + @Test | |
| 146 | + public void testGetUnreadNotifyMessageList() { | |
| 147 | + SqlConstants.init(DbType.MYSQL); | |
| 148 | + // mock 数据 | |
| 149 | + NotifyMessageDO dbNotifyMessage = randomPojo(NotifyMessageDO.class, o -> { // 等会查询到 | |
| 150 | + o.setUserId(1L); | |
| 151 | + o.setUserType(UserTypeEnum.ADMIN.getValue()); | |
| 152 | + o.setReadStatus(false); | |
| 153 | + o.setTemplateParams(randomTemplateParams()); | |
| 154 | + }); | |
| 155 | + notifyMessageMapper.insert(dbNotifyMessage); | |
| 156 | + // 测试 userId 不匹配 | |
| 157 | + notifyMessageMapper.insert(cloneIgnoreId(dbNotifyMessage, o -> o.setUserId(2L))); | |
| 158 | + // 测试 userType 不匹配 | |
| 159 | + notifyMessageMapper.insert(cloneIgnoreId(dbNotifyMessage, o -> o.setUserType(UserTypeEnum.MEMBER.getValue()))); | |
| 160 | + // 测试 readStatus 不匹配 | |
| 161 | + notifyMessageMapper.insert(cloneIgnoreId(dbNotifyMessage, o -> o.setReadStatus(true))); | |
| 162 | + // 准备参数 | |
| 163 | + Long userId = 1L; | |
| 164 | + Integer userType = UserTypeEnum.ADMIN.getValue(); | |
| 165 | + Integer size = 10; | |
| 166 | + | |
| 167 | + // 调用 | |
| 168 | + List<NotifyMessageDO> list = notifyMessageService.getUnreadNotifyMessageList(userId, userType, size); | |
| 169 | + // 断言 | |
| 170 | + assertEquals(1, list.size()); | |
| 171 | + assertPojoEquals(dbNotifyMessage, list.get(0)); | |
| 172 | + } | |
| 173 | + | |
| 174 | + @Test | |
| 175 | + public void testGetUnreadNotifyMessageCount() { | |
| 176 | + SqlConstants.init(DbType.MYSQL); | |
| 177 | + // mock 数据 | |
| 178 | + NotifyMessageDO dbNotifyMessage = randomPojo(NotifyMessageDO.class, o -> { // 等会查询到 | |
| 179 | + o.setUserId(1L); | |
| 180 | + o.setUserType(UserTypeEnum.ADMIN.getValue()); | |
| 181 | + o.setReadStatus(false); | |
| 182 | + o.setTemplateParams(randomTemplateParams()); | |
| 183 | + }); | |
| 184 | + notifyMessageMapper.insert(dbNotifyMessage); | |
| 185 | + // 测试 userId 不匹配 | |
| 186 | + notifyMessageMapper.insert(cloneIgnoreId(dbNotifyMessage, o -> o.setUserId(2L))); | |
| 187 | + // 测试 userType 不匹配 | |
| 188 | + notifyMessageMapper.insert(cloneIgnoreId(dbNotifyMessage, o -> o.setUserType(UserTypeEnum.MEMBER.getValue()))); | |
| 189 | + // 测试 readStatus 不匹配 | |
| 190 | + notifyMessageMapper.insert(cloneIgnoreId(dbNotifyMessage, o -> o.setReadStatus(true))); | |
| 191 | + // 准备参数 | |
| 192 | + Long userId = 1L; | |
| 193 | + Integer userType = UserTypeEnum.ADMIN.getValue(); | |
| 194 | + | |
| 195 | + // 调用,并断言 | |
| 196 | + assertEquals(1, notifyMessageService.getUnreadNotifyMessageCount(userId, userType)); | |
| 197 | + } | |
| 198 | + | |
| 199 | + @Test | |
| 200 | + public void testUpdateNotifyMessageRead() { | |
| 201 | + // mock 数据 | |
| 202 | + NotifyMessageDO dbNotifyMessage = randomPojo(NotifyMessageDO.class, o -> { // 等会查询到 | |
| 203 | + o.setUserId(1L); | |
| 204 | + o.setUserType(UserTypeEnum.ADMIN.getValue()); | |
| 205 | + o.setReadStatus(false); | |
| 206 | + o.setReadTime(null); | |
| 207 | + o.setTemplateParams(randomTemplateParams()); | |
| 208 | + }); | |
| 209 | + notifyMessageMapper.insert(dbNotifyMessage); | |
| 210 | + // 测试 userId 不匹配 | |
| 211 | + notifyMessageMapper.insert(cloneIgnoreId(dbNotifyMessage, o -> o.setUserId(2L))); | |
| 212 | + // 测试 userType 不匹配 | |
| 213 | + notifyMessageMapper.insert(cloneIgnoreId(dbNotifyMessage, o -> o.setUserType(UserTypeEnum.MEMBER.getValue()))); | |
| 214 | + // 测试 readStatus 不匹配 | |
| 215 | + notifyMessageMapper.insert(cloneIgnoreId(dbNotifyMessage, o -> o.setReadStatus(true))); | |
| 216 | + // 准备参数 | |
| 217 | + Collection<Long> ids = Arrays.asList(dbNotifyMessage.getId(), dbNotifyMessage.getId() + 1, | |
| 218 | + dbNotifyMessage.getId() + 2, dbNotifyMessage.getId() + 3); | |
| 219 | + Long userId = 1L; | |
| 220 | + Integer userType = UserTypeEnum.ADMIN.getValue(); | |
| 221 | + | |
| 222 | + // 调用 | |
| 223 | + int updateCount = notifyMessageService.updateNotifyMessageRead(ids, userId, userType); | |
| 224 | + // 断言 | |
| 225 | + assertEquals(1, updateCount); | |
| 226 | + NotifyMessageDO notifyMessage = notifyMessageMapper.selectById(dbNotifyMessage.getId()); | |
| 227 | + assertTrue(notifyMessage.getReadStatus()); | |
| 228 | + assertNotNull(notifyMessage.getReadTime()); | |
| 229 | + } | |
| 230 | + | |
| 231 | + @Test | |
| 232 | + public void testUpdateAllNotifyMessageRead() { | |
| 233 | + // mock 数据 | |
| 234 | + NotifyMessageDO dbNotifyMessage = randomPojo(NotifyMessageDO.class, o -> { // 等会查询到 | |
| 235 | + o.setUserId(1L); | |
| 236 | + o.setUserType(UserTypeEnum.ADMIN.getValue()); | |
| 237 | + o.setReadStatus(false); | |
| 238 | + o.setReadTime(null); | |
| 239 | + o.setTemplateParams(randomTemplateParams()); | |
| 240 | + }); | |
| 241 | + notifyMessageMapper.insert(dbNotifyMessage); | |
| 242 | + // 测试 userId 不匹配 | |
| 243 | + notifyMessageMapper.insert(cloneIgnoreId(dbNotifyMessage, o -> o.setUserId(2L))); | |
| 244 | + // 测试 userType 不匹配 | |
| 245 | + notifyMessageMapper.insert(cloneIgnoreId(dbNotifyMessage, o -> o.setUserType(UserTypeEnum.MEMBER.getValue()))); | |
| 246 | + // 测试 readStatus 不匹配 | |
| 247 | + notifyMessageMapper.insert(cloneIgnoreId(dbNotifyMessage, o -> o.setReadStatus(true))); | |
| 248 | + // 准备参数 | |
| 249 | + Long userId = 1L; | |
| 250 | + Integer userType = UserTypeEnum.ADMIN.getValue(); | |
| 251 | + | |
| 252 | + // 调用 | |
| 253 | + int updateCount = notifyMessageService.updateAllNotifyMessageRead(userId, userType); | |
| 254 | + // 断言 | |
| 255 | + assertEquals(1, updateCount); | |
| 256 | + NotifyMessageDO notifyMessage = notifyMessageMapper.selectById(dbNotifyMessage.getId()); | |
| 257 | + assertTrue(notifyMessage.getReadStatus()); | |
| 258 | + assertNotNull(notifyMessage.getReadTime()); | |
| 259 | + } | |
| 260 | + | |
| 261 | + private static Map<String, Object> randomTemplateParams() { | |
| 262 | + return MapUtil.<String, Object>builder().put(randomString(), randomString()) | |
| 263 | + .put(randomString(), randomString()).build(); | |
| 264 | + } | |
| 265 | + | |
| 266 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/notify/NotifySendServiceImplTest.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.service.notify; | |
| 2 | + | |
| 3 | +import cn.hutool.core.map.MapUtil; | |
| 4 | +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | |
| 5 | +import cn.iocoder.yudao.framework.common.enums.UserTypeEnum; | |
| 6 | +import cn.iocoder.yudao.framework.test.core.ut.BaseMockitoUnitTest; | |
| 7 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailAccountDO; | |
| 8 | +import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO; | |
| 9 | +import cn.iocoder.yudao.module.system.dal.dataobject.notify.NotifyTemplateDO; | |
| 10 | +import org.assertj.core.util.Lists; | |
| 11 | +import org.junit.jupiter.api.Test; | |
| 12 | +import org.mockito.InjectMocks; | |
| 13 | +import org.mockito.Mock; | |
| 14 | + | |
| 15 | +import java.util.HashMap; | |
| 16 | +import java.util.Map; | |
| 17 | + | |
| 18 | +import static cn.hutool.core.util.RandomUtil.randomEle; | |
| 19 | +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; | |
| 20 | +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; | |
| 21 | +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*; | |
| 22 | +import static org.junit.jupiter.api.Assertions.assertEquals; | |
| 23 | +import static org.junit.jupiter.api.Assertions.assertNull; | |
| 24 | +import static org.mockito.ArgumentMatchers.eq; | |
| 25 | +import static org.mockito.Mockito.*; | |
| 26 | + | |
| 27 | +class NotifySendServiceImplTest extends BaseMockitoUnitTest { | |
| 28 | + | |
| 29 | + @InjectMocks | |
| 30 | + private NotifySendServiceImpl notifySendService; | |
| 31 | + | |
| 32 | + @Mock | |
| 33 | + private NotifyTemplateService notifyTemplateService; | |
| 34 | + @Mock | |
| 35 | + private NotifyMessageService notifyMessageService; | |
| 36 | + | |
| 37 | + /** | |
| 38 | + * 发送成功,当短信模板开启时 | |
| 39 | + */ | |
| 40 | + @Test | |
| 41 | + public void testSendSingleNotify_successWhenMailTemplateEnable() { | |
| 42 | + // 准备参数 | |
| 43 | + Long userId = randomLongId(); | |
| 44 | + Integer userType = randomEle(UserTypeEnum.values()).getValue(); | |
| 45 | + String templateCode = randomString(); | |
| 46 | + Map<String, Object> templateParams = MapUtil.<String, Object>builder().put("code", "1234") | |
| 47 | + .put("op", "login").build(); | |
| 48 | + // mock NotifyTemplateService 的方法 | |
| 49 | + NotifyTemplateDO template = randomPojo(NotifyTemplateDO.class, o -> { | |
| 50 | + o.setStatus(CommonStatusEnum.ENABLE.getStatus()); | |
| 51 | + o.setContent("验证码为{code}, 操作为{op}"); | |
| 52 | + o.setParams(Lists.newArrayList("code", "op")); | |
| 53 | + }); | |
| 54 | + when(notifyTemplateService.getNotifyTemplateByCodeFromCache(eq(templateCode))).thenReturn(template); | |
| 55 | + String content = randomString(); | |
| 56 | + when(notifyTemplateService.formatNotifyTemplateContent(eq(template.getContent()), eq(templateParams))) | |
| 57 | + .thenReturn(content); | |
| 58 | + // mock NotifyMessageService 的方法 | |
| 59 | + Long messageId = randomLongId(); | |
| 60 | + when(notifyMessageService.createNotifyMessage(eq(userId), eq(userType), | |
| 61 | + eq(template), eq(content), eq(templateParams))).thenReturn(messageId); | |
| 62 | + | |
| 63 | + // 调用 | |
| 64 | + Long resultMessageId = notifySendService.sendSingleNotify(userId, userType, templateCode, templateParams); | |
| 65 | + // 断言 | |
| 66 | + assertEquals(messageId, resultMessageId); | |
| 67 | + } | |
| 68 | + | |
| 69 | + /** | |
| 70 | + * 发送成功,当短信模板关闭时 | |
| 71 | + */ | |
| 72 | + @Test | |
| 73 | + public void testSendSingleMail_successWhenSmsTemplateDisable() { | |
| 74 | + // 准备参数 | |
| 75 | + Long userId = randomLongId(); | |
| 76 | + Integer userType = randomEle(UserTypeEnum.values()).getValue(); | |
| 77 | + String templateCode = randomString(); | |
| 78 | + Map<String, Object> templateParams = MapUtil.<String, Object>builder().put("code", "1234") | |
| 79 | + .put("op", "login").build(); | |
| 80 | + // mock NotifyTemplateService 的方法 | |
| 81 | + NotifyTemplateDO template = randomPojo(NotifyTemplateDO.class, o -> { | |
| 82 | + o.setStatus(CommonStatusEnum.DISABLE.getStatus()); | |
| 83 | + o.setContent("验证码为{code}, 操作为{op}"); | |
| 84 | + o.setParams(Lists.newArrayList("code", "op")); | |
| 85 | + }); | |
| 86 | + when(notifyTemplateService.getNotifyTemplateByCodeFromCache(eq(templateCode))).thenReturn(template); | |
| 87 | + | |
| 88 | + // 调用 | |
| 89 | + Long resultMessageId = notifySendService.sendSingleNotify(userId, userType, templateCode, templateParams); | |
| 90 | + // 断言 | |
| 91 | + assertNull(resultMessageId); | |
| 92 | + verify(notifyTemplateService, never()).formatNotifyTemplateContent(anyString(), anyMap()); | |
| 93 | + verify(notifyMessageService, never()).createNotifyMessage(anyLong(), anyInt(), any(), anyString(), anyMap()); | |
| 94 | + } | |
| 95 | + | |
| 96 | + @Test | |
| 97 | + public void testCheckMailTemplateValid_notExists() { | |
| 98 | + // 准备参数 | |
| 99 | + String templateCode = randomString(); | |
| 100 | + // mock 方法 | |
| 101 | + | |
| 102 | + // 调用,并断言异常 | |
| 103 | + assertServiceException(() -> notifySendService.checkNotifyTemplateValid(templateCode), | |
| 104 | + NOTICE_NOT_FOUND); | |
| 105 | + } | |
| 106 | + | |
| 107 | + @Test | |
| 108 | + public void testCheckTemplateParams_paramMiss() { | |
| 109 | + // 准备参数 | |
| 110 | + NotifyTemplateDO template = randomPojo(NotifyTemplateDO.class, | |
| 111 | + o -> o.setParams(Lists.newArrayList("code"))); | |
| 112 | + Map<String, Object> templateParams = new HashMap<>(); | |
| 113 | + // mock 方法 | |
| 114 | + | |
| 115 | + // 调用,并断言异常 | |
| 116 | + assertServiceException(() -> notifySendService.checkTemplateParams(template, templateParams), | |
| 117 | + NOTIFY_SEND_TEMPLATE_PARAM_MISS, "code"); | |
| 118 | + } | |
| 119 | + | |
| 120 | + | |
| 121 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/notify/NotifyTemplateServiceImplTest.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.system.service.notify; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; | |
| 4 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 5 | +import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; | |
| 6 | +import cn.iocoder.yudao.module.system.controller.admin.notify.vo.template.NotifyTemplateCreateReqVO; | |
| 7 | +import cn.iocoder.yudao.module.system.controller.admin.notify.vo.template.NotifyTemplatePageReqVO; | |
| 8 | +import cn.iocoder.yudao.module.system.controller.admin.notify.vo.template.NotifyTemplateUpdateReqVO; | |
| 9 | +import cn.iocoder.yudao.module.system.dal.dataobject.notify.NotifyTemplateDO; | |
| 10 | +import cn.iocoder.yudao.module.system.dal.mysql.notify.NotifyTemplateMapper; | |
| 11 | +import cn.iocoder.yudao.module.system.mq.producer.notify.NotifyProducer; | |
| 12 | +import org.junit.jupiter.api.Test; | |
| 13 | +import org.springframework.boot.test.mock.mockito.MockBean; | |
| 14 | +import org.springframework.context.annotation.Import; | |
| 15 | + | |
| 16 | +import javax.annotation.Resource; | |
| 17 | + | |
| 18 | +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildBetweenTime; | |
| 19 | +import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.buildTime; | |
| 20 | +import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.cloneIgnoreId; | |
| 21 | +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertPojoEquals; | |
| 22 | +import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.assertServiceException; | |
| 23 | +import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; | |
| 24 | +import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.NOTIFY_TEMPLATE_NOT_EXISTS; | |
| 25 | +import static org.junit.jupiter.api.Assertions.*; | |
| 26 | +import static org.mockito.Mockito.verify; | |
| 27 | + | |
| 28 | +/** | |
| 29 | +* {@link NotifyTemplateServiceImpl} 的单元测试类 | |
| 30 | +* | |
| 31 | +* @author 芋道源码 | |
| 32 | +*/ | |
| 33 | +@Import(NotifyTemplateServiceImpl.class) | |
| 34 | +public class NotifyTemplateServiceImplTest extends BaseDbUnitTest { | |
| 35 | + | |
| 36 | + @Resource | |
| 37 | + private NotifyTemplateServiceImpl notifyTemplateService; | |
| 38 | + | |
| 39 | + @Resource | |
| 40 | + private NotifyTemplateMapper notifyTemplateMapper; | |
| 41 | + | |
| 42 | + @MockBean | |
| 43 | + private NotifyProducer notifyProducer; | |
| 44 | + | |
| 45 | + @Test | |
| 46 | + public void testCreateNotifyTemplate_success() { | |
| 47 | + // 准备参数 | |
| 48 | + NotifyTemplateCreateReqVO reqVO = randomPojo(NotifyTemplateCreateReqVO.class, | |
| 49 | + o -> o.setStatus(randomCommonStatus())); | |
| 50 | + | |
| 51 | + // 调用 | |
| 52 | + Long notifyTemplateId = notifyTemplateService.createNotifyTemplate(reqVO); | |
| 53 | + // 断言 | |
| 54 | + assertNotNull(notifyTemplateId); | |
| 55 | + // 校验记录的属性是否正确 | |
| 56 | + NotifyTemplateDO notifyTemplate = notifyTemplateMapper.selectById(notifyTemplateId); | |
| 57 | + assertPojoEquals(reqVO, notifyTemplate); | |
| 58 | + verify(notifyProducer).sendNotifyTemplateRefreshMessage(); | |
| 59 | + } | |
| 60 | + | |
| 61 | + @Test | |
| 62 | + public void testUpdateNotifyTemplate_success() { | |
| 63 | + // mock 数据 | |
| 64 | + NotifyTemplateDO dbNotifyTemplate = randomPojo(NotifyTemplateDO.class); | |
| 65 | + notifyTemplateMapper.insert(dbNotifyTemplate);// @Sql: 先插入出一条存在的数据 | |
| 66 | + // 准备参数 | |
| 67 | + NotifyTemplateUpdateReqVO reqVO = randomPojo(NotifyTemplateUpdateReqVO.class, o -> { | |
| 68 | + o.setId(dbNotifyTemplate.getId()); // 设置更新的 ID | |
| 69 | + o.setStatus(randomCommonStatus()); | |
| 70 | + }); | |
| 71 | + | |
| 72 | + // 调用 | |
| 73 | + notifyTemplateService.updateNotifyTemplate(reqVO); | |
| 74 | + // 校验是否更新正确 | |
| 75 | + NotifyTemplateDO notifyTemplate = notifyTemplateMapper.selectById(reqVO.getId()); // 获取最新的 | |
| 76 | + assertPojoEquals(reqVO, notifyTemplate); | |
| 77 | + verify(notifyProducer).sendNotifyTemplateRefreshMessage(); | |
| 78 | + } | |
| 79 | + | |
| 80 | + @Test | |
| 81 | + public void testUpdateNotifyTemplate_notExists() { | |
| 82 | + // 准备参数 | |
| 83 | + NotifyTemplateUpdateReqVO reqVO = randomPojo(NotifyTemplateUpdateReqVO.class); | |
| 84 | + | |
| 85 | + // 调用, 并断言异常 | |
| 86 | + assertServiceException(() -> notifyTemplateService.updateNotifyTemplate(reqVO), NOTIFY_TEMPLATE_NOT_EXISTS); | |
| 87 | + } | |
| 88 | + | |
| 89 | + @Test | |
| 90 | + public void testDeleteNotifyTemplate_success() { | |
| 91 | + // mock 数据 | |
| 92 | + NotifyTemplateDO dbNotifyTemplate = randomPojo(NotifyTemplateDO.class); | |
| 93 | + notifyTemplateMapper.insert(dbNotifyTemplate);// @Sql: 先插入出一条存在的数据 | |
| 94 | + // 准备参数 | |
| 95 | + Long id = dbNotifyTemplate.getId(); | |
| 96 | + | |
| 97 | + // 调用 | |
| 98 | + notifyTemplateService.deleteNotifyTemplate(id); | |
| 99 | + // 校验数据不存在了 | |
| 100 | + assertNull(notifyTemplateMapper.selectById(id)); | |
| 101 | + verify(notifyProducer).sendNotifyTemplateRefreshMessage(); | |
| 102 | + } | |
| 103 | + | |
| 104 | + @Test | |
| 105 | + public void testDeleteNotifyTemplate_notExists() { | |
| 106 | + // 准备参数 | |
| 107 | + Long id = randomLongId(); | |
| 108 | + | |
| 109 | + // 调用, 并断言异常 | |
| 110 | + assertServiceException(() -> notifyTemplateService.deleteNotifyTemplate(id), NOTIFY_TEMPLATE_NOT_EXISTS); | |
| 111 | + } | |
| 112 | + | |
| 113 | + @Test | |
| 114 | + public void testGetNotifyTemplatePage() { | |
| 115 | + // mock 数据 | |
| 116 | + NotifyTemplateDO dbNotifyTemplate = randomPojo(NotifyTemplateDO.class, o -> { // 等会查询到 | |
| 117 | + o.setName("芋头"); | |
| 118 | + o.setCode("test_01"); | |
| 119 | + o.setStatus(CommonStatusEnum.ENABLE.getStatus()); | |
| 120 | + o.setCreateTime(buildTime(2022, 2, 3)); | |
| 121 | + }); | |
| 122 | + notifyTemplateMapper.insert(dbNotifyTemplate); | |
| 123 | + // 测试 name 不匹配 | |
| 124 | + notifyTemplateMapper.insert(cloneIgnoreId(dbNotifyTemplate, o -> o.setName("投"))); | |
| 125 | + // 测试 code 不匹配 | |
| 126 | + notifyTemplateMapper.insert(cloneIgnoreId(dbNotifyTemplate, o -> o.setCode("test_02"))); | |
| 127 | + // 测试 status 不匹配 | |
| 128 | + notifyTemplateMapper.insert(cloneIgnoreId(dbNotifyTemplate, o -> o.setStatus(CommonStatusEnum.DISABLE.getStatus()))); | |
| 129 | + // 测试 createTime 不匹配 | |
| 130 | + notifyTemplateMapper.insert(cloneIgnoreId(dbNotifyTemplate, o -> o.setCreateTime(buildTime(2022, 1, 5)))); | |
| 131 | + // 准备参数 | |
| 132 | + NotifyTemplatePageReqVO reqVO = new NotifyTemplatePageReqVO(); | |
| 133 | + reqVO.setName("芋"); | |
| 134 | + reqVO.setCode("est_01"); | |
| 135 | + reqVO.setStatus(CommonStatusEnum.ENABLE.getStatus()); | |
| 136 | + reqVO.setCreateTime(buildBetweenTime(2022, 2, 1, 2022, 2, 5)); | |
| 137 | + | |
| 138 | + // 调用 | |
| 139 | + PageResult<NotifyTemplateDO> pageResult = notifyTemplateService.getNotifyTemplatePage(reqVO); | |
| 140 | + // 断言 | |
| 141 | + assertEquals(1, pageResult.getTotal()); | |
| 142 | + assertEquals(1, pageResult.getList().size()); | |
| 143 | + assertPojoEquals(dbNotifyTemplate, pageResult.getList().get(0)); | |
| 144 | + } | |
| 145 | + | |
| 146 | +} | ... | ... |
yudao-module-system/yudao-module-system-biz/src/test/java/cn/iocoder/yudao/module/system/service/sms/SmsLogServiceTest.java
| ... | ... | @@ -235,7 +235,6 @@ public class SmsLogServiceTest extends BaseDbUnitTest { |
| 235 | 235 | return randomPojo(SmsLogDO.class, ArrayUtils.append(consumer, consumers)); |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | - | |
| 239 | 238 | private static Map<String, Object> randomTemplateParams() { |
| 240 | 239 | return MapUtil.<String, Object>builder().put(randomString(), randomString()) |
| 241 | 240 | .put(randomString(), randomString()).build(); | ... | ... |
yudao-module-system/yudao-module-system-biz/src/test/resources/sql/clean.sql
| ... | ... | @@ -25,3 +25,8 @@ DELETE FROM "system_oauth2_approve"; |
| 25 | 25 | DELETE FROM "system_oauth2_access_token"; |
| 26 | 26 | DELETE FROM "system_oauth2_refresh_token"; |
| 27 | 27 | DELETE FROM "system_oauth2_code"; |
| 28 | +DELETE FROM "system_mail_account"; | |
| 29 | +DELETE FROM "system_mail_template"; | |
| 30 | +DELETE FROM "system_mail_log"; | |
| 31 | +DELETE FROM "system_notify_template"; | |
| 32 | +DELETE FROM "system_notify_message"; | ... | ... |
yudao-module-system/yudao-module-system-biz/src/test/resources/sql/create_tables.sql
| ... | ... | @@ -566,3 +566,103 @@ CREATE TABLE IF NOT EXISTS "system_oauth2_code" ( |
| 566 | 566 | "deleted" bit NOT NULL DEFAULT FALSE, |
| 567 | 567 | PRIMARY KEY ("id") |
| 568 | 568 | ) COMMENT 'OAuth2 刷新令牌'; |
| 569 | + | |
| 570 | +CREATE TABLE IF NOT EXISTS "system_mail_account" ( | |
| 571 | + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 572 | + "mail" varchar NOT NULL, | |
| 573 | + "username" varchar NOT NULL, | |
| 574 | + "password" varchar NOT NULL, | |
| 575 | + "host" varchar NOT NULL, | |
| 576 | + "port" int NOT NULL, | |
| 577 | + "ssl_enable" bit NOT NULL, | |
| 578 | + "creator" varchar DEFAULT '', | |
| 579 | + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 580 | + "updater" varchar DEFAULT '', | |
| 581 | + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | |
| 582 | + "deleted" bit NOT NULL DEFAULT FALSE, | |
| 583 | + PRIMARY KEY ("id") | |
| 584 | +) COMMENT '邮箱账号表'; | |
| 585 | + | |
| 586 | +CREATE TABLE IF NOT EXISTS "system_mail_template" ( | |
| 587 | + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 588 | + "name" varchar NOT NULL, | |
| 589 | + "code" varchar NOT NULL, | |
| 590 | + "account_id" bigint NOT NULL, | |
| 591 | + "nickname" varchar, | |
| 592 | + "title" varchar NOT NULL, | |
| 593 | + "content" varchar NOT NULL, | |
| 594 | + "params" varchar NOT NULL, | |
| 595 | + "status" varchar NOT NULL, | |
| 596 | + "remark" varchar, | |
| 597 | + "creator" varchar DEFAULT '', | |
| 598 | + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 599 | + "updater" varchar DEFAULT '', | |
| 600 | + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | |
| 601 | + "deleted" bit NOT NULL DEFAULT FALSE, | |
| 602 | + PRIMARY KEY ("id") | |
| 603 | +) COMMENT '邮件模版表'; | |
| 604 | + | |
| 605 | +CREATE TABLE IF NOT EXISTS "system_mail_log" ( | |
| 606 | + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 607 | + "user_id" bigint, | |
| 608 | + "user_type" varchar, | |
| 609 | + "to_mail" varchar NOT NULL, | |
| 610 | + "account_id" bigint NOT NULL, | |
| 611 | + "from_mail" varchar NOT NULL, | |
| 612 | + "template_id" bigint NOT NULL, | |
| 613 | + "template_code" varchar NOT NULL, | |
| 614 | + "template_nickname" varchar, | |
| 615 | + "template_title" varchar NOT NULL, | |
| 616 | + "template_content" varchar NOT NULL, | |
| 617 | + "template_params" varchar NOT NULL, | |
| 618 | + "send_status" varchar NOT NULL, | |
| 619 | + "send_time" datetime, | |
| 620 | + "send_message_id" varchar, | |
| 621 | + "send_exception" varchar, | |
| 622 | + "creator" varchar DEFAULT '', | |
| 623 | + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 624 | + "updater" varchar DEFAULT '', | |
| 625 | + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | |
| 626 | + "deleted" bit NOT NULL DEFAULT FALSE, | |
| 627 | + PRIMARY KEY ("id") | |
| 628 | +) COMMENT '邮件日志表'; | |
| 629 | + | |
| 630 | +-- 将该建表 SQL 语句,添加到 yudao-module-system-biz 模块的 test/resources/sql/create_tables.sql 文件里 | |
| 631 | +CREATE TABLE IF NOT EXISTS "system_notify_template" ( | |
| 632 | + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 633 | + "name" varchar NOT NULL, | |
| 634 | + "code" varchar NOT NULL, | |
| 635 | + "nickname" varchar NOT NULL, | |
| 636 | + "content" varchar NOT NULL, | |
| 637 | + "type" varchar NOT NULL, | |
| 638 | + "params" varchar, | |
| 639 | + "status" varchar NOT NULL, | |
| 640 | + "remark" varchar, | |
| 641 | + "creator" varchar DEFAULT '', | |
| 642 | + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 643 | + "updater" varchar DEFAULT '', | |
| 644 | + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | |
| 645 | + "deleted" bit NOT NULL DEFAULT FALSE, | |
| 646 | + PRIMARY KEY ("id") | |
| 647 | +) COMMENT '站内信模板表'; | |
| 648 | + | |
| 649 | +CREATE TABLE IF NOT EXISTS "system_notify_message" ( | |
| 650 | + "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | |
| 651 | + "user_id" bigint NOT NULL, | |
| 652 | + "user_type" varchar NOT NULL, | |
| 653 | + "template_id" bigint NOT NULL, | |
| 654 | + "template_code" varchar NOT NULL, | |
| 655 | + "template_nickname" varchar NOT NULL, | |
| 656 | + "template_content" varchar NOT NULL, | |
| 657 | + "template_type" int NOT NULL, | |
| 658 | + "template_params" varchar NOT NULL, | |
| 659 | + "read_status" bit NOT NULL, | |
| 660 | + "read_time" varchar, | |
| 661 | + "creator" varchar DEFAULT '', | |
| 662 | + "create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
| 663 | + "updater" varchar DEFAULT '', | |
| 664 | + "update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | |
| 665 | + "deleted" bit NOT NULL DEFAULT FALSE, | |
| 666 | + "tenant_id" bigint not null default '0', | |
| 667 | + PRIMARY KEY ("id") | |
| 668 | +) COMMENT '站内信消息表'; | ... | ... |
yudao-server/pom.xml
| ... | ... | @@ -112,7 +112,7 @@ |
| 112 | 112 | <plugin> |
| 113 | 113 | <groupId>org.springframework.boot</groupId> |
| 114 | 114 | <artifactId>spring-boot-maven-plugin</artifactId> |
| 115 | - <version>2.7.7</version> <!-- 如果 spring.boot.version 版本修改,则这里也要跟着修改 --> | |
| 115 | + <version>2.7.8</version> <!-- 如果 spring.boot.version 版本修改,则这里也要跟着修改 --> | |
| 116 | 116 | <configuration> |
| 117 | 117 | <fork>true</fork> |
| 118 | 118 | </configuration> | ... | ... |
yudao-server/src/main/java/cn/iocoder/yudao/server/controller/DefaultController.java
| ... | ... | @@ -21,4 +21,10 @@ public class DefaultController { |
| 21 | 21 | "[工作流模块 yudao-module-bpm - 已禁用][参考 https://doc.iocoder.cn/bpm/ 开启]"); |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | + @RequestMapping("/admin-api/mp/**") | |
| 25 | + public CommonResult<Boolean> mp404() { | |
| 26 | + return CommonResult.error(NOT_IMPLEMENTED.getCode(), | |
| 27 | + "[微信公众号 yudao-module-mp - 已禁用][参考 https://doc.iocoder.cn/mp/build/ 开启]"); | |
| 28 | + } | |
| 29 | + | |
| 24 | 30 | } | ... | ... |
yudao-server/src/main/resources/application.yaml
| ... | ... | @@ -115,6 +115,7 @@ yudao: |
| 115 | 115 | - cn.iocoder.yudao.module.member.enums.ErrorCodeConstants |
| 116 | 116 | - cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants |
| 117 | 117 | - cn.iocoder.yudao.module.system.enums.ErrorCodeConstants |
| 118 | + - cn.iocoder.yudao.module.mp.enums.ErrorCodeConstants | |
| 118 | 119 | tenant: # 多租户相关配置项 |
| 119 | 120 | enable: true |
| 120 | 121 | ignore-urls: |
| ... | ... | @@ -138,6 +139,10 @@ yudao: |
| 138 | 139 | - system_sms_log |
| 139 | 140 | - system_sensitive_word |
| 140 | 141 | - system_oauth2_client |
| 142 | + - system_mail_account | |
| 143 | + - system_mail_template | |
| 144 | + - system_mail_log | |
| 145 | + - system_notify_template | |
| 141 | 146 | - infra_codegen_column |
| 142 | 147 | - infra_codegen_table |
| 143 | 148 | - infra_test_demo | ... | ... |
yudao-ui-admin-vue3/package.json
yudao-ui-admin-vue3/src/api/system/mail/account/index.ts
0 → 100644
| 1 | +import request from '@/config/axios' | |
| 2 | + | |
| 3 | +export interface MailAccountVO { | |
| 4 | + id: number | |
| 5 | + mail: string | |
| 6 | + username: string | |
| 7 | + password: string | |
| 8 | + host: string | |
| 9 | + port: number | |
| 10 | + sslEnable: boolean | |
| 11 | +} | |
| 12 | + | |
| 13 | +export interface MailAccountPageReqVO extends PageParam { | |
| 14 | + mail?: string | |
| 15 | + username?: string | |
| 16 | +} | |
| 17 | + | |
| 18 | +// 查询邮箱账号列表 | |
| 19 | +export const getMailAccountPageApi = async (params: MailAccountPageReqVO) => { | |
| 20 | + return await request.get({ url: '/system/mail-account/page', params }) | |
| 21 | +} | |
| 22 | + | |
| 23 | +// 查询邮箱账号详情 | |
| 24 | +export const getMailAccountApi = async (id: number) => { | |
| 25 | + return await request.get({ url: '/system/mail-account/get?id=' + id }) | |
| 26 | +} | |
| 27 | + | |
| 28 | +// 新增邮箱账号 | |
| 29 | +export const createMailAccountApi = async (data: MailAccountVO) => { | |
| 30 | + return await request.post({ url: '/system/mail-account/create', data }) | |
| 31 | +} | |
| 32 | + | |
| 33 | +// 修改邮箱账号 | |
| 34 | +export const updateMailAccountApi = async (data: MailAccountVO) => { | |
| 35 | + return await request.put({ url: '/system/mail-account/update', data }) | |
| 36 | +} | |
| 37 | + | |
| 38 | +// 删除邮箱账号 | |
| 39 | +export const deleteMailAccountApi = async (id: number) => { | |
| 40 | + return await request.delete({ url: '/system/mail-account/delete?id=' + id }) | |
| 41 | +} | |
| 42 | + | |
| 43 | +// 获得邮箱账号精简列表 | |
| 44 | +export const getSimpleMailAccounts = async () => { | |
| 45 | + return request.get({ url: '/system/mail-account/list-all-simple' }) | |
| 46 | +} | ... | ... |
yudao-ui-admin-vue3/src/api/system/mail/log/index.ts
0 → 100644
| 1 | +import request from '@/config/axios' | |
| 2 | + | |
| 3 | +export interface MailLogVO { | |
| 4 | + id: number | |
| 5 | + userId: number | |
| 6 | + userType: number | |
| 7 | + toMail: string | |
| 8 | + accountId: number | |
| 9 | + fromMail: string | |
| 10 | + templateId: number | |
| 11 | + templateCode: string | |
| 12 | + templateNickname: string | |
| 13 | + templateTitle: string | |
| 14 | + templateContent: string | |
| 15 | + templateParams: string | |
| 16 | + sendStatus: number | |
| 17 | + sendTime: Date | |
| 18 | + sendMessageId: string | |
| 19 | + sendException: string | |
| 20 | +} | |
| 21 | + | |
| 22 | +export interface MailLogPageReqVO extends PageParam { | |
| 23 | + userId?: number | |
| 24 | + userType?: number | |
| 25 | + toMail?: string | |
| 26 | + accountId?: number | |
| 27 | + templateId?: number | |
| 28 | + sendStatus?: number | |
| 29 | + sendTime?: Date[] | |
| 30 | +} | |
| 31 | + | |
| 32 | +// 查询邮件日志列表 | |
| 33 | +export const getMailLogPageApi = async (params: MailLogPageReqVO) => { | |
| 34 | + return await request.get({ url: '/system/mail-log/page', params }) | |
| 35 | +} | |
| 36 | + | |
| 37 | +// 查询邮件日志详情 | |
| 38 | +export const getMailLogApi = async (id: number) => { | |
| 39 | + return await request.get({ url: '/system/mail-log/get?id=' + id }) | |
| 40 | +} | ... | ... |
yudao-ui-admin-vue3/src/api/system/mail/template/index.ts
0 → 100644
| 1 | +import request from '@/config/axios' | |
| 2 | + | |
| 3 | +export interface MailTemplateVO { | |
| 4 | + id: number | |
| 5 | + name: string | |
| 6 | + code: string | |
| 7 | + accountId: number | |
| 8 | + nickname: string | |
| 9 | + title: string | |
| 10 | + content: string | |
| 11 | + params: string | |
| 12 | + status: number | |
| 13 | + remark: string | |
| 14 | +} | |
| 15 | + | |
| 16 | +export interface MailTemplatePageReqVO extends PageParam { | |
| 17 | + name?: string | |
| 18 | + code?: string | |
| 19 | + accountId?: number | |
| 20 | + status?: number | |
| 21 | + createTime?: Date[] | |
| 22 | +} | |
| 23 | + | |
| 24 | +export interface MailSendReqVO { | |
| 25 | + mail: string | |
| 26 | + templateCode: string | |
| 27 | + templateParams: Map<String, Object> | |
| 28 | +} | |
| 29 | + | |
| 30 | +// 查询邮件模版列表 | |
| 31 | +export const getMailTemplatePageApi = async (params: MailTemplatePageReqVO) => { | |
| 32 | + return await request.get({ url: '/system/mail-template/page', params }) | |
| 33 | +} | |
| 34 | + | |
| 35 | +// 查询邮件模版详情 | |
| 36 | +export const getMailTemplateApi = async (id: number) => { | |
| 37 | + return await request.get({ url: '/system/mail-template/get?id=' + id }) | |
| 38 | +} | |
| 39 | + | |
| 40 | +// 新增邮件模版 | |
| 41 | +export const createMailTemplateApi = async (data: MailTemplateVO) => { | |
| 42 | + return await request.post({ url: '/system/mail-template/create', data }) | |
| 43 | +} | |
| 44 | + | |
| 45 | +// 修改邮件模版 | |
| 46 | +export const updateMailTemplateApi = async (data: MailTemplateVO) => { | |
| 47 | + return await request.put({ url: '/system/mail-template/update', data }) | |
| 48 | +} | |
| 49 | + | |
| 50 | +// 删除邮件模版 | |
| 51 | +export const deleteMailTemplateApi = async (id: number) => { | |
| 52 | + return await request.delete({ url: '/system/mail-template/delete?id=' + id }) | |
| 53 | +} | |
| 54 | + | |
| 55 | +// 发送邮件 | |
| 56 | +export const sendMailApi = (data: MailSendReqVO) => { | |
| 57 | + return request.post({ url: '/system/mail-template/send-mail', data }) | |
| 58 | +} | ... | ... |
yudao-ui-admin-vue3/src/api/system/notify/message/index.ts
0 → 100644
| 1 | +import request from '@/config/axios' | |
| 2 | +import qs from 'qs' | |
| 3 | + | |
| 4 | +export interface NotifyMessageVO { | |
| 5 | + id: number | |
| 6 | + userId: number | |
| 7 | + userType: number | |
| 8 | + templateId: number | |
| 9 | + templateCode: string | |
| 10 | + templateNickname: string | |
| 11 | + templateContent: string | |
| 12 | + templateType: number | |
| 13 | + templateParams: string | |
| 14 | + readStatus: boolean | |
| 15 | + readTime: Date | |
| 16 | +} | |
| 17 | + | |
| 18 | +export interface NotifyMessagePageReqVO extends PageParam { | |
| 19 | + userId?: number | |
| 20 | + userType?: number | |
| 21 | + templateCode?: string | |
| 22 | + templateType?: number | |
| 23 | + createTime?: Date[] | |
| 24 | +} | |
| 25 | + | |
| 26 | +export interface NotifyMessageMyPageReqVO extends PageParam { | |
| 27 | + readStatus?: boolean | |
| 28 | + createTime?: Date[] | |
| 29 | +} | |
| 30 | + | |
| 31 | +// 查询站内信消息列表 | |
| 32 | +export const getNotifyMessagePageApi = async (params: NotifyMessagePageReqVO) => { | |
| 33 | + return await request.get({ url: '/system/notify-message/page', params }) | |
| 34 | +} | |
| 35 | + | |
| 36 | +// 查询站内信消息详情 | |
| 37 | +export const getNotifyMessageApi = async (id: number) => { | |
| 38 | + return await request.get({ url: '/system/notify-message/get?id=' + id }) | |
| 39 | +} | |
| 40 | + | |
| 41 | +// 获得我的站内信分页 | |
| 42 | +export const getMyNotifyMessagePage = async (params: NotifyMessageMyPageReqVO) => { | |
| 43 | + return await request.get({ url: '/system/notify-message/my-page', params }) | |
| 44 | +} | |
| 45 | + | |
| 46 | +// 批量标记已读 | |
| 47 | +export const updateNotifyMessageRead = async (ids) => { | |
| 48 | + return await request.put({ | |
| 49 | + url: '/system/notify-message/update-read?' + qs.stringify({ ids: ids }, { indices: false }) | |
| 50 | + }) | |
| 51 | +} | |
| 52 | + | |
| 53 | +// 标记所有站内信为已读 | |
| 54 | +export const updateAllNotifyMessageRead = async () => { | |
| 55 | + return await request.put({ url: '/system/notify-message/update-all-read' }) | |
| 56 | +} | |
| 57 | + | |
| 58 | +// 获取当前用户的最新站内信列表 | |
| 59 | +export const getUnreadNotifyMessageListApi = async () => { | |
| 60 | + return await request.get({ url: '/system/notify-message/get-unread-list' }) | |
| 61 | +} | |
| 62 | + | |
| 63 | +// 获得当前用户的未读站内信数量 | |
| 64 | +export const getUnreadNotifyMessageCountApi = async () => { | |
| 65 | + return await request.get({ url: '/system/notify-message/get-unread-count' }) | |
| 66 | +} | ... | ... |
yudao-ui-admin-vue3/src/api/system/notify/template/index.ts
0 → 100644
| 1 | +import request from '@/config/axios' | |
| 2 | + | |
| 3 | +export interface NotifyTemplateVO { | |
| 4 | + id: number | |
| 5 | + name: string | |
| 6 | + code: string | |
| 7 | + content: string | |
| 8 | + type: number | |
| 9 | + params: string | |
| 10 | + status: number | |
| 11 | + remark: string | |
| 12 | +} | |
| 13 | + | |
| 14 | +export interface NotifyTemplatePageReqVO extends PageParam { | |
| 15 | + name?: string | |
| 16 | + code?: string | |
| 17 | + status?: number | |
| 18 | + createTime?: Date[] | |
| 19 | +} | |
| 20 | + | |
| 21 | +export interface NotifySendReqVO { | |
| 22 | + userId: number | |
| 23 | + templateCode: string | |
| 24 | + templateParams: Map<String, Object> | |
| 25 | +} | |
| 26 | + | |
| 27 | +// 查询站内信模板列表 | |
| 28 | +export const getNotifyTemplatePageApi = async (params: NotifyTemplatePageReqVO) => { | |
| 29 | + return await request.get({ url: '/system/notify-template/page', params }) | |
| 30 | +} | |
| 31 | + | |
| 32 | +// 查询站内信模板详情 | |
| 33 | +export const getNotifyTemplateApi = async (id: number) => { | |
| 34 | + return await request.get({ url: '/system/notify-template/get?id=' + id }) | |
| 35 | +} | |
| 36 | + | |
| 37 | +// 新增站内信模板 | |
| 38 | +export const createNotifyTemplateApi = async (data: NotifyTemplateVO) => { | |
| 39 | + return await request.post({ url: '/system/notify-template/create', data }) | |
| 40 | +} | |
| 41 | + | |
| 42 | +// 修改站内信模板 | |
| 43 | +export const updateNotifyTemplateApi = async (data: NotifyTemplateVO) => { | |
| 44 | + return await request.put({ url: '/system/notify-template/update', data }) | |
| 45 | +} | |
| 46 | + | |
| 47 | +// 删除站内信模板 | |
| 48 | +export const deleteNotifyTemplateApi = async (id: number) => { | |
| 49 | + return await request.delete({ url: '/system/notify-template/delete?id=' + id }) | |
| 50 | +} | |
| 51 | + | |
| 52 | +// 发送站内信 | |
| 53 | +export const sendNotifyApi = (data: NotifySendReqVO) => { | |
| 54 | + return request.post({ url: '/system/notify-template/send-notify', data }) | |
| 55 | +} | ... | ... |
yudao-ui-admin-vue3/src/hooks/web/useXTable.ts
| ... | ... | @@ -7,7 +7,7 @@ export interface tableMethod { |
| 7 | 7 | deleteBatch: () => void // 批量删除 |
| 8 | 8 | exportList: (fileName?: string) => void // 导出列表 |
| 9 | 9 | getCurrentColumn: () => void // 获取当前列 |
| 10 | - getRadioRecord: () => void // 获取当前选中列,redio | |
| 10 | + getRadioRecord: () => void // 获取当前选中列,radio | |
| 11 | 11 | getCheckboxRecords: () => void //获取当前选中列, checkbox |
| 12 | 12 | } |
| 13 | 13 | ... | ... |
yudao-ui-admin-vue3/src/layout/components/Message/src/Message.vue
| 1 | 1 | <script setup lang="ts"> |
| 2 | +import dayjs from 'dayjs' | |
| 3 | +import * as NotifyMessageApi from '@/api/system/notify/message' | |
| 4 | + | |
| 5 | +const { push } = useRouter() | |
| 2 | 6 | const activeName = ref('notice') |
| 7 | +const unreadCount = ref(0) // 未读消息数量 | |
| 8 | +const list = ref([]) // 消息列表 | |
| 9 | + | |
| 10 | +// 获得消息列表 | |
| 11 | +const getList = async () => { | |
| 12 | + list.value = await NotifyMessageApi.getUnreadNotifyMessageListApi() | |
| 13 | + // 强制设置 unreadCount 为 0,避免小红点因为轮询太慢,不消除 | |
| 14 | + unreadCount.value = 0 | |
| 15 | +} | |
| 16 | + | |
| 17 | +// 获得未读消息数 | |
| 18 | +const getUnreadCount = async () => { | |
| 19 | + NotifyMessageApi.getUnreadNotifyMessageCountApi().then((data) => { | |
| 20 | + unreadCount.value = data | |
| 21 | + }) | |
| 22 | +} | |
| 23 | + | |
| 24 | +// 跳转我的站内信 | |
| 25 | +const goMyList = () => { | |
| 26 | + push({ | |
| 27 | + name: 'MyNotifyMessage' | |
| 28 | + }) | |
| 29 | +} | |
| 3 | 30 | |
| 4 | -const noticeList = ref([ | |
| 5 | - { id: 1, title: '版本升级1', date: '2022-12-12 10:00:00' }, | |
| 6 | - { id: 2, title: '版本升级2', date: '2022-12-12 10:00:00' }, | |
| 7 | - { id: 3, title: '版本升级3', date: '2022-12-12 10:00:00' }, | |
| 8 | - { id: 4, title: '版本升级4', date: '2022-12-12 10:00:00' }, | |
| 9 | - { id: 5, title: '版本升级5', date: '2022-12-12 10:00:00' } | |
| 10 | -]) | |
| 11 | -const messageList = ref([ | |
| 12 | - { id: 1, title: '加班1', date: '2022-12-12 10:00:00' }, | |
| 13 | - { id: 2, title: '加班2', date: '2022-12-12 10:00:00' }, | |
| 14 | - { id: 3, title: '加班3', date: '2022-12-12 10:00:00' }, | |
| 15 | - { id: 4, title: '加班4', date: '2022-12-12 10:00:00' }, | |
| 16 | - { id: 5, title: '加班5', date: '2022-12-12 10:00:00' } | |
| 17 | -]) | |
| 18 | -const needList = ref([ | |
| 19 | - { id: 1, title: '审批1', date: '2022-12-12 10:00:00' }, | |
| 20 | - { id: 2, title: '审批2', date: '2022-12-12 10:00:00' }, | |
| 21 | - { id: 3, title: '审批3', date: '2022-12-12 10:00:00' }, | |
| 22 | - { id: 4, title: '审批4', date: '2022-12-12 10:00:00' }, | |
| 23 | - { id: 5, title: '审批5', date: '2022-12-12 10:00:00' } | |
| 24 | -]) | |
| 31 | +// ========== 初始化 ========= | |
| 32 | +onMounted(() => { | |
| 33 | + // 首次加载小红点 | |
| 34 | + getUnreadCount() | |
| 35 | + // 轮询刷新小红点 | |
| 36 | + setInterval(() => { | |
| 37 | + getUnreadCount() | |
| 38 | + }, 1000 * 60 * 2) | |
| 39 | +}) | |
| 25 | 40 | </script> |
| 26 | 41 | <template> |
| 27 | 42 | <div class="message"> |
| 28 | - <ElPopover placement="bottom" :width="310" trigger="click"> | |
| 43 | + <ElPopover placement="bottom" :width="400" trigger="click"> | |
| 29 | 44 | <template #reference> |
| 30 | - <ElBadge :value="noticeList.length" class="item"> | |
| 31 | - <Icon icon="ep:bell" :size="18" class="cursor-pointer" /> | |
| 45 | + <ElBadge :is-dot="unreadCount > 0" class="item"> | |
| 46 | + <Icon icon="ep:bell" :size="18" class="cursor-pointer" @click="getList" /> | |
| 32 | 47 | </ElBadge> |
| 33 | 48 | </template> |
| 34 | 49 | <ElTabs v-model="activeName"> |
| 35 | - <ElTabPane label="通知(5)" name="notice"> | |
| 36 | - <div class="message-list"> | |
| 37 | - <template v-for="item in noticeList" :key="item.id"> | |
| 38 | - <div class="message-item"> | |
| 39 | - <img src="@/assets/imgs/avatar.gif" alt="" class="message-icon" /> | |
| 40 | - <div class="message-content"> | |
| 41 | - <span class="message-title">{{ item.title }}</span> | |
| 42 | - <span class="message-date">{{ item.date }}</span> | |
| 43 | - </div> | |
| 44 | - </div> | |
| 45 | - </template> | |
| 46 | - </div> | |
| 47 | - </ElTabPane> | |
| 48 | - <ElTabPane label="消息(0)" name="message"> | |
| 49 | - <div class="message-list"> | |
| 50 | - <template v-for="item in messageList" :key="item.id"> | |
| 51 | - <div class="message-item"> | |
| 52 | - <img src="@/assets/imgs/avatar.gif" alt="" class="message-icon" /> | |
| 53 | - <div class="message-content"> | |
| 54 | - <span class="message-title">{{ item.title }}</span> | |
| 55 | - <span class="message-date">{{ item.date }}</span> | |
| 56 | - </div> | |
| 57 | - </div> | |
| 58 | - </template> | |
| 59 | - </div> | |
| 60 | - </ElTabPane> | |
| 61 | - <ElTabPane label="代办(0)" name="need"> | |
| 50 | + <ElTabPane label="我的站内信" name="notice"> | |
| 62 | 51 | <div class="message-list"> |
| 63 | - <template v-for="item in needList" :key="item.id"> | |
| 52 | + <template v-for="item in list" :key="item.id"> | |
| 64 | 53 | <div class="message-item"> |
| 65 | 54 | <img src="@/assets/imgs/avatar.gif" alt="" class="message-icon" /> |
| 66 | 55 | <div class="message-content"> |
| 67 | - <span class="message-title">{{ item.title }}</span> | |
| 68 | - <span class="message-date">{{ item.date }}</span> | |
| 56 | + <span class="message-title"> | |
| 57 | + {{ item.templateNickname }}:{{ item.templateContent }} | |
| 58 | + </span> | |
| 59 | + <span class="message-date"> | |
| 60 | + {{ dayjs(item.createTime).format('YYYY-MM-DD HH:mm:ss') }} | |
| 61 | + </span> | |
| 69 | 62 | </div> |
| 70 | 63 | </div> |
| 71 | 64 | </template> |
| 72 | 65 | </div> |
| 73 | 66 | </ElTabPane> |
| 74 | 67 | </ElTabs> |
| 68 | + <!-- 更多 --> | |
| 69 | + <div style="text-align: right; margin-top: 10px"> | |
| 70 | + <XButton type="primary" preIcon="ep:view" title="查看全部" @click="goMyList" /> | |
| 71 | + </div> | |
| 75 | 72 | </ElPopover> |
| 76 | 73 | </div> |
| 77 | 74 | </template> | ... | ... |
yudao-ui-admin-vue3/src/layout/components/UserInfo/src/UserInfo.vue
yudao-ui-admin-vue3/src/router/modules/remaining.ts
| ... | ... | @@ -71,7 +71,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ |
| 71 | 71 | ] |
| 72 | 72 | }, |
| 73 | 73 | { |
| 74 | - path: '/userinfo', | |
| 74 | + path: '/user', | |
| 75 | 75 | component: Layout, |
| 76 | 76 | name: 'UserInfo', |
| 77 | 77 | meta: { |
| ... | ... | @@ -89,6 +89,18 @@ const remainingRouter: AppRouteRecordRaw[] = [ |
| 89 | 89 | icon: 'ep:user', |
| 90 | 90 | title: t('common.profile') |
| 91 | 91 | } |
| 92 | + }, | |
| 93 | + { | |
| 94 | + path: 'notify-message', | |
| 95 | + component: () => import('@/views/system/notify/my/index.vue'), | |
| 96 | + name: 'MyNotifyMessage', | |
| 97 | + meta: { | |
| 98 | + canTo: true, | |
| 99 | + hidden: true, | |
| 100 | + noTagsView: false, | |
| 101 | + icon: 'ep:message', | |
| 102 | + title: '我的站内信' | |
| 103 | + } | |
| 92 | 104 | } |
| 93 | 105 | ] |
| 94 | 106 | }, | ... | ... |
yudao-ui-admin-vue3/src/utils/dict.ts
| ... | ... | @@ -90,6 +90,8 @@ export enum DICT_TYPE { |
| 90 | 90 | SYSTEM_SMS_RECEIVE_STATUS = 'system_sms_receive_status', |
| 91 | 91 | SYSTEM_ERROR_CODE_TYPE = 'system_error_code_type', |
| 92 | 92 | SYSTEM_OAUTH2_GRANT_TYPE = 'system_oauth2_grant_type', |
| 93 | + SYSTEM_MAIL_SEND_STATUS = 'system_mail_send_status', | |
| 94 | + SYSTEM_NOTIFY_TEMPLATE_TYPE = 'system_notify_template_type', | |
| 93 | 95 | |
| 94 | 96 | // ========== INFRA 模块 ========== |
| 95 | 97 | INFRA_BOOLEAN_STRING = 'infra_boolean_string', | ... | ... |
yudao-ui-admin-vue3/src/views/system/mail/account/account.data.ts
0 → 100644
| 1 | +import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' | |
| 2 | + | |
| 3 | +// 表单校验 | |
| 4 | +export const rules = reactive({ | |
| 5 | + mail: [required], | |
| 6 | + username: [required], | |
| 7 | + password: [required], | |
| 8 | + host: [required], | |
| 9 | + port: [required], | |
| 10 | + sslEnable: [required] | |
| 11 | +}) | |
| 12 | + | |
| 13 | +// CrudSchema | |
| 14 | +const crudSchemas = reactive<VxeCrudSchema>({ | |
| 15 | + primaryKey: 'id', // 默认的主键 ID | |
| 16 | + primaryTitle: '编号', | |
| 17 | + primaryType: 'id', | |
| 18 | + action: true, | |
| 19 | + actionWidth: '200', // 3 个按钮默认 200,如有删减对应增减即可 | |
| 20 | + columns: [ | |
| 21 | + { | |
| 22 | + title: '邮箱', | |
| 23 | + field: 'mail', | |
| 24 | + isSearch: true | |
| 25 | + }, | |
| 26 | + { | |
| 27 | + title: '用户名', | |
| 28 | + field: 'username', | |
| 29 | + isSearch: true | |
| 30 | + }, | |
| 31 | + { | |
| 32 | + title: '密码', | |
| 33 | + field: 'password', | |
| 34 | + isTable: false | |
| 35 | + }, | |
| 36 | + { | |
| 37 | + title: 'SMTP 服务器域名', | |
| 38 | + field: 'host' | |
| 39 | + }, | |
| 40 | + { | |
| 41 | + title: 'SMTP 服务器端口', | |
| 42 | + field: 'port', | |
| 43 | + form: { | |
| 44 | + component: 'InputNumber', | |
| 45 | + value: 465 | |
| 46 | + } | |
| 47 | + }, | |
| 48 | + { | |
| 49 | + title: '是否开启 SSL', | |
| 50 | + field: 'sslEnable', | |
| 51 | + dictType: DICT_TYPE.INFRA_BOOLEAN_STRING, | |
| 52 | + dictClass: 'boolean' | |
| 53 | + }, | |
| 54 | + { | |
| 55 | + title: '创建时间', | |
| 56 | + field: 'createTime', | |
| 57 | + isForm: false, | |
| 58 | + formatter: 'formatDate', | |
| 59 | + table: { | |
| 60 | + width: 180 | |
| 61 | + } | |
| 62 | + } | |
| 63 | + ] | |
| 64 | +}) | |
| 65 | +export const { allSchemas } = useVxeCrudSchemas(crudSchemas) | ... | ... |
yudao-ui-admin-vue3/src/views/system/mail/account/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <ContentWrap> | |
| 3 | + <!-- 列表 --> | |
| 4 | + <XTable @register="registerTable"> | |
| 5 | + <template #toolbar_buttons> | |
| 6 | + <!-- 操作:新增 --> | |
| 7 | + <XButton | |
| 8 | + type="primary" | |
| 9 | + preIcon="ep:zoom-in" | |
| 10 | + :title="t('action.add')" | |
| 11 | + v-hasPermi="['system:mail-account:create']" | |
| 12 | + @click="handleCreate()" | |
| 13 | + /> | |
| 14 | + </template> | |
| 15 | + <template #actionbtns_default="{ row }"> | |
| 16 | + <!-- 操作:修改 --> | |
| 17 | + <XTextButton | |
| 18 | + preIcon="ep:edit" | |
| 19 | + :title="t('action.edit')" | |
| 20 | + v-hasPermi="['system:mail-account:update']" | |
| 21 | + @click="handleUpdate(row.id)" | |
| 22 | + /> | |
| 23 | + <!-- 操作:详情 --> | |
| 24 | + <XTextButton | |
| 25 | + preIcon="ep:view" | |
| 26 | + :title="t('action.detail')" | |
| 27 | + v-hasPermi="['system:mail-account:query']" | |
| 28 | + @click="handleDetail(row.id)" | |
| 29 | + /> | |
| 30 | + <!-- 操作:删除 --> | |
| 31 | + <XTextButton | |
| 32 | + preIcon="ep:delete" | |
| 33 | + :title="t('action.del')" | |
| 34 | + v-hasPermi="['system:mail-account:delete']" | |
| 35 | + @click="deleteData(row.id)" | |
| 36 | + /> | |
| 37 | + </template> | |
| 38 | + </XTable> | |
| 39 | + </ContentWrap> | |
| 40 | + <!-- 弹窗 --> | |
| 41 | + <XModal id="mailAccountModel" :loading="modelLoading" v-model="modelVisible" :title="modelTitle"> | |
| 42 | + <!-- 表单:添加/修改 --> | |
| 43 | + <Form | |
| 44 | + ref="formRef" | |
| 45 | + v-if="['create', 'update'].includes(actionType)" | |
| 46 | + :schema="allSchemas.formSchema" | |
| 47 | + :rules="rules" | |
| 48 | + /> | |
| 49 | + <!-- 表单:详情 --> | |
| 50 | + <Descriptions | |
| 51 | + v-if="actionType === 'detail'" | |
| 52 | + :schema="allSchemas.detailSchema" | |
| 53 | + :data="detailData" | |
| 54 | + /> | |
| 55 | + <template #footer> | |
| 56 | + <!-- 按钮:保存 --> | |
| 57 | + <XButton | |
| 58 | + v-if="['create', 'update'].includes(actionType)" | |
| 59 | + type="primary" | |
| 60 | + :title="t('action.save')" | |
| 61 | + :loading="actionLoading" | |
| 62 | + @click="submitForm()" | |
| 63 | + /> | |
| 64 | + <!-- 按钮:关闭 --> | |
| 65 | + <XButton :loading="actionLoading" :title="t('dialog.close')" @click="modelVisible = false" /> | |
| 66 | + </template> | |
| 67 | + </XModal> | |
| 68 | +</template> | |
| 69 | +<script setup lang="ts" name="MailAccount"> | |
| 70 | +import { FormExpose } from '@/components/Form' | |
| 71 | +// 业务相关的 import | |
| 72 | +import { rules, allSchemas } from './account.data' | |
| 73 | +import * as MailAccountApi from '@/api/system/mail/account' | |
| 74 | + | |
| 75 | +const { t } = useI18n() // 国际化 | |
| 76 | +const message = useMessage() // 消息弹窗 | |
| 77 | + | |
| 78 | +// 列表相关的变量 | |
| 79 | +const [registerTable, { reload, deleteData }] = useXTable({ | |
| 80 | + allSchemas: allSchemas, | |
| 81 | + getListApi: MailAccountApi.getMailAccountPageApi, | |
| 82 | + deleteApi: MailAccountApi.deleteMailAccountApi | |
| 83 | +}) | |
| 84 | + | |
| 85 | +// 弹窗相关的变量 | |
| 86 | +const modelVisible = ref(false) // 是否显示弹出层 | |
| 87 | +const modelTitle = ref('edit') // 弹出层标题 | |
| 88 | +const modelLoading = ref(false) // 弹出层loading | |
| 89 | +const actionType = ref('') // 操作按钮的类型 | |
| 90 | +const actionLoading = ref(false) // 按钮 Loading | |
| 91 | +const formRef = ref<FormExpose>() // 表单 Ref | |
| 92 | +const detailData = ref() // 详情 Ref | |
| 93 | + | |
| 94 | +// 设置标题 | |
| 95 | +const setDialogTile = (type: string) => { | |
| 96 | + modelLoading.value = true | |
| 97 | + modelTitle.value = t('action.' + type) | |
| 98 | + actionType.value = type | |
| 99 | + modelVisible.value = true | |
| 100 | +} | |
| 101 | + | |
| 102 | +// 新增操作 | |
| 103 | +const handleCreate = () => { | |
| 104 | + setDialogTile('create') | |
| 105 | + modelLoading.value = false | |
| 106 | +} | |
| 107 | + | |
| 108 | +// 修改操作 | |
| 109 | +const handleUpdate = async (rowId: number) => { | |
| 110 | + setDialogTile('update') | |
| 111 | + // 设置数据 | |
| 112 | + const res = await MailAccountApi.getMailAccountApi(rowId) | |
| 113 | + unref(formRef)?.setValues(res) | |
| 114 | + modelLoading.value = false | |
| 115 | +} | |
| 116 | + | |
| 117 | +// 详情操作 | |
| 118 | +const handleDetail = async (rowId: number) => { | |
| 119 | + setDialogTile('detail') | |
| 120 | + const res = await MailAccountApi.getMailAccountApi(rowId) | |
| 121 | + detailData.value = res | |
| 122 | + modelLoading.value = false | |
| 123 | +} | |
| 124 | + | |
| 125 | +// 提交按钮 | |
| 126 | +const submitForm = async () => { | |
| 127 | + const elForm = unref(formRef)?.getElFormRef() | |
| 128 | + if (!elForm) return | |
| 129 | + elForm.validate(async (valid) => { | |
| 130 | + if (valid) { | |
| 131 | + actionLoading.value = true | |
| 132 | + // 提交请求 | |
| 133 | + try { | |
| 134 | + const data = unref(formRef)?.formModel as MailAccountApi.MailAccountVO | |
| 135 | + if (actionType.value === 'create') { | |
| 136 | + await MailAccountApi.createMailAccountApi(data) | |
| 137 | + message.success(t('common.createSuccess')) | |
| 138 | + } else { | |
| 139 | + await MailAccountApi.updateMailAccountApi(data) | |
| 140 | + message.success(t('common.updateSuccess')) | |
| 141 | + } | |
| 142 | + modelVisible.value = false | |
| 143 | + } finally { | |
| 144 | + actionLoading.value = false | |
| 145 | + // 刷新列表 | |
| 146 | + await reload() | |
| 147 | + } | |
| 148 | + } | |
| 149 | + }) | |
| 150 | +} | |
| 151 | +</script> | ... | ... |
yudao-ui-admin-vue3/src/views/system/mail/log/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <ContentWrap> | |
| 3 | + <!-- 列表 --> | |
| 4 | + <XTable @register="registerTable"> | |
| 5 | + <template #accountId_search> | |
| 6 | + <el-select v-model="queryParams.accountId"> | |
| 7 | + <el-option :key="undefined" label="全部" :value="undefined" /> | |
| 8 | + <el-option | |
| 9 | + v-for="item in accountOptions" | |
| 10 | + :key="item.id" | |
| 11 | + :label="item.mail" | |
| 12 | + :value="item.id" | |
| 13 | + /> | |
| 14 | + </el-select> | |
| 15 | + </template> | |
| 16 | + <template #toMail_default="{ row }"> | |
| 17 | + <div>{{ row.toMail }}</div> | |
| 18 | + <div v-if="row.userType && row.userId"> | |
| 19 | + <dict-tag :type="DICT_TYPE.USER_TYPE" :value="row.userType" />{{ '(' + row.userId + ')' }} | |
| 20 | + </div> | |
| 21 | + </template> | |
| 22 | + <template #actionbtns_default="{ row }"> | |
| 23 | + <!-- 操作:详情 --> | |
| 24 | + <XTextButton | |
| 25 | + preIcon="ep:view" | |
| 26 | + :title="t('action.detail')" | |
| 27 | + v-hasPermi="['system:mail-log:query']" | |
| 28 | + @click="handleDetail(row.id)" | |
| 29 | + /> | |
| 30 | + </template> | |
| 31 | + </XTable> | |
| 32 | + </ContentWrap> | |
| 33 | + <!-- 弹窗 --> | |
| 34 | + <XModal id="mailLogModel" :loading="modelLoading" v-model="modelVisible" :title="modelTitle"> | |
| 35 | + <!-- 表单:详情 --> | |
| 36 | + <Descriptions | |
| 37 | + v-if="actionType === 'detail'" | |
| 38 | + :schema="allSchemas.detailSchema" | |
| 39 | + :data="detailData" | |
| 40 | + /> | |
| 41 | + <template #footer> | |
| 42 | + <!-- 按钮:关闭 --> | |
| 43 | + <XButton :loading="actionLoading" :title="t('dialog.close')" @click="modelVisible = false" /> | |
| 44 | + </template> | |
| 45 | + </XModal> | |
| 46 | +</template> | |
| 47 | +<script setup lang="ts" name="MailLog"> | |
| 48 | +// 业务相关的 import | |
| 49 | +import { allSchemas } from './log.data' | |
| 50 | +import * as MailLogApi from '@/api/system/mail/log' | |
| 51 | +import * as MailAccountApi from '@/api/system/mail/account' | |
| 52 | + | |
| 53 | +const { t } = useI18n() // 国际化 | |
| 54 | + | |
| 55 | +// 列表相关的变量 | |
| 56 | +const queryParams = reactive({ | |
| 57 | + accountId: null | |
| 58 | +}) | |
| 59 | +const [registerTable] = useXTable({ | |
| 60 | + allSchemas: allSchemas, | |
| 61 | + params: queryParams, | |
| 62 | + getListApi: MailLogApi.getMailLogPageApi | |
| 63 | +}) | |
| 64 | +const accountOptions = ref([]) // 账号下拉选项 | |
| 65 | + | |
| 66 | +// 弹窗相关的变量 | |
| 67 | +const modelVisible = ref(false) // 是否显示弹出层 | |
| 68 | +const modelTitle = ref('edit') // 弹出层标题 | |
| 69 | +const modelLoading = ref(false) // 弹出层loading | |
| 70 | +const actionType = ref('') // 操作按钮的类型 | |
| 71 | +const actionLoading = ref(false) // 按钮 Loading | |
| 72 | +const detailData = ref() // 详情 Ref | |
| 73 | + | |
| 74 | +// 设置标题 | |
| 75 | +const setDialogTile = (type: string) => { | |
| 76 | + modelLoading.value = true | |
| 77 | + modelTitle.value = t('action.' + type) | |
| 78 | + actionType.value = type | |
| 79 | + modelVisible.value = true | |
| 80 | +} | |
| 81 | + | |
| 82 | +// 详情操作 | |
| 83 | +const handleDetail = async (rowId: number) => { | |
| 84 | + setDialogTile('detail') | |
| 85 | + const res = await MailLogApi.getMailLogApi(rowId) | |
| 86 | + detailData.value = res | |
| 87 | + modelLoading.value = false | |
| 88 | +} | |
| 89 | + | |
| 90 | +// ========== 初始化 ========== | |
| 91 | +onMounted(() => { | |
| 92 | + MailAccountApi.getSimpleMailAccounts().then((data) => { | |
| 93 | + accountOptions.value = data | |
| 94 | + }) | |
| 95 | +}) | |
| 96 | +</script> | ... | ... |
yudao-ui-admin-vue3/src/views/system/mail/log/log.data.ts
0 → 100644
| 1 | +import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' | |
| 2 | + | |
| 3 | +// CrudSchema | |
| 4 | +const crudSchemas = reactive<VxeCrudSchema>({ | |
| 5 | + primaryKey: 'id', | |
| 6 | + primaryTitle: '编号', | |
| 7 | + primaryType: 'id', | |
| 8 | + action: true, | |
| 9 | + actionWidth: '70', | |
| 10 | + columns: [ | |
| 11 | + { | |
| 12 | + title: '发送时间', | |
| 13 | + field: 'sendTime', | |
| 14 | + table: { | |
| 15 | + width: 180 | |
| 16 | + }, | |
| 17 | + formatter: 'formatDate', | |
| 18 | + search: { | |
| 19 | + show: true, | |
| 20 | + itemRender: { | |
| 21 | + name: 'XDataTimePicker' | |
| 22 | + } | |
| 23 | + } | |
| 24 | + }, | |
| 25 | + { | |
| 26 | + title: '接收邮箱', | |
| 27 | + field: 'toMail', | |
| 28 | + isSearch: true, | |
| 29 | + table: { | |
| 30 | + width: 180, | |
| 31 | + slots: { | |
| 32 | + default: 'toMail_default' | |
| 33 | + } | |
| 34 | + } | |
| 35 | + }, | |
| 36 | + { | |
| 37 | + title: '用户编号', | |
| 38 | + field: 'userId', | |
| 39 | + isSearch: true, | |
| 40 | + isTable: false | |
| 41 | + }, | |
| 42 | + { | |
| 43 | + title: '用户类型', | |
| 44 | + field: 'userType', | |
| 45 | + dictType: DICT_TYPE.USER_TYPE, | |
| 46 | + dictClass: 'number', | |
| 47 | + isSearch: true, | |
| 48 | + isTable: false | |
| 49 | + }, | |
| 50 | + { | |
| 51 | + title: '邮件标题', | |
| 52 | + field: 'templateTitle' | |
| 53 | + }, | |
| 54 | + { | |
| 55 | + title: '邮件内容', | |
| 56 | + field: 'templateContent', | |
| 57 | + isTable: false | |
| 58 | + }, | |
| 59 | + { | |
| 60 | + title: '邮箱参数', | |
| 61 | + field: 'templateParams', | |
| 62 | + isTable: false | |
| 63 | + }, | |
| 64 | + { | |
| 65 | + title: '发送状态', | |
| 66 | + field: 'sendStatus', | |
| 67 | + dictType: DICT_TYPE.SYSTEM_MAIL_SEND_STATUS, | |
| 68 | + dictClass: 'string', | |
| 69 | + isSearch: true | |
| 70 | + }, | |
| 71 | + { | |
| 72 | + title: '邮箱账号', | |
| 73 | + field: 'accountId', | |
| 74 | + isSearch: true, | |
| 75 | + isTable: false, | |
| 76 | + search: { | |
| 77 | + slots: { | |
| 78 | + default: 'accountId_search' | |
| 79 | + } | |
| 80 | + } | |
| 81 | + }, | |
| 82 | + { | |
| 83 | + title: '发送邮箱地址', | |
| 84 | + field: 'fromMail', | |
| 85 | + table: { | |
| 86 | + title: '邮箱账号' | |
| 87 | + } | |
| 88 | + }, | |
| 89 | + { | |
| 90 | + title: '模板编号', | |
| 91 | + field: 'templateId', | |
| 92 | + isSearch: true | |
| 93 | + }, | |
| 94 | + { | |
| 95 | + title: '模板编码', | |
| 96 | + field: 'templateCode', | |
| 97 | + isTable: false | |
| 98 | + }, | |
| 99 | + { | |
| 100 | + title: '模版发送人名称', | |
| 101 | + field: 'templateNickname', | |
| 102 | + isTable: false | |
| 103 | + }, | |
| 104 | + { | |
| 105 | + title: '发送返回的消息编号', | |
| 106 | + field: 'sendMessageId', | |
| 107 | + isTable: false | |
| 108 | + }, | |
| 109 | + { | |
| 110 | + title: '发送异常', | |
| 111 | + field: 'sendException', | |
| 112 | + isTable: false | |
| 113 | + }, | |
| 114 | + { | |
| 115 | + title: '创建时间', | |
| 116 | + field: 'createTime', | |
| 117 | + isTable: false | |
| 118 | + } | |
| 119 | + ] | |
| 120 | +}) | |
| 121 | +export const { allSchemas } = useVxeCrudSchemas(crudSchemas) | ... | ... |
yudao-ui-admin-vue3/src/views/system/mail/template/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <ContentWrap> | |
| 3 | + <!-- 列表 --> | |
| 4 | + <XTable @register="registerTable"> | |
| 5 | + <template #accountId_search> | |
| 6 | + <el-select v-model="queryParams.accountId"> | |
| 7 | + <el-option :key="undefined" label="全部" :value="undefined" /> | |
| 8 | + <el-option | |
| 9 | + v-for="item in accountOptions" | |
| 10 | + :key="item.id" | |
| 11 | + :label="item.mail" | |
| 12 | + :value="item.id" | |
| 13 | + /> | |
| 14 | + </el-select> | |
| 15 | + </template> | |
| 16 | + <template #toolbar_buttons> | |
| 17 | + <!-- 操作:新增 --> | |
| 18 | + <XButton | |
| 19 | + type="primary" | |
| 20 | + preIcon="ep:zoom-in" | |
| 21 | + :title="t('action.add')" | |
| 22 | + v-hasPermi="['system:mail-template:create']" | |
| 23 | + @click="handleCreate()" | |
| 24 | + /> | |
| 25 | + </template> | |
| 26 | + <template #accountId_default="{ row }"> | |
| 27 | + <span>{{ accountOptions.find((account) => account.id === row.accountId)?.mail }}</span> | |
| 28 | + </template> | |
| 29 | + <template #actionbtns_default="{ row }"> | |
| 30 | + <!-- 操作:测试短信 --> | |
| 31 | + <XTextButton | |
| 32 | + preIcon="ep:cpu" | |
| 33 | + :title="t('action.test')" | |
| 34 | + v-hasPermi="['system:mail-template:send-mail']" | |
| 35 | + @click="handleSendMail(row)" | |
| 36 | + /> | |
| 37 | + <!-- 操作:修改 --> | |
| 38 | + <XTextButton | |
| 39 | + preIcon="ep:edit" | |
| 40 | + :title="t('action.edit')" | |
| 41 | + v-hasPermi="['system:mail-template:update']" | |
| 42 | + @click="handleUpdate(row.id)" | |
| 43 | + /> | |
| 44 | + <!-- 操作:详情 --> | |
| 45 | + <XTextButton | |
| 46 | + preIcon="ep:view" | |
| 47 | + :title="t('action.detail')" | |
| 48 | + v-hasPermi="['system:mail-template:query']" | |
| 49 | + @click="handleDetail(row.id)" | |
| 50 | + /> | |
| 51 | + <!-- 操作:删除 --> | |
| 52 | + <XTextButton | |
| 53 | + preIcon="ep:delete" | |
| 54 | + :title="t('action.del')" | |
| 55 | + v-hasPermi="['system:mail-template:delete']" | |
| 56 | + @click="deleteData(row.id)" | |
| 57 | + /> | |
| 58 | + </template> | |
| 59 | + </XTable> | |
| 60 | + </ContentWrap> | |
| 61 | + | |
| 62 | + <!-- 添加/修改/详情的弹窗 --> | |
| 63 | + <XModal id="mailTemplateModel" :loading="modelLoading" v-model="modelVisible" :title="modelTitle"> | |
| 64 | + <!-- 表单:添加/修改 --> | |
| 65 | + <Form | |
| 66 | + ref="formRef" | |
| 67 | + v-if="['create', 'update'].includes(actionType)" | |
| 68 | + :schema="allSchemas.formSchema" | |
| 69 | + :rules="rules" | |
| 70 | + > | |
| 71 | + <template #accountId="form"> | |
| 72 | + <el-select v-model="form.accountId"> | |
| 73 | + <el-option | |
| 74 | + v-for="item in accountOptions" | |
| 75 | + :key="item.id" | |
| 76 | + :label="item.mail" | |
| 77 | + :value="item.id" | |
| 78 | + /> | |
| 79 | + </el-select> | |
| 80 | + </template> | |
| 81 | + </Form> | |
| 82 | + <!-- 表单:详情 --> | |
| 83 | + <Descriptions | |
| 84 | + v-if="actionType === 'detail'" | |
| 85 | + :schema="allSchemas.detailSchema" | |
| 86 | + :data="detailData" | |
| 87 | + /> | |
| 88 | + <template #footer> | |
| 89 | + <!-- 按钮:保存 --> | |
| 90 | + <XButton | |
| 91 | + v-if="['create', 'update'].includes(actionType)" | |
| 92 | + type="primary" | |
| 93 | + :title="t('action.save')" | |
| 94 | + :loading="actionLoading" | |
| 95 | + @click="submitForm()" | |
| 96 | + /> | |
| 97 | + <!-- 按钮:关闭 --> | |
| 98 | + <XButton :loading="actionLoading" :title="t('dialog.close')" @click="modelVisible = false" /> | |
| 99 | + </template> | |
| 100 | + </XModal> | |
| 101 | + | |
| 102 | + <!-- 测试邮件的弹窗 --> | |
| 103 | + <XModal id="sendTest" v-model="sendVisible" title="测试"> | |
| 104 | + <el-form :model="sendForm" :rules="sendRules" label-width="200px" label-position="top"> | |
| 105 | + <el-form-item label="模板内容" prop="content"> | |
| 106 | + <Editor :model-value="sendForm.content" readonly height="150px" /> | |
| 107 | + </el-form-item> | |
| 108 | + <el-form-item label="收件邮箱" prop="mail"> | |
| 109 | + <el-input v-model="sendForm.mail" placeholder="请输入收件邮箱" /> | |
| 110 | + </el-form-item> | |
| 111 | + <el-form-item | |
| 112 | + v-for="param in sendForm.params" | |
| 113 | + :key="param" | |
| 114 | + :label="'参数 {' + param + '}'" | |
| 115 | + :prop="'templateParams.' + param" | |
| 116 | + > | |
| 117 | + <el-input | |
| 118 | + v-model="sendForm.templateParams[param]" | |
| 119 | + :placeholder="'请输入 ' + param + ' 参数'" | |
| 120 | + /> | |
| 121 | + </el-form-item> | |
| 122 | + </el-form> | |
| 123 | + <!-- 操作按钮 --> | |
| 124 | + <template #footer> | |
| 125 | + <XButton | |
| 126 | + type="primary" | |
| 127 | + :title="t('action.test')" | |
| 128 | + :loading="actionLoading" | |
| 129 | + @click="sendTest()" | |
| 130 | + /> | |
| 131 | + <XButton :title="t('dialog.close')" @click="sendVisible = false" /> | |
| 132 | + </template> | |
| 133 | + </XModal> | |
| 134 | +</template> | |
| 135 | +<script setup lang="ts" name="MailTemplate"> | |
| 136 | +import { FormExpose } from '@/components/Form' | |
| 137 | +// 业务相关的 import | |
| 138 | +import { rules, allSchemas } from './template.data' | |
| 139 | +import * as MailTemplateApi from '@/api/system/mail/template' | |
| 140 | +import * as MailAccountApi from '@/api/system/mail/account' | |
| 141 | + | |
| 142 | +const { t } = useI18n() // 国际化 | |
| 143 | +const message = useMessage() // 消息弹窗 | |
| 144 | + | |
| 145 | +// 列表相关的变量 | |
| 146 | +const queryParams = reactive({ | |
| 147 | + accountId: null | |
| 148 | +}) | |
| 149 | +const [registerTable, { reload, deleteData }] = useXTable({ | |
| 150 | + allSchemas: allSchemas, | |
| 151 | + params: queryParams, | |
| 152 | + getListApi: MailTemplateApi.getMailTemplatePageApi, | |
| 153 | + deleteApi: MailTemplateApi.deleteMailTemplateApi | |
| 154 | +}) | |
| 155 | +const accountOptions = ref([]) // 账号下拉选项 | |
| 156 | + | |
| 157 | +// 弹窗相关的变量 | |
| 158 | +const modelVisible = ref(false) // 是否显示弹出层 | |
| 159 | +const modelTitle = ref('edit') // 弹出层标题 | |
| 160 | +const modelLoading = ref(false) // 弹出层loading | |
| 161 | +const actionType = ref('') // 操作按钮的类型 | |
| 162 | +const actionLoading = ref(false) // 按钮 Loading | |
| 163 | +const formRef = ref<FormExpose>() // 表单 Ref | |
| 164 | +const detailData = ref() // 详情 Ref | |
| 165 | + | |
| 166 | +// 设置标题 | |
| 167 | +const setDialogTile = (type: string) => { | |
| 168 | + modelLoading.value = true | |
| 169 | + modelTitle.value = t('action.' + type) | |
| 170 | + actionType.value = type | |
| 171 | + modelVisible.value = true | |
| 172 | +} | |
| 173 | + | |
| 174 | +// 新增操作 | |
| 175 | +const handleCreate = () => { | |
| 176 | + setDialogTile('create') | |
| 177 | + modelLoading.value = false | |
| 178 | +} | |
| 179 | + | |
| 180 | +// 修改操作 | |
| 181 | +const handleUpdate = async (rowId: number) => { | |
| 182 | + setDialogTile('update') | |
| 183 | + // 设置数据 | |
| 184 | + const res = await MailTemplateApi.getMailTemplateApi(rowId) | |
| 185 | + unref(formRef)?.setValues(res) | |
| 186 | + modelLoading.value = false | |
| 187 | +} | |
| 188 | + | |
| 189 | +// 详情操作 | |
| 190 | +const handleDetail = async (rowId: number) => { | |
| 191 | + setDialogTile('detail') | |
| 192 | + const res = await MailTemplateApi.getMailTemplateApi(rowId) | |
| 193 | + detailData.value = res | |
| 194 | + modelLoading.value = false | |
| 195 | +} | |
| 196 | + | |
| 197 | +// 提交按钮 | |
| 198 | +const submitForm = async () => { | |
| 199 | + const elForm = unref(formRef)?.getElFormRef() | |
| 200 | + if (!elForm) return | |
| 201 | + elForm.validate(async (valid) => { | |
| 202 | + if (valid) { | |
| 203 | + actionLoading.value = true | |
| 204 | + // 提交请求 | |
| 205 | + try { | |
| 206 | + const data = unref(formRef)?.formModel as MailTemplateApi.MailTemplateVO | |
| 207 | + if (actionType.value === 'create') { | |
| 208 | + await MailTemplateApi.createMailTemplateApi(data) | |
| 209 | + message.success(t('common.createSuccess')) | |
| 210 | + } else { | |
| 211 | + await MailTemplateApi.updateMailTemplateApi(data) | |
| 212 | + message.success(t('common.updateSuccess')) | |
| 213 | + } | |
| 214 | + modelVisible.value = false | |
| 215 | + } finally { | |
| 216 | + actionLoading.value = false | |
| 217 | + // 刷新列表 | |
| 218 | + await reload() | |
| 219 | + } | |
| 220 | + } | |
| 221 | + }) | |
| 222 | +} | |
| 223 | + | |
| 224 | +// ========== 测试相关 ========== | |
| 225 | +const sendForm = ref({ | |
| 226 | + content: '', | |
| 227 | + params: {}, | |
| 228 | + mail: '', | |
| 229 | + templateCode: '', | |
| 230 | + templateParams: {} | |
| 231 | +}) | |
| 232 | +const sendRules = ref({ | |
| 233 | + mail: [{ required: true, message: '邮箱不能为空', trigger: 'blur' }], | |
| 234 | + templateCode: [{ required: true, message: '模版编号不能为空', trigger: 'blur' }], | |
| 235 | + templateParams: {} | |
| 236 | +}) | |
| 237 | +const sendVisible = ref(false) | |
| 238 | + | |
| 239 | +const handleSendMail = (row: any) => { | |
| 240 | + sendForm.value.content = row.content | |
| 241 | + sendForm.value.params = row.params | |
| 242 | + sendForm.value.templateCode = row.code | |
| 243 | + sendForm.value.templateParams = row.params.reduce(function (obj, item) { | |
| 244 | + obj[item] = undefined | |
| 245 | + return obj | |
| 246 | + }, {}) | |
| 247 | + sendRules.value.templateParams = row.params.reduce(function (obj, item) { | |
| 248 | + obj[item] = { required: true, message: '参数 ' + item + ' 不能为空', trigger: 'change' } | |
| 249 | + return obj | |
| 250 | + }, {}) | |
| 251 | + sendVisible.value = true | |
| 252 | +} | |
| 253 | + | |
| 254 | +const sendTest = async () => { | |
| 255 | + const data: MailTemplateApi.MailSendReqVO = { | |
| 256 | + mail: sendForm.value.mail, | |
| 257 | + templateCode: sendForm.value.templateCode, | |
| 258 | + templateParams: sendForm.value.templateParams as unknown as Map<string, Object> | |
| 259 | + } | |
| 260 | + const res = await MailTemplateApi.sendMailApi(data) | |
| 261 | + if (res) { | |
| 262 | + message.success('提交发送成功!发送结果,见发送日志编号:' + res) | |
| 263 | + } | |
| 264 | + sendVisible.value = false | |
| 265 | +} | |
| 266 | + | |
| 267 | +// ========== 初始化 ========== | |
| 268 | +onMounted(() => { | |
| 269 | + MailAccountApi.getSimpleMailAccounts().then((data) => { | |
| 270 | + accountOptions.value = data | |
| 271 | + }) | |
| 272 | +}) | |
| 273 | +</script> | ... | ... |
yudao-ui-admin-vue3/src/views/system/mail/template/template.data.ts
0 → 100644
| 1 | +import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' | |
| 2 | + | |
| 3 | +// 表单校验 | |
| 4 | +export const rules = reactive({ | |
| 5 | + name: [required], | |
| 6 | + code: [required], | |
| 7 | + accountId: [required], | |
| 8 | + title: [required], | |
| 9 | + content: [required], | |
| 10 | + params: [required], | |
| 11 | + status: [required] | |
| 12 | +}) | |
| 13 | + | |
| 14 | +// CrudSchema | |
| 15 | +const crudSchemas = reactive<VxeCrudSchema>({ | |
| 16 | + primaryKey: 'id', // 默认的主键ID | |
| 17 | + primaryTitle: '编号', // 默认显示的值 | |
| 18 | + primaryType: null, | |
| 19 | + action: true, | |
| 20 | + actionWidth: '260', | |
| 21 | + columns: [ | |
| 22 | + { | |
| 23 | + title: '模板编码', | |
| 24 | + field: 'code', | |
| 25 | + isSearch: true | |
| 26 | + }, | |
| 27 | + { | |
| 28 | + title: '模板名称', | |
| 29 | + field: 'name', | |
| 30 | + isSearch: true | |
| 31 | + }, | |
| 32 | + { | |
| 33 | + title: '模板标题', | |
| 34 | + field: 'title' | |
| 35 | + }, | |
| 36 | + { | |
| 37 | + title: '模板内容', | |
| 38 | + field: 'content', | |
| 39 | + form: { | |
| 40 | + component: 'Editor', | |
| 41 | + colProps: { | |
| 42 | + span: 24 | |
| 43 | + }, | |
| 44 | + componentProps: { | |
| 45 | + valueHtml: '' | |
| 46 | + } | |
| 47 | + } | |
| 48 | + }, | |
| 49 | + { | |
| 50 | + title: '邮箱账号', | |
| 51 | + field: 'accountId', | |
| 52 | + isSearch: true, | |
| 53 | + table: { | |
| 54 | + width: 200, | |
| 55 | + slots: { | |
| 56 | + default: 'accountId_default' | |
| 57 | + } | |
| 58 | + }, | |
| 59 | + search: { | |
| 60 | + slots: { | |
| 61 | + default: 'accountId_search' | |
| 62 | + } | |
| 63 | + } | |
| 64 | + }, | |
| 65 | + { | |
| 66 | + title: '发送人名称', | |
| 67 | + field: 'nickname' | |
| 68 | + }, | |
| 69 | + { | |
| 70 | + title: '开启状态', | |
| 71 | + field: 'status', | |
| 72 | + isSearch: true, | |
| 73 | + dictType: DICT_TYPE.COMMON_STATUS, | |
| 74 | + dictClass: 'number' | |
| 75 | + }, | |
| 76 | + { | |
| 77 | + title: '备注', | |
| 78 | + field: 'remark', | |
| 79 | + isTable: false | |
| 80 | + }, | |
| 81 | + { | |
| 82 | + title: '创建时间', | |
| 83 | + field: 'createTime', | |
| 84 | + isForm: false, | |
| 85 | + formatter: 'formatDate', | |
| 86 | + table: { | |
| 87 | + width: 180 | |
| 88 | + }, | |
| 89 | + search: { | |
| 90 | + show: true, | |
| 91 | + itemRender: { | |
| 92 | + name: 'XDataTimePicker' | |
| 93 | + } | |
| 94 | + } | |
| 95 | + } | |
| 96 | + ] | |
| 97 | +}) | |
| 98 | +export const { allSchemas } = useVxeCrudSchemas(crudSchemas) | ... | ... |
yudao-ui-admin-vue3/src/views/system/notify/message/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <ContentWrap> | |
| 3 | + <!-- 列表 --> | |
| 4 | + <XTable @register="registerTable"> | |
| 5 | + <template #actionbtns_default="{ row }"> | |
| 6 | + <!-- 操作:详情 --> | |
| 7 | + <XTextButton | |
| 8 | + preIcon="ep:view" | |
| 9 | + :title="t('action.detail')" | |
| 10 | + v-hasPermi="['system:notify-message:query']" | |
| 11 | + @click="handleDetail(row.id)" | |
| 12 | + /> | |
| 13 | + </template> | |
| 14 | + </XTable> | |
| 15 | + </ContentWrap> | |
| 16 | + <!-- 弹窗 --> | |
| 17 | + <XModal id="messageModel" :loading="modelLoading" v-model="modelVisible" :title="modelTitle"> | |
| 18 | + <!-- 表单:详情 --> | |
| 19 | + <Descriptions | |
| 20 | + v-if="actionType === 'detail'" | |
| 21 | + :schema="allSchemas.detailSchema" | |
| 22 | + :data="detailData" | |
| 23 | + /> | |
| 24 | + <template #footer> | |
| 25 | + <!-- 按钮:关闭 --> | |
| 26 | + <XButton :loading="actionLoading" :title="t('dialog.close')" @click="modelVisible = false" /> | |
| 27 | + </template> | |
| 28 | + </XModal> | |
| 29 | +</template> | |
| 30 | +<script setup lang="ts" name="NotifyMessage"> | |
| 31 | +// 业务相关的 import | |
| 32 | +import { allSchemas } from './message.data' | |
| 33 | +import * as NotifyMessageApi from '@/api/system/notify/message' | |
| 34 | + | |
| 35 | +const { t } = useI18n() // 国际化 | |
| 36 | + | |
| 37 | +// 列表相关的变量 | |
| 38 | +const [registerTable] = useXTable({ | |
| 39 | + allSchemas: allSchemas, | |
| 40 | + getListApi: NotifyMessageApi.getNotifyMessagePageApi | |
| 41 | +}) | |
| 42 | + | |
| 43 | +// 弹窗相关的变量 | |
| 44 | +const modelVisible = ref(false) // 是否显示弹出层 | |
| 45 | +const modelTitle = ref('edit') // 弹出层标题 | |
| 46 | +const modelLoading = ref(false) // 弹出层loading | |
| 47 | +const actionType = ref('') // 操作按钮的类型 | |
| 48 | +const actionLoading = ref(false) // 按钮 Loading | |
| 49 | +const detailData = ref() // 详情 Ref | |
| 50 | + | |
| 51 | +// 设置标题 | |
| 52 | +const setDialogTile = (type: string) => { | |
| 53 | + modelLoading.value = true | |
| 54 | + modelTitle.value = t('action.' + type) | |
| 55 | + actionType.value = type | |
| 56 | + modelVisible.value = true | |
| 57 | +} | |
| 58 | + | |
| 59 | +// 详情操作 | |
| 60 | +const handleDetail = async (rowId: number) => { | |
| 61 | + setDialogTile('detail') | |
| 62 | + const res = await NotifyMessageApi.getNotifyMessageApi(rowId) | |
| 63 | + detailData.value = res | |
| 64 | + modelLoading.value = false | |
| 65 | +} | |
| 66 | +</script> | ... | ... |
yudao-ui-admin-vue3/src/views/system/notify/message/message.data.ts
0 → 100644
| 1 | +import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' | |
| 2 | + | |
| 3 | +// CrudSchema | |
| 4 | +const crudSchemas = reactive<VxeCrudSchema>({ | |
| 5 | + primaryKey: 'id', // 默认的主键ID | |
| 6 | + primaryTitle: '编号', // 默认显示的值 | |
| 7 | + primaryType: 'seq', // 默认为seq,序号模式 | |
| 8 | + action: true, | |
| 9 | + actionWidth: '200', // 3个按钮默认200,如有删减对应增减即可 | |
| 10 | + columns: [ | |
| 11 | + { | |
| 12 | + title: '用户编号', | |
| 13 | + field: 'userId', | |
| 14 | + isSearch: true | |
| 15 | + }, | |
| 16 | + { | |
| 17 | + title: '用户类型', | |
| 18 | + field: 'userType', | |
| 19 | + dictType: DICT_TYPE.USER_TYPE, | |
| 20 | + dictClass: 'string', | |
| 21 | + isSearch: true, | |
| 22 | + table: { | |
| 23 | + width: 80 | |
| 24 | + } | |
| 25 | + }, | |
| 26 | + { | |
| 27 | + title: '模版编号', | |
| 28 | + field: 'templateId' | |
| 29 | + }, | |
| 30 | + { | |
| 31 | + title: '模板编码', | |
| 32 | + field: 'templateCode', | |
| 33 | + isSearch: true, | |
| 34 | + table: { | |
| 35 | + width: 80 | |
| 36 | + } | |
| 37 | + }, | |
| 38 | + { | |
| 39 | + title: '发送人名称', | |
| 40 | + field: 'templateNickname', | |
| 41 | + table: { | |
| 42 | + width: 120 | |
| 43 | + } | |
| 44 | + }, | |
| 45 | + { | |
| 46 | + title: '模版内容', | |
| 47 | + field: 'templateContent', | |
| 48 | + table: { | |
| 49 | + width: 200 | |
| 50 | + } | |
| 51 | + }, | |
| 52 | + { | |
| 53 | + title: '模版类型', | |
| 54 | + field: 'templateType', | |
| 55 | + dictType: DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE, | |
| 56 | + dictClass: 'number', | |
| 57 | + isSearch: true, | |
| 58 | + table: { | |
| 59 | + width: 80 | |
| 60 | + } | |
| 61 | + }, | |
| 62 | + { | |
| 63 | + title: '模版参数', | |
| 64 | + field: 'templateParams', | |
| 65 | + isTable: false | |
| 66 | + }, | |
| 67 | + { | |
| 68 | + title: '是否已读', | |
| 69 | + field: 'readStatus', | |
| 70 | + dictType: DICT_TYPE.INFRA_BOOLEAN_STRING, | |
| 71 | + dictClass: 'boolean', | |
| 72 | + table: { | |
| 73 | + width: 80 | |
| 74 | + } | |
| 75 | + }, | |
| 76 | + { | |
| 77 | + title: '阅读时间', | |
| 78 | + field: 'readTime', | |
| 79 | + formatter: 'formatDate', | |
| 80 | + table: { | |
| 81 | + width: 180 | |
| 82 | + } | |
| 83 | + }, | |
| 84 | + { | |
| 85 | + title: '创建时间', | |
| 86 | + field: 'createTime', | |
| 87 | + isForm: false, | |
| 88 | + formatter: 'formatDate', | |
| 89 | + search: { | |
| 90 | + show: true, | |
| 91 | + itemRender: { | |
| 92 | + name: 'XDataTimePicker' | |
| 93 | + } | |
| 94 | + }, | |
| 95 | + table: { | |
| 96 | + width: 180 | |
| 97 | + } | |
| 98 | + } | |
| 99 | + ] | |
| 100 | +}) | |
| 101 | +export const { allSchemas } = useVxeCrudSchemas(crudSchemas) | ... | ... |
yudao-ui-admin-vue3/src/views/system/notify/my/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <ContentWrap> | |
| 3 | + <!-- 列表 --> | |
| 4 | + <XTable @register="registerTable"> | |
| 5 | + <template #toolbar_buttons> | |
| 6 | + <!-- 操作:标记已读 --> | |
| 7 | + <XButton type="primary" preIcon="ep:zoom-in" title="标记已读" @click="handleUpdateList" /> | |
| 8 | + <!-- 操作:全部已读 --> | |
| 9 | + <XButton type="primary" preIcon="ep:zoom-in" title="全部已读" @click="handleUpdateAll" /> | |
| 10 | + </template> | |
| 11 | + <template #actionbtns_default="{ row }"> | |
| 12 | + <!-- 操作:已读 --> | |
| 13 | + <XTextButton | |
| 14 | + preIcon="ep:view" | |
| 15 | + title="已读" | |
| 16 | + v-hasPermi="['system:notify-message:query']" | |
| 17 | + v-if="!row.readStatus" | |
| 18 | + @click="handleUpdate([row.id])" | |
| 19 | + /> | |
| 20 | + </template> | |
| 21 | + </XTable> | |
| 22 | + </ContentWrap> | |
| 23 | +</template> | |
| 24 | +<script setup lang="ts" name="MyNotifyMessage"> | |
| 25 | +// 业务相关的 import | |
| 26 | +import { allSchemas } from './my.data' | |
| 27 | +import * as NotifyMessageApi from '@/api/system/notify/message' | |
| 28 | + | |
| 29 | +const message = useMessage() // 消息 | |
| 30 | + | |
| 31 | +// 列表相关的变量 | |
| 32 | +const [registerTable, { reload, getCheckboxRecords }] = useXTable({ | |
| 33 | + allSchemas: allSchemas, | |
| 34 | + getListApi: NotifyMessageApi.getMyNotifyMessagePage | |
| 35 | +}) | |
| 36 | + | |
| 37 | +const handleUpdateList = async () => { | |
| 38 | + const list = getCheckboxRecords() | |
| 39 | + if (list.length === 0) { | |
| 40 | + return | |
| 41 | + } | |
| 42 | + await handleUpdate(list.map((v) => v.id)) | |
| 43 | +} | |
| 44 | + | |
| 45 | +// 标记指定 id 已读 | |
| 46 | +const handleUpdate = async (ids) => { | |
| 47 | + await NotifyMessageApi.updateNotifyMessageRead(ids) | |
| 48 | + message.success('标记已读成功!') | |
| 49 | + reload() | |
| 50 | +} | |
| 51 | + | |
| 52 | +// 标记全部已读 | |
| 53 | +const handleUpdateAll = async () => { | |
| 54 | + await NotifyMessageApi.updateAllNotifyMessageRead() | |
| 55 | + message.success('全部已读成功!') | |
| 56 | + reload() | |
| 57 | +} | |
| 58 | +</script> | ... | ... |
yudao-ui-admin-vue3/src/views/system/notify/my/my.data.ts
0 → 100644
| 1 | +import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' | |
| 2 | + | |
| 3 | +// CrudSchema | |
| 4 | +const crudSchemas = reactive<VxeCrudSchema>({ | |
| 5 | + primaryKey: 'id', | |
| 6 | + primaryTitle: ' ', | |
| 7 | + primaryType: 'checkbox', | |
| 8 | + action: true, | |
| 9 | + actionWidth: '200', // 3个按钮默认200,如有删减对应增减即可 | |
| 10 | + columns: [ | |
| 11 | + { | |
| 12 | + title: '发送人名称', | |
| 13 | + field: 'templateNickname', | |
| 14 | + table: { | |
| 15 | + width: 120 | |
| 16 | + } | |
| 17 | + }, | |
| 18 | + { | |
| 19 | + title: '发送时间', | |
| 20 | + field: 'createTime', | |
| 21 | + isForm: false, | |
| 22 | + formatter: 'formatDate', | |
| 23 | + search: { | |
| 24 | + show: true, | |
| 25 | + itemRender: { | |
| 26 | + name: 'XDataTimePicker' | |
| 27 | + } | |
| 28 | + }, | |
| 29 | + table: { | |
| 30 | + width: 180 | |
| 31 | + } | |
| 32 | + }, | |
| 33 | + { | |
| 34 | + title: '类型', | |
| 35 | + field: 'templateType', | |
| 36 | + dictType: DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE, | |
| 37 | + dictClass: 'number', | |
| 38 | + table: { | |
| 39 | + width: 80 | |
| 40 | + } | |
| 41 | + }, | |
| 42 | + { | |
| 43 | + title: '内容', | |
| 44 | + field: 'templateContent' | |
| 45 | + }, | |
| 46 | + { | |
| 47 | + title: '是否已读', | |
| 48 | + field: 'readStatus', | |
| 49 | + dictType: DICT_TYPE.INFRA_BOOLEAN_STRING, | |
| 50 | + dictClass: 'boolean', | |
| 51 | + table: { | |
| 52 | + width: 80 | |
| 53 | + }, | |
| 54 | + isSearch: true | |
| 55 | + } | |
| 56 | + ] | |
| 57 | +}) | |
| 58 | +export const { allSchemas } = useVxeCrudSchemas(crudSchemas) | ... | ... |
yudao-ui-admin-vue3/src/views/system/notify/template/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <ContentWrap> | |
| 3 | + <!-- 列表 --> | |
| 4 | + <XTable @register="registerTable"> | |
| 5 | + <template #toolbar_buttons> | |
| 6 | + <!-- 操作:新增 --> | |
| 7 | + <XButton | |
| 8 | + type="primary" | |
| 9 | + preIcon="ep:zoom-in" | |
| 10 | + :title="t('action.add')" | |
| 11 | + v-hasPermi="['system:notify-template:create']" | |
| 12 | + @click="handleCreate()" | |
| 13 | + /> | |
| 14 | + </template> | |
| 15 | + <template #actionbtns_default="{ row }"> | |
| 16 | + <!-- 操作:测试站内信 --> | |
| 17 | + <XTextButton | |
| 18 | + preIcon="ep:cpu" | |
| 19 | + :title="t('action.test')" | |
| 20 | + v-hasPermi="['system:notify-template:send-notify']" | |
| 21 | + @click="handleSendNotify(row)" | |
| 22 | + /> | |
| 23 | + <!-- 操作:修改 --> | |
| 24 | + <XTextButton | |
| 25 | + preIcon="ep:edit" | |
| 26 | + :title="t('action.edit')" | |
| 27 | + v-hasPermi="['system:notify-template:update']" | |
| 28 | + @click="handleUpdate(row.id)" | |
| 29 | + /> | |
| 30 | + <!-- 操作:详情 --> | |
| 31 | + <XTextButton | |
| 32 | + preIcon="ep:view" | |
| 33 | + :title="t('action.detail')" | |
| 34 | + v-hasPermi="['system:notify-template:query']" | |
| 35 | + @click="handleDetail(row.id)" | |
| 36 | + /> | |
| 37 | + <!-- 操作:删除 --> | |
| 38 | + <XTextButton | |
| 39 | + preIcon="ep:delete" | |
| 40 | + :title="t('action.del')" | |
| 41 | + v-hasPermi="['system:notify-template:delete']" | |
| 42 | + @click="deleteData(row.id)" | |
| 43 | + /> | |
| 44 | + </template> | |
| 45 | + </XTable> | |
| 46 | + </ContentWrap> | |
| 47 | + | |
| 48 | + <!-- 添加/修改的弹窗 --> | |
| 49 | + <XModal id="templateModel" :loading="modelLoading" v-model="modelVisible" :title="modelTitle"> | |
| 50 | + <!-- 表单:添加/修改 --> | |
| 51 | + <Form | |
| 52 | + ref="formRef" | |
| 53 | + v-if="['create', 'update'].includes(actionType)" | |
| 54 | + :schema="allSchemas.formSchema" | |
| 55 | + :rules="rules" | |
| 56 | + /> | |
| 57 | + <!-- 表单:详情 --> | |
| 58 | + <Descriptions | |
| 59 | + v-if="actionType === 'detail'" | |
| 60 | + :schema="allSchemas.detailSchema" | |
| 61 | + :data="detailData" | |
| 62 | + /> | |
| 63 | + <template #footer> | |
| 64 | + <!-- 按钮:保存 --> | |
| 65 | + <XButton | |
| 66 | + v-if="['create', 'update'].includes(actionType)" | |
| 67 | + type="primary" | |
| 68 | + :title="t('action.save')" | |
| 69 | + :loading="actionLoading" | |
| 70 | + @click="submitForm()" | |
| 71 | + /> | |
| 72 | + <!-- 按钮:关闭 --> | |
| 73 | + <XButton :loading="actionLoading" :title="t('dialog.close')" @click="modelVisible = false" /> | |
| 74 | + </template> | |
| 75 | + </XModal> | |
| 76 | + | |
| 77 | + <!-- 测试站内信的弹窗 --> | |
| 78 | + <XModal id="sendTest" v-model="sendVisible" title="测试"> | |
| 79 | + <el-form :model="sendForm" :rules="sendRules" label-width="200px" label-position="top"> | |
| 80 | + <el-form-item label="模板内容" prop="content"> | |
| 81 | + <el-input type="textarea" v-model="sendForm.content" readonly /> | |
| 82 | + </el-form-item> | |
| 83 | + <el-form-item label="接收人" prop="userId"> | |
| 84 | + <el-select v-model="sendForm.userId" placeholder="请选择接收人"> | |
| 85 | + <el-option | |
| 86 | + v-for="item in userOption" | |
| 87 | + :key="item.id" | |
| 88 | + :label="item.nickname" | |
| 89 | + :value="item.id" | |
| 90 | + /> | |
| 91 | + </el-select> | |
| 92 | + </el-form-item> | |
| 93 | + <el-form-item | |
| 94 | + v-for="param in sendForm.params" | |
| 95 | + :key="param" | |
| 96 | + :label="'参数 {' + param + '}'" | |
| 97 | + :prop="'templateParams.' + param" | |
| 98 | + > | |
| 99 | + <el-input | |
| 100 | + v-model="sendForm.templateParams[param]" | |
| 101 | + :placeholder="'请输入 ' + param + ' 参数'" | |
| 102 | + /> | |
| 103 | + </el-form-item> | |
| 104 | + </el-form> | |
| 105 | + <!-- 操作按钮 --> | |
| 106 | + <template #footer> | |
| 107 | + <XButton | |
| 108 | + type="primary" | |
| 109 | + :title="t('action.test')" | |
| 110 | + :loading="actionLoading" | |
| 111 | + @click="sendTest()" | |
| 112 | + /> | |
| 113 | + <XButton :title="t('dialog.close')" @click="sendVisible = false" /> | |
| 114 | + </template> | |
| 115 | + </XModal> | |
| 116 | +</template> | |
| 117 | +<script setup lang="ts" name="NotifyTemplate"> | |
| 118 | +import { FormExpose } from '@/components/Form' | |
| 119 | +// 业务相关的 import | |
| 120 | +import { rules, allSchemas } from './template.data' | |
| 121 | +import * as NotifyTemplateApi from '@/api/system/notify/template' | |
| 122 | +import { getListSimpleUsersApi, UserVO } from '@/api/system/user' | |
| 123 | + | |
| 124 | +const { t } = useI18n() // 国际化 | |
| 125 | +const message = useMessage() // 消息弹窗 | |
| 126 | + | |
| 127 | +// 列表相关的变量 | |
| 128 | +const [registerTable, { reload, deleteData }] = useXTable({ | |
| 129 | + allSchemas: allSchemas, | |
| 130 | + getListApi: NotifyTemplateApi.getNotifyTemplatePageApi, | |
| 131 | + deleteApi: NotifyTemplateApi.deleteNotifyTemplateApi | |
| 132 | +}) | |
| 133 | + | |
| 134 | +// 弹窗相关的变量 | |
| 135 | +const modelVisible = ref(false) // 是否显示弹出层 | |
| 136 | +const modelTitle = ref('edit') // 弹出层标题 | |
| 137 | +const modelLoading = ref(false) // 弹出层loading | |
| 138 | +const actionType = ref('') // 操作按钮的类型 | |
| 139 | +const actionLoading = ref(false) // 按钮 Loading | |
| 140 | +const formRef = ref<FormExpose>() // 表单 Ref | |
| 141 | +const detailData = ref() // 详情 Ref | |
| 142 | + | |
| 143 | +// 设置标题 | |
| 144 | +const setDialogTile = (type: string) => { | |
| 145 | + modelLoading.value = true | |
| 146 | + modelTitle.value = t('action.' + type) | |
| 147 | + actionType.value = type | |
| 148 | + modelVisible.value = true | |
| 149 | +} | |
| 150 | + | |
| 151 | +// 新增操作 | |
| 152 | +const handleCreate = () => { | |
| 153 | + setDialogTile('create') | |
| 154 | + modelLoading.value = false | |
| 155 | +} | |
| 156 | + | |
| 157 | +// 修改操作 | |
| 158 | +const handleUpdate = async (rowId: number) => { | |
| 159 | + setDialogTile('update') | |
| 160 | + // 设置数据 | |
| 161 | + const res = await NotifyTemplateApi.getNotifyTemplateApi(rowId) | |
| 162 | + unref(formRef)?.setValues(res) | |
| 163 | + modelLoading.value = false | |
| 164 | +} | |
| 165 | + | |
| 166 | +// 详情操作 | |
| 167 | +const handleDetail = async (rowId: number) => { | |
| 168 | + setDialogTile('detail') | |
| 169 | + const res = await NotifyTemplateApi.getNotifyTemplateApi(rowId) | |
| 170 | + detailData.value = res | |
| 171 | + modelLoading.value = false | |
| 172 | +} | |
| 173 | + | |
| 174 | +// 提交按钮 | |
| 175 | +const submitForm = async () => { | |
| 176 | + const elForm = unref(formRef)?.getElFormRef() | |
| 177 | + if (!elForm) return | |
| 178 | + elForm.validate(async (valid) => { | |
| 179 | + if (valid) { | |
| 180 | + actionLoading.value = true | |
| 181 | + // 提交请求 | |
| 182 | + try { | |
| 183 | + const data = unref(formRef)?.formModel as NotifyTemplateApi.NotifyTemplateVO | |
| 184 | + if (actionType.value === 'create') { | |
| 185 | + await NotifyTemplateApi.createNotifyTemplateApi(data) | |
| 186 | + message.success(t('common.createSuccess')) | |
| 187 | + } else { | |
| 188 | + await NotifyTemplateApi.updateNotifyTemplateApi(data) | |
| 189 | + message.success(t('common.updateSuccess')) | |
| 190 | + } | |
| 191 | + modelVisible.value = false | |
| 192 | + } finally { | |
| 193 | + actionLoading.value = false | |
| 194 | + // 刷新列表 | |
| 195 | + await reload() | |
| 196 | + } | |
| 197 | + } | |
| 198 | + }) | |
| 199 | +} | |
| 200 | + | |
| 201 | +// ========== 测试相关 ========== | |
| 202 | +const sendForm = ref({ | |
| 203 | + content: '', | |
| 204 | + params: {}, | |
| 205 | + userId: undefined, | |
| 206 | + templateCode: '', | |
| 207 | + templateParams: {} | |
| 208 | +}) | |
| 209 | +const sendRules = ref({ | |
| 210 | + userId: [{ required: true, message: '用户编号不能为空', trigger: 'blur' }], | |
| 211 | + templateCode: [{ required: true, message: '模版编号不能为空', trigger: 'blur' }], | |
| 212 | + templateParams: {} | |
| 213 | +}) | |
| 214 | +const sendVisible = ref(false) | |
| 215 | +const userOption = ref<UserVO[]>([]) | |
| 216 | + | |
| 217 | +const handleSendNotify = (row: any) => { | |
| 218 | + sendForm.value.content = row.content | |
| 219 | + sendForm.value.params = row.params | |
| 220 | + sendForm.value.templateCode = row.code | |
| 221 | + sendForm.value.templateParams = row.params.reduce(function (obj, item) { | |
| 222 | + obj[item] = undefined | |
| 223 | + return obj | |
| 224 | + }, {}) | |
| 225 | + sendRules.value.templateParams = row.params.reduce(function (obj, item) { | |
| 226 | + obj[item] = { required: true, message: '参数 ' + item + ' 不能为空', trigger: 'change' } | |
| 227 | + return obj | |
| 228 | + }, {}) | |
| 229 | + sendVisible.value = true | |
| 230 | +} | |
| 231 | + | |
| 232 | +const sendTest = async () => { | |
| 233 | + const data: NotifyTemplateApi.NotifySendReqVO = { | |
| 234 | + userId: sendForm.value.userId, | |
| 235 | + templateCode: sendForm.value.templateCode, | |
| 236 | + templateParams: sendForm.value.templateParams as unknown as Map<string, Object> | |
| 237 | + } | |
| 238 | + const res = await NotifyTemplateApi.sendNotifyApi(data) | |
| 239 | + if (res) { | |
| 240 | + message.success('提交发送成功!发送结果,见发送日志编号:' + res) | |
| 241 | + } | |
| 242 | + sendVisible.value = false | |
| 243 | +} | |
| 244 | + | |
| 245 | +// ========== 初始化 ========== | |
| 246 | +onMounted(() => { | |
| 247 | + getListSimpleUsersApi().then((data) => { | |
| 248 | + userOption.value = data | |
| 249 | + }) | |
| 250 | +}) | |
| 251 | +</script> | ... | ... |
yudao-ui-admin-vue3/src/views/system/notify/template/template.data.ts
0 → 100644
| 1 | +import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' | |
| 2 | + | |
| 3 | +// 表单校验 | |
| 4 | +export const rules = reactive({ | |
| 5 | + name: [required], | |
| 6 | + code: [required], | |
| 7 | + content: [required], | |
| 8 | + type: [required], | |
| 9 | + status: [required] | |
| 10 | +}) | |
| 11 | + | |
| 12 | +// CrudSchema | |
| 13 | +const crudSchemas = reactive<VxeCrudSchema>({ | |
| 14 | + primaryKey: 'id', | |
| 15 | + primaryTitle: '编号', | |
| 16 | + primaryType: null, | |
| 17 | + action: true, | |
| 18 | + actionWidth: '260', // 3个按钮默认200,如有删减对应增减即可 | |
| 19 | + columns: [ | |
| 20 | + { | |
| 21 | + title: '模版编码', | |
| 22 | + field: 'code', | |
| 23 | + isSearch: true | |
| 24 | + }, | |
| 25 | + { | |
| 26 | + title: '模板名称', | |
| 27 | + field: 'name', | |
| 28 | + isSearch: true | |
| 29 | + }, | |
| 30 | + { | |
| 31 | + title: '发件人名称', | |
| 32 | + field: 'nickname' | |
| 33 | + }, | |
| 34 | + { | |
| 35 | + title: '类型', | |
| 36 | + field: 'type', | |
| 37 | + dictType: DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE, | |
| 38 | + dictClass: 'number' | |
| 39 | + }, | |
| 40 | + { | |
| 41 | + title: '模版内容', | |
| 42 | + field: 'content', | |
| 43 | + table: { | |
| 44 | + width: 300 | |
| 45 | + }, | |
| 46 | + form: { | |
| 47 | + component: 'Input', | |
| 48 | + componentProps: { | |
| 49 | + type: 'textarea', | |
| 50 | + rows: 4 | |
| 51 | + }, | |
| 52 | + colProps: { | |
| 53 | + span: 24 | |
| 54 | + } | |
| 55 | + } | |
| 56 | + }, | |
| 57 | + { | |
| 58 | + title: '状态', | |
| 59 | + field: 'status', | |
| 60 | + dictType: DICT_TYPE.COMMON_STATUS, | |
| 61 | + dictClass: 'number', | |
| 62 | + isSearch: true | |
| 63 | + }, | |
| 64 | + { | |
| 65 | + title: '备注', | |
| 66 | + field: 'remark' | |
| 67 | + }, | |
| 68 | + { | |
| 69 | + title: '创建时间', | |
| 70 | + field: 'createTime', | |
| 71 | + isForm: false, | |
| 72 | + formatter: 'formatDate', | |
| 73 | + search: { | |
| 74 | + show: true, | |
| 75 | + itemRender: { | |
| 76 | + name: 'XDataTimePicker' | |
| 77 | + } | |
| 78 | + }, | |
| 79 | + table: { | |
| 80 | + width: 180 | |
| 81 | + } | |
| 82 | + } | |
| 83 | + ] | |
| 84 | +}) | |
| 85 | +export const { allSchemas } = useVxeCrudSchemas(crudSchemas) | ... | ... |
yudao-ui-admin-vue3/src/views/system/sms/smsTemplate/index.vue
| ... | ... | @@ -197,7 +197,7 @@ const sendSmsForm = ref({ |
| 197 | 197 | }) |
| 198 | 198 | const sendSmsRules = ref({ |
| 199 | 199 | mobile: [{ required: true, message: '手机不能为空', trigger: 'blur' }], |
| 200 | - templateCode: [{ required: true, message: '手机不能为空', trigger: 'blur' }], | |
| 200 | + templateCode: [{ required: true, message: '模版编号不能为空', trigger: 'blur' }], | |
| 201 | 201 | templateParams: {} |
| 202 | 202 | }) |
| 203 | 203 | const sendVisible = ref(false) |
| ... | ... | @@ -225,7 +225,7 @@ const sendSmsTest = async () => { |
| 225 | 225 | } |
| 226 | 226 | const res = await SmsTemplateApi.sendSmsApi(data) |
| 227 | 227 | if (res) { |
| 228 | - message.success('发送成功') | |
| 228 | + message.success('提交发送成功!发送结果,见发送日志编号:' + res) | |
| 229 | 229 | } |
| 230 | 230 | sendVisible.value = false |
| 231 | 231 | } | ... | ... |
yudao-ui-admin/package.json
yudao-ui-admin/src/api/mp/user.js renamed to yudao-ui-admin/src/api/mp/mpuser.js
yudao-ui-admin/src/api/system/mail/account.js
0 → 100755
| 1 | +import request from '@/utils/request' | |
| 2 | + | |
| 3 | +// 创建邮箱账号 | |
| 4 | +export function createMailAccount(data) { | |
| 5 | + return request({ | |
| 6 | + url: '/system/mail-account/create', | |
| 7 | + method: 'post', | |
| 8 | + data: data | |
| 9 | + }) | |
| 10 | +} | |
| 11 | + | |
| 12 | +// 更新邮箱账号 | |
| 13 | +export function updateMailAccount(data) { | |
| 14 | + return request({ | |
| 15 | + url: '/system/mail-account/update', | |
| 16 | + method: 'put', | |
| 17 | + data: data | |
| 18 | + }) | |
| 19 | +} | |
| 20 | + | |
| 21 | +// 删除邮箱账号 | |
| 22 | +export function deleteMailAccount(id) { | |
| 23 | + return request({ | |
| 24 | + url: '/system/mail-account/delete?id=' + id, | |
| 25 | + method: 'delete' | |
| 26 | + }) | |
| 27 | +} | |
| 28 | + | |
| 29 | +// 获得邮箱账号 | |
| 30 | +export function getMailAccount(id) { | |
| 31 | + return request({ | |
| 32 | + url: '/system/mail-account/get?id=' + id, | |
| 33 | + method: 'get' | |
| 34 | + }) | |
| 35 | +} | |
| 36 | + | |
| 37 | +// 获得邮箱账号分页 | |
| 38 | +export function getMailAccountPage(query) { | |
| 39 | + return request({ | |
| 40 | + url: '/system/mail-account/page', | |
| 41 | + method: 'get', | |
| 42 | + params: query | |
| 43 | + }) | |
| 44 | +} | |
| 45 | + | |
| 46 | +// 获取邮箱账号的精简信息列表 | |
| 47 | +export function getSimpleMailAccountList() { | |
| 48 | + return request({ | |
| 49 | + url: '/system/mail-account/list-all-simple', | |
| 50 | + method: 'get', | |
| 51 | + }) | |
| 52 | +} | ... | ... |
yudao-ui-admin/src/api/system/mail/log.js
0 → 100755
| 1 | +import request from '@/utils/request' | |
| 2 | + | |
| 3 | +// 获得邮件日志 | |
| 4 | +export function getMailLog(id) { | |
| 5 | + return request({ | |
| 6 | + url: '/system/mail-log/get?id=' + id, | |
| 7 | + method: 'get' | |
| 8 | + }) | |
| 9 | +} | |
| 10 | + | |
| 11 | +// 获得邮件日志分页 | |
| 12 | +export function getMailLogPage(query) { | |
| 13 | + return request({ | |
| 14 | + url: '/system/mail-log/page', | |
| 15 | + method: 'get', | |
| 16 | + params: query | |
| 17 | + }) | |
| 18 | +} | ... | ... |
yudao-ui-admin/src/api/system/mail/template.js
0 → 100755
| 1 | +import request from '@/utils/request' | |
| 2 | + | |
| 3 | +// 创建邮件模版 | |
| 4 | +export function createMailTemplate(data) { | |
| 5 | + return request({ | |
| 6 | + url: '/system/mail-template/create', | |
| 7 | + method: 'post', | |
| 8 | + data: data | |
| 9 | + }) | |
| 10 | +} | |
| 11 | + | |
| 12 | +// 更新邮件模版 | |
| 13 | +export function updateMailTemplate(data) { | |
| 14 | + return request({ | |
| 15 | + url: '/system/mail-template/update', | |
| 16 | + method: 'put', | |
| 17 | + data: data | |
| 18 | + }) | |
| 19 | +} | |
| 20 | + | |
| 21 | +// 删除邮件模版 | |
| 22 | +export function deleteMailTemplate(id) { | |
| 23 | + return request({ | |
| 24 | + url: '/system/mail-template/delete?id=' + id, | |
| 25 | + method: 'delete' | |
| 26 | + }) | |
| 27 | +} | |
| 28 | + | |
| 29 | +// 获得邮件模版 | |
| 30 | +export function getMailTemplate(id) { | |
| 31 | + return request({ | |
| 32 | + url: '/system/mail-template/get?id=' + id, | |
| 33 | + method: 'get' | |
| 34 | + }) | |
| 35 | +} | |
| 36 | + | |
| 37 | +// 获得邮件模版分页 | |
| 38 | +export function getMailTemplatePage(query) { | |
| 39 | + return request({ | |
| 40 | + url: '/system/mail-template/page', | |
| 41 | + method: 'get', | |
| 42 | + params: query | |
| 43 | + }) | |
| 44 | +} | |
| 45 | + | |
| 46 | +// 发送测试邮件 | |
| 47 | +export function sendMail(data) { | |
| 48 | + return request({ | |
| 49 | + url: '/system/mail-template/send-mail', | |
| 50 | + method: 'post', | |
| 51 | + data: data | |
| 52 | + }) | |
| 53 | +} | ... | ... |
yudao-ui-admin/src/api/system/notify/message.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | +import qs from 'qs' | |
| 3 | + | |
| 4 | +// 获得我的站内信分页 | |
| 5 | +export function getNotifyMessagePage(query) { | |
| 6 | + return request({ | |
| 7 | + url: '/system/notify-message/page', | |
| 8 | + method: 'get', | |
| 9 | + params: query | |
| 10 | + }) | |
| 11 | +} | |
| 12 | + | |
| 13 | +// 获得我的站内信分页 | |
| 14 | +export function getMyNotifyMessagePage(query) { | |
| 15 | + return request({ | |
| 16 | + url: '/system/notify-message/my-page', | |
| 17 | + method: 'get', | |
| 18 | + params: query | |
| 19 | + }) | |
| 20 | +} | |
| 21 | + | |
| 22 | +// 批量标记已读 | |
| 23 | +export function updateNotifyMessageRead(ids) { | |
| 24 | + return request({ | |
| 25 | + url: '/system/notify-message/update-read?' + qs.stringify({ids: ids}, { indices: false }), | |
| 26 | + method: 'put' | |
| 27 | + }) | |
| 28 | +} | |
| 29 | + | |
| 30 | +// 标记所有站内信为已读 | |
| 31 | +export function updateAllNotifyMessageRead() { | |
| 32 | + return request({ | |
| 33 | + url: '/system/notify-message/update-all-read', | |
| 34 | + method: 'put' | |
| 35 | + }) | |
| 36 | +} | |
| 37 | + | |
| 38 | +// 获取当前用户的最新站内信列表 | |
| 39 | +export function getUnreadNotifyMessageList() { | |
| 40 | + return request({ | |
| 41 | + url: '/system/notify-message/get-unread-list', | |
| 42 | + method: 'get' | |
| 43 | + }) | |
| 44 | +} | |
| 45 | + | |
| 46 | +// 获得当前用户的未读站内信数量 | |
| 47 | +export function getUnreadNotifyMessageCount() { | |
| 48 | + return request({ | |
| 49 | + url: '/system/notify-message/get-unread-count', | |
| 50 | + method: 'get' | |
| 51 | + }) | |
| 52 | +} | ... | ... |
yudao-ui-admin/src/api/system/notify/template.js
0 → 100644
| 1 | +import request from '@/utils/request' | |
| 2 | + | |
| 3 | +// 创建站内信模板 | |
| 4 | +export function createNotifyTemplate(data) { | |
| 5 | + return request({ | |
| 6 | + url: '/system/notify-template/create', | |
| 7 | + method: 'post', | |
| 8 | + data: data | |
| 9 | + }) | |
| 10 | +} | |
| 11 | + | |
| 12 | +// 更新站内信模板 | |
| 13 | +export function updateNotifyTemplate(data) { | |
| 14 | + return request({ | |
| 15 | + url: '/system/notify-template/update', | |
| 16 | + method: 'put', | |
| 17 | + data: data | |
| 18 | + }) | |
| 19 | +} | |
| 20 | + | |
| 21 | +// 删除站内信模板 | |
| 22 | +export function deleteNotifyTemplate(id) { | |
| 23 | + return request({ | |
| 24 | + url: '/system/notify-template/delete?id=' + id, | |
| 25 | + method: 'delete' | |
| 26 | + }) | |
| 27 | +} | |
| 28 | + | |
| 29 | +// 获得站内信模板 | |
| 30 | +export function getNotifyTemplate(id) { | |
| 31 | + return request({ | |
| 32 | + url: '/system/notify-template/get?id=' + id, | |
| 33 | + method: 'get' | |
| 34 | + }) | |
| 35 | +} | |
| 36 | + | |
| 37 | +// 获得站内信模板分页 | |
| 38 | +export function getNotifyTemplatePage(query) { | |
| 39 | + return request({ | |
| 40 | + url: '/system/notify-template/page', | |
| 41 | + method: 'get', | |
| 42 | + params: query | |
| 43 | + }) | |
| 44 | +} | |
| 45 | + | |
| 46 | +// 创建站内信模板 | |
| 47 | +export function sendNotify(data) { | |
| 48 | + return request({ | |
| 49 | + url: '/system/notify-template/send-notify', | |
| 50 | + method: 'post', | |
| 51 | + data: data | |
| 52 | + }) | |
| 53 | +} | |
| 54 | + | |
| 55 | +// 导出站内信模板 Excel | |
| 56 | +export function exportNotifyTemplateExcel(query) { | |
| 57 | + return request({ | |
| 58 | + url: '/system/notify-template/export-excel', | |
| 59 | + method: 'get', | |
| 60 | + params: query, | |
| 61 | + responseType: 'blob' | |
| 62 | + }) | |
| 63 | +} | |
| 64 | + | ... | ... |
yudao-ui-admin/src/api/system/sms/smsTemplate.js
yudao-ui-admin/src/components/DocAlert/index.vue
| 1 | 1 | <template> |
| 2 | - <el-alert v-if="enable()" :title="'【' + title + '】文档地址:' + url" type="success" show-icon /> | |
| 2 | + <el-alert v-if="enable()" type="success" show-icon> | |
| 3 | + <template slot="title"> | |
| 4 | + <div @click="goToUrl">{{ '【' + title + '】文档地址:' + url }}</div> | |
| 5 | + </template> | |
| 6 | + </el-alert> | |
| 3 | 7 | </template> |
| 4 | 8 | |
| 5 | 9 | <script> |
| ... | ... | @@ -14,6 +18,9 @@ export default { |
| 14 | 18 | methods: { |
| 15 | 19 | enable: function () { |
| 16 | 20 | return getDocEnable(); |
| 21 | + }, | |
| 22 | + goToUrl: function() { | |
| 23 | + window.open(this.url); | |
| 17 | 24 | } |
| 18 | 25 | } |
| 19 | 26 | }; | ... | ... |
yudao-ui-admin/src/components/RuoYi/Doc/index.vue
yudao-ui-admin/src/components/bpmnProcessDesigner/package/penal/form/ElementForm.vue
| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 | <el-table-column label="字段类型" prop="type" min-width="80px" :formatter="row => fieldType[row.type] || row.type" show-overflow-tooltip /> |
| 22 | 22 | <el-table-column label="默认值" prop="defaultValue" min-width="80px" show-overflow-tooltip /> |
| 23 | 23 | <el-table-column label="操作" width="90px"> |
| 24 | - <template slot-scope="{ row, $index }"> | |
| 24 | + <template v-slot="{ row, $index }"> | |
| 25 | 25 | <el-button size="mini" type="text" @click="openFieldForm(row, $index)">编辑</el-button> |
| 26 | 26 | <el-divider direction="vertical" /> |
| 27 | 27 | <el-button size="mini" type="text" style="color: #ff4d4f" @click="removeField(row, $index)">移除</el-button> |
| ... | ... | @@ -70,7 +70,7 @@ |
| 70 | 70 | <el-table-column label="枚举值编号" prop="id" min-width="100px" show-overflow-tooltip /> |
| 71 | 71 | <el-table-column label="枚举值名称" prop="name" min-width="100px" show-overflow-tooltip /> |
| 72 | 72 | <el-table-column label="操作" width="90px"> |
| 73 | - <template slot-scope="{ row, $index }"> | |
| 73 | + <template v-slot="{ row, $index }"> | |
| 74 | 74 | <el-button size="mini" type="text" @click="openFieldOptionForm(row, $index, 'enum')">编辑</el-button> |
| 75 | 75 | <el-divider direction="vertical" /> |
| 76 | 76 | <el-button size="mini" type="text" style="color: #ff4d4f" @click="removeFieldOptionItem(row, $index, 'enum')">移除</el-button> |
| ... | ... | @@ -90,7 +90,7 @@ |
| 90 | 90 | <el-table-column label="约束名称" prop="name" min-width="100px" show-overflow-tooltip /> |
| 91 | 91 | <el-table-column label="约束配置" prop="config" min-width="100px" show-overflow-tooltip /> |
| 92 | 92 | <el-table-column label="操作" width="90px"> |
| 93 | - <template slot-scope="{ row, $index }"> | |
| 93 | + <template v-slot="{ row, $index }"> | |
| 94 | 94 | <el-button size="mini" type="text" @click="openFieldOptionForm(row, $index, 'constraint')">编辑</el-button> |
| 95 | 95 | <el-divider direction="vertical" /> |
| 96 | 96 | <el-button size="mini" type="text" style="color: #ff4d4f" @click="removeFieldOptionItem(row, $index, 'constraint')">移除</el-button> |
| ... | ... | @@ -109,7 +109,7 @@ |
| 109 | 109 | <el-table-column label="属性编号" prop="id" min-width="100px" show-overflow-tooltip /> |
| 110 | 110 | <el-table-column label="属性值" prop="value" min-width="100px" show-overflow-tooltip /> |
| 111 | 111 | <el-table-column label="操作" width="90px"> |
| 112 | - <template slot-scope="{ row, $index }"> | |
| 112 | + <template v-slot="{ row, $index }"> | |
| 113 | 113 | <el-button size="mini" type="text" @click="openFieldOptionForm(row, $index, 'property')">编辑</el-button> |
| 114 | 114 | <el-divider direction="vertical" /> |
| 115 | 115 | <el-button size="mini" type="text" style="color: #ff4d4f" @click="removeFieldOptionItem(row, $index, 'property')">移除</el-button> | ... | ... |
yudao-ui-admin/src/components/bpmnProcessDesigner/package/penal/listeners/ElementListeners.vue
| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | <el-table-column label="事件类型" min-width="100px" prop="event" /> |
| 6 | 6 | <el-table-column label="监听器类型" min-width="100px" show-overflow-tooltip :formatter="row => listenerTypeObject[row.listenerType]" /> |
| 7 | 7 | <el-table-column label="操作" width="90px"> |
| 8 | - <template slot-scope="{ row, $index }"> | |
| 8 | + <template v-slot="{ row, $index }"> | |
| 9 | 9 | <el-button size="mini" type="text" @click="openListenerForm(row, $index)">编辑</el-button> |
| 10 | 10 | <el-divider direction="vertical" /> |
| 11 | 11 | <el-button size="mini" type="text" style="color: #ff4d4f" @click="removeListener(row, $index)">移除</el-button> |
| ... | ... | @@ -108,7 +108,7 @@ |
| 108 | 108 | <el-table-column label="字段类型" min-width="80px" show-overflow-tooltip :formatter="row => fieldTypeObject[row.fieldType]" /> |
| 109 | 109 | <el-table-column label="字段值/表达式" min-width="100px" show-overflow-tooltip :formatter="row => row.string || row.expression" /> |
| 110 | 110 | <el-table-column label="操作" width="100px"> |
| 111 | - <template slot-scope="{ row, $index }"> | |
| 111 | + <template v-slot="{ row, $index }"> | |
| 112 | 112 | <el-button size="mini" type="text" @click="openListenerFieldForm(row, $index)">编辑</el-button> |
| 113 | 113 | <el-divider direction="vertical" /> |
| 114 | 114 | <el-button size="mini" type="text" style="color: #ff4d4f" @click="removeListenerField(row, $index)">移除</el-button> | ... | ... |
yudao-ui-admin/src/components/bpmnProcessDesigner/package/penal/listeners/UserTaskListeners.vue
| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | <el-table-column label="事件id" min-width="80px" prop="id" show-overflow-tooltip /> |
| 7 | 7 | <el-table-column label="监听器类型" min-width="80px" show-overflow-tooltip :formatter="row => listenerTypeObject[row.listenerType]" /> |
| 8 | 8 | <el-table-column label="操作" width="90px"> |
| 9 | - <template slot-scope="{ row, $index }"> | |
| 9 | + <template v-slot="{ row, $index }"> | |
| 10 | 10 | <el-button size="mini" type="text" @click="openListenerForm(row, $index)">编辑</el-button> |
| 11 | 11 | <el-divider direction="vertical" /> |
| 12 | 12 | <el-button size="mini" type="text" style="color: #ff4d4f" @click="removeListener(row, $index)">移除</el-button> |
| ... | ... | @@ -132,7 +132,7 @@ |
| 132 | 132 | <el-table-column label="字段类型" min-width="80px" show-overflow-tooltip :formatter="row => fieldTypeObject[row.fieldType]" /> |
| 133 | 133 | <el-table-column label="字段值/表达式" min-width="100px" show-overflow-tooltip :formatter="row => row.string || row.expression" /> |
| 134 | 134 | <el-table-column label="操作" width="100px"> |
| 135 | - <template slot-scope="{ row, $index }"> | |
| 135 | + <template v-slot="{ row, $index }"> | |
| 136 | 136 | <el-button size="mini" type="text" @click="openListenerFieldForm(row, $index)">编辑</el-button> |
| 137 | 137 | <el-divider direction="vertical" /> |
| 138 | 138 | <el-button size="mini" type="text" style="color: #ff4d4f" @click="removeListenerField(row, $index)">移除</el-button> | ... | ... |
yudao-ui-admin/src/components/bpmnProcessDesigner/package/penal/listeners/template.js
| ... | ... | @@ -6,7 +6,7 @@ export const template = isTaskListener => { |
| 6 | 6 | <el-table-column label="事件类型" min-width="100px" prop="event" /> |
| 7 | 7 | <el-table-column label="监听器类型" min-width="100px" show-overflow-tooltip :formatter="row => listenerTypeObject[row.listenerType]" /> |
| 8 | 8 | <el-table-column label="操作" width="90px"> |
| 9 | - <template slot-scope="{ row, $index }"> | |
| 9 | + <template v-slot="{ row, $index }"> | |
| 10 | 10 | <el-button size="mini" type="text" @click="openListenerForm(row, $index)">编辑</el-button> |
| 11 | 11 | <el-divider direction="vertical" /> |
| 12 | 12 | <el-button size="mini" type="text" style="color: #ff4d4f" @click="removeListener(row, $index)">移除</el-button> |
| ... | ... | @@ -124,7 +124,7 @@ export const template = isTaskListener => { |
| 124 | 124 | <el-table-column label="字段类型" min-width="80px" show-overflow-tooltip :formatter="row => fieldTypeObject[row.fieldType]" /> |
| 125 | 125 | <el-table-column label="字段值/表达式" min-width="100px" show-overflow-tooltip :formatter="row => row.string || row.expression" /> |
| 126 | 126 | <el-table-column label="操作" width="100px"> |
| 127 | - <template slot-scope="{ row, $index }"> | |
| 127 | + <template v-slot="{ row, $index }"> | |
| 128 | 128 | <el-button size="mini" type="text" @click="openListenerFieldForm(row, $index)">编辑</el-button> |
| 129 | 129 | <el-divider direction="vertical" /> |
| 130 | 130 | <el-button size="mini" type="text" style="color: #ff4d4f" @click="removeListenerField(row, $index)">移除</el-button> | ... | ... |
yudao-ui-admin/src/components/bpmnProcessDesigner/package/penal/properties/ElementProperties.vue
| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | <el-table-column label="属性名" prop="name" min-width="100px" show-overflow-tooltip /> |
| 6 | 6 | <el-table-column label="属性值" prop="value" min-width="100px" show-overflow-tooltip /> |
| 7 | 7 | <el-table-column label="操作" width="90px"> |
| 8 | - <template slot-scope="{ row, $index }"> | |
| 8 | + <template v-slot="{ row, $index }"> | |
| 9 | 9 | <el-button size="mini" type="text" @click="openAttributesForm(row, $index)">编辑</el-button> |
| 10 | 10 | <el-divider direction="vertical" /> |
| 11 | 11 | <el-button size="mini" type="text" style="color: #ff4d4f" @click="removeAttributes(row, $index)">移除</el-button> | ... | ... |
yudao-ui-admin/src/layout/components/Message/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div> | |
| 3 | + <el-popover placement="bottom" width="600" trigger="click"> | |
| 4 | + <!-- icon 展示 --> | |
| 5 | + <el-badge slot="reference" :is-dot="unreadCount > 0" type="danger"> | |
| 6 | + <svg-icon icon-class="message" @click="getList"/> | |
| 7 | + </el-badge> | |
| 8 | + | |
| 9 | + <!-- 弹出列表 --> | |
| 10 | + <el-table v-loading="loading" :data="list"> | |
| 11 | + <el-table-column width="120" property="templateNickname" label="发送人" /> | |
| 12 | + <el-table-column width="180" property="createTime" label="发送时间"> | |
| 13 | + <template v-slot="scope"> | |
| 14 | + <span>{{ parseTime(scope.row.createTime) }}</span> | |
| 15 | + </template> | |
| 16 | + </el-table-column> | |
| 17 | + <el-table-column label="类型" align="center" prop="templateType" width="100"> | |
| 18 | + <template v-slot="scope"> | |
| 19 | + <dict-tag :type="DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE" :value="scope.row.templateType" /> | |
| 20 | + </template> | |
| 21 | + </el-table-column> | |
| 22 | + <el-table-column property="templateContent" label="内容" /> | |
| 23 | + </el-table> | |
| 24 | + | |
| 25 | + <!-- 更多 --> | |
| 26 | + <div style="text-align: right; margin-top: 10px"> | |
| 27 | + <el-button type="primary" size="mini" @click="goMyList">查看全部</el-button> | |
| 28 | + </div> | |
| 29 | + </el-popover> | |
| 30 | + </div> | |
| 31 | +</template> | |
| 32 | + | |
| 33 | +<script> | |
| 34 | +import {getUnreadNotifyMessageCount, getUnreadNotifyMessageList} from "@/api/system/notify/message"; | |
| 35 | + | |
| 36 | +export default { | |
| 37 | + name: 'NotifyMessage', | |
| 38 | + data() { | |
| 39 | + return { | |
| 40 | + // 遮罩层 | |
| 41 | + loading: false, | |
| 42 | + // 列表 | |
| 43 | + list: [], | |
| 44 | + // 未读数量, | |
| 45 | + unreadCount: 0, | |
| 46 | + } | |
| 47 | + }, | |
| 48 | + created() { | |
| 49 | + // 首次加载小红点 | |
| 50 | + this.getUnreadCount() | |
| 51 | + // 轮询刷新小红点 | |
| 52 | + setInterval(() => { | |
| 53 | + this.getUnreadCount() | |
| 54 | + },1000 * 60 * 2) | |
| 55 | + }, | |
| 56 | + methods: { | |
| 57 | + getList: function() { | |
| 58 | + this.loading = true; | |
| 59 | + getUnreadNotifyMessageList().then(response => { | |
| 60 | + this.list = response.data; | |
| 61 | + this.loading = false; | |
| 62 | + // 强制设置 unreadCount 为 0,避免小红点因为轮询太慢,不消除 | |
| 63 | + this.unreadCount = 0 | |
| 64 | + }); | |
| 65 | + }, | |
| 66 | + getUnreadCount: function() { | |
| 67 | + getUnreadNotifyMessageCount().then(response => { | |
| 68 | + this.unreadCount = response.data; | |
| 69 | + }) | |
| 70 | + }, | |
| 71 | + goMyList: function() { | |
| 72 | + this.$router.push({ | |
| 73 | + name: 'MyNotifyMessage' | |
| 74 | + }); | |
| 75 | + } | |
| 76 | + } | |
| 77 | +} | |
| 78 | +</script> | |
| 79 | +<style> | |
| 80 | +.el-badge__content.is-fixed { | |
| 81 | + top: 10px; /* 保证徽章的位置 */ | |
| 82 | +} | |
| 83 | +</style> | ... | ... |
yudao-ui-admin/src/layout/components/Navbar.vue
| ... | ... | @@ -9,6 +9,9 @@ |
| 9 | 9 | <template v-if="device!=='mobile'"> |
| 10 | 10 | <search id="header-search" class="right-menu-item" /> |
| 11 | 11 | |
| 12 | + <!-- 站内信 --> | |
| 13 | + <notify-message class="right-menu-item hover-effect" /> | |
| 14 | + | |
| 12 | 15 | <el-tooltip content="源码地址" effect="dark" placement="bottom"> |
| 13 | 16 | <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" /> |
| 14 | 17 | </el-tooltip> |
| ... | ... | @@ -57,6 +60,7 @@ import SizeSelect from '@/components/SizeSelect' |
| 57 | 60 | import Search from '@/components/HeaderSearch' |
| 58 | 61 | import RuoYiGit from '@/components/RuoYi/Git' |
| 59 | 62 | import RuoYiDoc from '@/components/RuoYi/Doc' |
| 63 | +import NotifyMessage from '@/layout/components/Message' | |
| 60 | 64 | import {getPath} from "@/utils/ruoyi"; |
| 61 | 65 | |
| 62 | 66 | export default { |
| ... | ... | @@ -68,7 +72,8 @@ export default { |
| 68 | 72 | SizeSelect, |
| 69 | 73 | Search, |
| 70 | 74 | RuoYiGit, |
| 71 | - RuoYiDoc | |
| 75 | + RuoYiDoc, | |
| 76 | + NotifyMessage | |
| 72 | 77 | }, |
| 73 | 78 | computed: { |
| 74 | 79 | ...mapGetters([ | ... | ... |
yudao-ui-admin/src/router/index.js
| ... | ... | @@ -75,7 +75,8 @@ export const constantRoutes = [ |
| 75 | 75 | meta: {title: '首页', icon: 'dashboard', affix: true} |
| 76 | 76 | } |
| 77 | 77 | ] |
| 78 | - }, { | |
| 78 | + }, | |
| 79 | + { | |
| 79 | 80 | path: '/user', |
| 80 | 81 | component: Layout, |
| 81 | 82 | hidden: true, |
| ... | ... | @@ -85,9 +86,14 @@ export const constantRoutes = [ |
| 85 | 86 | component: (resolve) => require(['@/views/system/user/profile/index'], resolve), |
| 86 | 87 | name: 'Profile', |
| 87 | 88 | meta: {title: '个人中心', icon: 'user'} |
| 88 | - } | |
| 89 | - ] | |
| 90 | - }, { | |
| 89 | + }, { | |
| 90 | + path: 'notify-message', | |
| 91 | + component: (resolve) => require(['@/views/system/notify/my/index'], resolve), | |
| 92 | + name: 'MyNotifyMessage', | |
| 93 | + meta: { title: '我的站内信', icon: 'message' }, | |
| 94 | + }] | |
| 95 | + }, | |
| 96 | + { | |
| 91 | 97 | path: '/dict', |
| 92 | 98 | component: Layout, |
| 93 | 99 | hidden: true, |
| ... | ... | @@ -98,18 +104,8 @@ export const constantRoutes = [ |
| 98 | 104 | meta: {title: '字典数据', icon: '', activeMenu: '/system/dict'} |
| 99 | 105 | } |
| 100 | 106 | ] |
| 101 | - }, { | |
| 102 | - path: '/property', | |
| 103 | - component: Layout, | |
| 104 | - hidden: true, | |
| 105 | - children: [{ | |
| 106 | - path: 'value/:propertyId(\\d+)', | |
| 107 | - component: (resolve) => require(['@/views/mall/product/property/value'], resolve), | |
| 108 | - name: 'PropertyValue', | |
| 109 | - meta: {title: '商品属性值', icon: '', activeMenu: '/product/property'} | |
| 110 | - } | |
| 111 | - ] | |
| 112 | - }, { | |
| 107 | + }, | |
| 108 | + { | |
| 113 | 109 | path: '/job', |
| 114 | 110 | component: Layout, |
| 115 | 111 | hidden: true, |
| ... | ... | @@ -131,24 +127,8 @@ export const constantRoutes = [ |
| 131 | 127 | meta: {title: '修改生成配置', activeMenu: '/infra/codegen'} |
| 132 | 128 | } |
| 133 | 129 | ] |
| 134 | - }, { | |
| 135 | - path: '/spu', | |
| 136 | - component: Layout, | |
| 137 | - hidden: true, | |
| 138 | - children: [{ | |
| 139 | - path: 'edit/:spuId(\\d+)', | |
| 140 | - component: (resolve) => require(['@/views/mall/product/spu/save'], resolve), | |
| 141 | - name: 'SpuEdit', | |
| 142 | - meta: {title: '修改商品', activeMenu: '/product/spu'} | |
| 143 | - }, | |
| 144 | - { | |
| 145 | - path: 'add', | |
| 146 | - component: (resolve) => require(['@/views/mall/product/spu/save'], resolve), | |
| 147 | - name: 'SpuAdd', | |
| 148 | - meta: {title: '添加商品', activeMenu: '/product/spu'} | |
| 149 | - } | |
| 150 | - ] | |
| 151 | - }, { | |
| 130 | + }, | |
| 131 | + { | |
| 152 | 132 | path: '/bpm', |
| 153 | 133 | component: Layout, |
| 154 | 134 | hidden: true, |
| ... | ... | @@ -165,7 +145,8 @@ export const constantRoutes = [ |
| 165 | 145 | meta: {title: '查看 OA 请假', icon: 'view', activeMenu: '/bpm/oa/leave'} |
| 166 | 146 | } |
| 167 | 147 | ] |
| 168 | - }, { | |
| 148 | + }, | |
| 149 | + { | |
| 169 | 150 | path: '/bpm', |
| 170 | 151 | component: Layout, |
| 171 | 152 | hidden: true, |
| ... | ... | @@ -198,6 +179,36 @@ export const constantRoutes = [ |
| 198 | 179 | ] |
| 199 | 180 | }, |
| 200 | 181 | { |
| 182 | + path: '/property', | |
| 183 | + component: Layout, | |
| 184 | + hidden: true, | |
| 185 | + children: [{ | |
| 186 | + path: 'value/:propertyId(\\d+)', | |
| 187 | + component: (resolve) => require(['@/views/mall/product/property/value'], resolve), | |
| 188 | + name: 'PropertyValue', | |
| 189 | + meta: {title: '商品属性值', icon: '', activeMenu: '/product/property'} | |
| 190 | + } | |
| 191 | + ] | |
| 192 | + }, | |
| 193 | + { | |
| 194 | + path: '/spu', | |
| 195 | + component: Layout, | |
| 196 | + hidden: true, | |
| 197 | + children: [{ | |
| 198 | + path: 'edit/:spuId(\\d+)', | |
| 199 | + component: (resolve) => require(['@/views/mall/product/spu/save'], resolve), | |
| 200 | + name: 'SpuEdit', | |
| 201 | + meta: {title: '修改商品', activeMenu: '/product/spu'} | |
| 202 | + }, | |
| 203 | + { | |
| 204 | + path: 'add', | |
| 205 | + component: (resolve) => require(['@/views/mall/product/spu/save'], resolve), | |
| 206 | + name: 'SpuAdd', | |
| 207 | + meta: {title: '添加商品', activeMenu: '/product/spu'} | |
| 208 | + } | |
| 209 | + ] | |
| 210 | + }, | |
| 211 | + { | |
| 201 | 212 | path: '/trade/order', |
| 202 | 213 | component: Layout, |
| 203 | 214 | hidden: true, | ... | ... |
yudao-ui-admin/src/utils/dict.js
| ... | ... | @@ -25,6 +25,8 @@ export const DICT_TYPE = { |
| 25 | 25 | SYSTEM_SMS_RECEIVE_STATUS: 'system_sms_receive_status', |
| 26 | 26 | SYSTEM_ERROR_CODE_TYPE: 'system_error_code_type', |
| 27 | 27 | SYSTEM_OAUTH2_GRANT_TYPE: 'system_oauth2_grant_type', |
| 28 | + SYSTEM_MAIL_SEND_STATUS: 'system_mail_send_status', | |
| 29 | + SYSTEM_NOTIFY_TEMPLATE_TYPE: 'system_notify_template_type', | |
| 28 | 30 | |
| 29 | 31 | // ========== INFRA 模块 ========== |
| 30 | 32 | INFRA_BOOLEAN_STRING: 'infra_boolean_string', | ... | ... |
yudao-ui-admin/src/views/infra/build/RightPanel.vue
| ... | ... | @@ -554,7 +554,7 @@ |
| 554 | 554 | default-expand-all |
| 555 | 555 | draggable |
| 556 | 556 | > |
| 557 | - <span slot-scope="{ node, data }"> | |
| 557 | + <span v-slot="{ node, data }"> | |
| 558 | 558 | <span class="node-label"> |
| 559 | 559 | <svg-icon class="node-icon" :icon-class="data.__config__?data.__config__.tagIcon:data.tagIcon" /> |
| 560 | 560 | {{ node.label }} | ... | ... |
yudao-ui-admin/src/views/mall/product/property/index.vue
| ... | ... | @@ -29,7 +29,7 @@ |
| 29 | 29 | <el-table v-loading="loading" :data="list"> |
| 30 | 30 | <el-table-column label="编号" align="center" prop="id" /> |
| 31 | 31 | <el-table-column label="名称" align="center" :show-overflow-tooltip="true"> |
| 32 | - <template slot-scope="scope"> | |
| 32 | + <template v-slot="scope"> | |
| 33 | 33 | <router-link :to="'/property/value/' + scope.row.id" class="link-type"> |
| 34 | 34 | <span>{{ scope.row.name }}</span> |
| 35 | 35 | </router-link> |
| ... | ... | @@ -37,12 +37,12 @@ |
| 37 | 37 | </el-table-column> |
| 38 | 38 | <el-table-column label="备注" align="center" prop="remark" /> |
| 39 | 39 | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
| 40 | - <template slot-scope="scope"> | |
| 40 | + <template v-slot="scope"> | |
| 41 | 41 | <span>{{ parseTime(scope.row.createTime) }}</span> |
| 42 | 42 | </template> |
| 43 | 43 | </el-table-column> |
| 44 | 44 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 45 | - <template slot-scope="scope"> | |
| 45 | + <template v-slot="scope"> | |
| 46 | 46 | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" |
| 47 | 47 | v-hasPermi="['product:property:update']">修改</el-button> |
| 48 | 48 | <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" | ... | ... |
yudao-ui-admin/src/views/mall/product/property/value.vue
| ... | ... | @@ -29,12 +29,12 @@ |
| 29 | 29 | <el-table-column label="名称" align="center" prop="name"/> |
| 30 | 30 | <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/> |
| 31 | 31 | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
| 32 | - <template slot-scope="scope"> | |
| 32 | + <template v-slot="scope"> | |
| 33 | 33 | <span>{{ parseTime(scope.row.createTime) }}</span> |
| 34 | 34 | </template> |
| 35 | 35 | </el-table-column> |
| 36 | 36 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 37 | - <template slot-scope="scope"> | |
| 37 | + <template v-slot="scope"> | |
| 38 | 38 | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" |
| 39 | 39 | v-hasPermi="['system:dict:update']">修改 |
| 40 | 40 | </el-button> | ... | ... |
yudao-ui-admin/src/views/mall/product/spu/index.vue
| ... | ... | @@ -67,7 +67,7 @@ |
| 67 | 67 | <!-- 列表 --> |
| 68 | 68 | <el-table v-loading="loading" :data="list"> |
| 69 | 69 | <el-table-column label="商品信息" align="center" width="260"> |
| 70 | - <template slot-scope="scope"> | |
| 70 | + <template v-slot="scope"> | |
| 71 | 71 | <div class="product-info"> |
| 72 | 72 | <img v-if="scope.row.picUrls" :src="scope.row.picUrls[0]" alt="分类图片" class="img-height" /> |
| 73 | 73 | <div class="message">{{ scope.row.name }}</div> |
| ... | ... | @@ -80,17 +80,17 @@ |
| 80 | 80 | <el-table-column label="销量" align="center" prop="salesCount"/> |
| 81 | 81 | <el-table-column label="排序" align="center" prop="sort"/> |
| 82 | 82 | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
| 83 | - <template slot-scope="scope"> | |
| 83 | + <template v-slot="scope"> | |
| 84 | 84 | <span>{{ parseTime(scope.row.createTime) }}</span> |
| 85 | 85 | </template> |
| 86 | 86 | </el-table-column> |
| 87 | 87 | <el-table-column label="状态" align="center" prop="status"> |
| 88 | - <template slot-scope="scope"> | |
| 88 | + <template v-slot="scope"> | |
| 89 | 89 | <dict-tag :type="DICT_TYPE.PRODUCT_SPU_STATUS" :value="scope.row.status"/> |
| 90 | 90 | </template> |
| 91 | 91 | </el-table-column> |
| 92 | 92 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 93 | - <template slot-scope="scope"> | |
| 93 | + <template v-slot="scope"> | |
| 94 | 94 | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" |
| 95 | 95 | v-hasPermi="['product:spu:update']">修改</el-button> |
| 96 | 96 | <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" |
| ... | ... | @@ -105,7 +105,7 @@ |
| 105 | 105 | <!-- 列表 --> |
| 106 | 106 | <el-table v-loading="loading" :data="list"> |
| 107 | 107 | <el-table-column label="商品信息" align="center" width="260"> |
| 108 | - <template slot-scope="scope"> | |
| 108 | + <template v-slot="scope"> | |
| 109 | 109 | <div class="product-info"> |
| 110 | 110 | <img v-if="scope.row.picUrls" :src="scope.row.picUrls[0]" alt="分类图片" class="img-height"/> |
| 111 | 111 | <div class="message">{{ scope.row.name }}</div> |
| ... | ... | @@ -117,17 +117,17 @@ |
| 117 | 117 | <el-table-column label="销量" align="center" prop="salesCount"/> |
| 118 | 118 | <el-table-column label="排序" align="center" prop="sort"/> |
| 119 | 119 | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
| 120 | - <template slot-scope="scope"> | |
| 120 | + <template v-slot="scope"> | |
| 121 | 121 | <span>{{ parseTime(scope.row.createTime) }}</span> |
| 122 | 122 | </template> |
| 123 | 123 | </el-table-column> |
| 124 | 124 | <el-table-column label="状态" align="center" prop="status"> |
| 125 | - <template slot-scope="scope"> | |
| 125 | + <template v-slot="scope"> | |
| 126 | 126 | <dict-tag :type="DICT_TYPE.PRODUCT_SPU_STATUS" :value="scope.row.status"/> |
| 127 | 127 | </template> |
| 128 | 128 | </el-table-column> |
| 129 | 129 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 130 | - <template slot-scope="scope"> | |
| 130 | + <template v-slot="scope"> | |
| 131 | 131 | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" |
| 132 | 132 | v-hasPermi="['product:spu:update']">修改</el-button> |
| 133 | 133 | <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" |
| ... | ... | @@ -142,7 +142,7 @@ |
| 142 | 142 | <!-- 列表 --> |
| 143 | 143 | <el-table v-loading="loading" :data="list"> |
| 144 | 144 | <el-table-column label="商品信息" align="center" width="260"> |
| 145 | - <template slot-scope="scope"> | |
| 145 | + <template v-slot="scope"> | |
| 146 | 146 | <div class="product-info"> |
| 147 | 147 | <img v-if="scope.row.picUrls" :src="scope.row.picUrls[0]" alt="分类图片" class="img-height"/> |
| 148 | 148 | <div class="message">{{ scope.row.name }}</div> |
| ... | ... | @@ -154,17 +154,17 @@ |
| 154 | 154 | <el-table-column label="销量" align="center" prop="salesCount"/> |
| 155 | 155 | <el-table-column label="排序" align="center" prop="sort"/> |
| 156 | 156 | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
| 157 | - <template slot-scope="scope"> | |
| 157 | + <template v-slot="scope"> | |
| 158 | 158 | <span>{{ parseTime(scope.row.createTime) }}</span> |
| 159 | 159 | </template> |
| 160 | 160 | </el-table-column> |
| 161 | 161 | <el-table-column label="状态" align="center" prop="status"> |
| 162 | - <template slot-scope="scope"> | |
| 162 | + <template v-slot="scope"> | |
| 163 | 163 | <dict-tag :type="DICT_TYPE.PRODUCT_SPU_STATUS" :value="scope.row.status"/> |
| 164 | 164 | </template> |
| 165 | 165 | </el-table-column> |
| 166 | 166 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 167 | - <template slot-scope="scope"> | |
| 167 | + <template v-slot="scope"> | |
| 168 | 168 | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" |
| 169 | 169 | v-hasPermi="['product:spu:update']">修改</el-button> |
| 170 | 170 | <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" |
| ... | ... | @@ -179,7 +179,7 @@ |
| 179 | 179 | <!-- 列表 --> |
| 180 | 180 | <el-table v-loading="loading" :data="list"> |
| 181 | 181 | <el-table-column label="商品信息" align="center" width="260"> |
| 182 | - <template slot-scope="scope"> | |
| 182 | + <template v-slot="scope"> | |
| 183 | 183 | <div class="product-info"> |
| 184 | 184 | <img v-if="scope.row.picUrls" :src="scope.row.picUrls[0]" alt="分类图片" class="img-height"/> |
| 185 | 185 | <div class="message">{{ scope.row.name }}</div> |
| ... | ... | @@ -191,17 +191,17 @@ |
| 191 | 191 | <el-table-column label="销量" align="center" prop="salesCount"/> |
| 192 | 192 | <el-table-column label="排序" align="center" prop="sort"/> |
| 193 | 193 | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
| 194 | - <template slot-scope="scope"> | |
| 194 | + <template v-slot="scope"> | |
| 195 | 195 | <span>{{ parseTime(scope.row.createTime) }}</span> |
| 196 | 196 | </template> |
| 197 | 197 | </el-table-column> |
| 198 | 198 | <el-table-column label="状态" align="center" prop="status"> |
| 199 | - <template slot-scope="scope"> | |
| 199 | + <template v-slot="scope"> | |
| 200 | 200 | <dict-tag :type="DICT_TYPE.PRODUCT_SPU_STATUS" :value="scope.row.status"/> |
| 201 | 201 | </template> |
| 202 | 202 | </el-table-column> |
| 203 | 203 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 204 | - <template slot-scope="scope"> | |
| 204 | + <template v-slot="scope"> | |
| 205 | 205 | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" |
| 206 | 206 | v-hasPermi="['product:spu:update']">修改</el-button> |
| 207 | 207 | <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" | ... | ... |
yudao-ui-admin/src/views/mall/product/spu/save.vue
| ... | ... | @@ -69,18 +69,18 @@ |
| 69 | 69 | <template v-if="this.specSwitch"> |
| 70 | 70 | <el-table-column :key="index" v-for="(item, index) in dynamicSpec.filter(v => v.specName !== undefined)" |
| 71 | 71 | :label="item.specName"> |
| 72 | - <template slot-scope="scope"> | |
| 72 | + <template v-slot="scope"> | |
| 73 | 73 | <el-input v-if="scope.row.spec" v-model="scope.row.spec[index]" disabled/> |
| 74 | 74 | </template> |
| 75 | 75 | </el-table-column> |
| 76 | 76 | </template> |
| 77 | 77 | <el-table-column label="规格图片" width="120px" :render-header="addRedStar" key="90"> |
| 78 | - <template slot-scope="scope"> | |
| 78 | + <template v-slot="scope"> | |
| 79 | 79 | <ImageUpload v-model="scope.row.picUrl" :limit="1" :isShowTip="false" style="width: 100px; height: 50px"/> |
| 80 | 80 | </template> |
| 81 | 81 | </el-table-column> |
| 82 | 82 | <el-table-column label="市场价(元)" :render-header="addRedStar" key="92"> |
| 83 | - <template slot-scope="scope"> | |
| 83 | + <template v-slot="scope"> | |
| 84 | 84 | <el-form-item :prop="'rates.'+ scope.$index + '.marketPrice'" :rules="[{required: true, trigger: 'change'}]"> |
| 85 | 85 | <el-input v-model="scope.row.marketPrice" |
| 86 | 86 | oninput="value= value.match(/\d+(\.\d{0,2})?/) ? value.match(/\d+(\.\d{0,2})?/)[0] : ''"/> |
| ... | ... | @@ -88,7 +88,7 @@ |
| 88 | 88 | </template> |
| 89 | 89 | </el-table-column> |
| 90 | 90 | <el-table-column label="销售价(元)" :render-header="addRedStar" key="93"> |
| 91 | - <template slot-scope="scope"> | |
| 91 | + <template v-slot="scope"> | |
| 92 | 92 | <el-form-item :prop="'rates.'+ scope.$index + '.price'" |
| 93 | 93 | :rules="[{required: true, trigger: 'change'}]"> |
| 94 | 94 | <el-input v-model="scope.row.price" |
| ... | ... | @@ -97,7 +97,7 @@ |
| 97 | 97 | </template> |
| 98 | 98 | </el-table-column> |
| 99 | 99 | <el-table-column label="成本价" :render-header="addRedStar" key="94"> |
| 100 | - <template slot-scope="scope"> | |
| 100 | + <template v-slot="scope"> | |
| 101 | 101 | <el-form-item :prop="'rates.'+ scope.$index + '.costPrice'" |
| 102 | 102 | :rules="[{required: true, trigger: 'change'}]"> |
| 103 | 103 | <el-input v-model="scope.row.costPrice" |
| ... | ... | @@ -106,35 +106,35 @@ |
| 106 | 106 | </template> |
| 107 | 107 | </el-table-column> |
| 108 | 108 | <el-table-column label="库存" :render-header="addRedStar" key="95"> |
| 109 | - <template slot-scope="scope"> | |
| 109 | + <template v-slot="scope"> | |
| 110 | 110 | <el-form-item :prop="'rates.'+ scope.$index + '.stock'" :rules="[{required: true, trigger: 'change'}]"> |
| 111 | 111 | <el-input v-model="scope.row.stock" oninput="value=value.replace(/^(0+)|[^\d]+/g,'')"></el-input> |
| 112 | 112 | </el-form-item> |
| 113 | 113 | </template> |
| 114 | 114 | </el-table-column> |
| 115 | 115 | <el-table-column label="预警库存" key="96"> |
| 116 | - <template slot-scope="scope"> | |
| 116 | + <template v-slot="scope"> | |
| 117 | 117 | <el-input v-model="scope.row.warnStock" oninput="value=value.replace(/^(0+)|[^\d]+/g,'')"></el-input> |
| 118 | 118 | </template> |
| 119 | 119 | </el-table-column> |
| 120 | 120 | <el-table-column label="体积" key="97"> |
| 121 | - <template slot-scope="scope"> | |
| 121 | + <template v-slot="scope"> | |
| 122 | 122 | <el-input v-model="scope.row.volume" /> |
| 123 | 123 | </template> |
| 124 | 124 | </el-table-column> |
| 125 | 125 | <el-table-column label="重量" key="98"> |
| 126 | - <template slot-scope="scope"> | |
| 126 | + <template v-slot="scope"> | |
| 127 | 127 | <el-input v-model="scope.row.weight" /> |
| 128 | 128 | </template> |
| 129 | 129 | </el-table-column> |
| 130 | 130 | <el-table-column label="条码" key="99"> |
| 131 | - <template slot-scope="scope"> | |
| 131 | + <template v-slot="scope"> | |
| 132 | 132 | <el-input v-model="scope.row.barCode" /> |
| 133 | 133 | </template> |
| 134 | 134 | </el-table-column> |
| 135 | 135 | <template v-if="this.specSwitch"> |
| 136 | 136 | <el-table-column fixed="right" label="操作" width="50" key="100"> |
| 137 | - <template slot-scope="scope"> | |
| 137 | + <template v-slot="scope"> | |
| 138 | 138 | <el-button @click="scope.row.status = 1" type="text" size="small" |
| 139 | 139 | v-show="scope.row.status === undefined || scope.row.status === 0 ">禁用 |
| 140 | 140 | </el-button> | ... | ... |
yudao-ui-admin/src/views/mall/promotion/coupon/index.vue
| ... | ... | @@ -30,32 +30,32 @@ |
| 30 | 30 | <el-table-column label="会员信息" align="center" prop="nickname" /> <!-- TODO 芋艿:以后支持头像,支持跳转 --> |
| 31 | 31 | <el-table-column label="优惠劵" align="center" prop="name" /> |
| 32 | 32 | <el-table-column label="优惠券类型" align="center" prop="discountType"> |
| 33 | - <template slot-scope="scope"> | |
| 33 | + <template v-slot="scope"> | |
| 34 | 34 | <dict-tag :type="DICT_TYPE.PROMOTION_DISCOUNT_TYPE" :value="scope.row.discountType" /> |
| 35 | 35 | </template> |
| 36 | 36 | </el-table-column> |
| 37 | 37 | <el-table-column label="领取方式" align="center" prop="takeType"> |
| 38 | - <template slot-scope="scope"> | |
| 38 | + <template v-slot="scope"> | |
| 39 | 39 | <dict-tag :type="DICT_TYPE.PROMOTION_COUPON_TAKE_TYPE" :value="scope.row.takeType" /> |
| 40 | 40 | </template> |
| 41 | 41 | </el-table-column> |
| 42 | 42 | <el-table-column label="状态" align="center" prop="status"> |
| 43 | - <template slot-scope="scope"> | |
| 43 | + <template v-slot="scope"> | |
| 44 | 44 | <dict-tag :type="DICT_TYPE.PROMOTION_COUPON_STATUS" :value="scope.row.status" /> |
| 45 | 45 | </template> |
| 46 | 46 | </el-table-column> |
| 47 | 47 | <el-table-column label="领取时间" align="center" prop="createTime" width="180"> |
| 48 | - <template slot-scope="scope"> | |
| 48 | + <template v-slot="scope"> | |
| 49 | 49 | <span>{{ parseTime(scope.row.createTime) }}</span> |
| 50 | 50 | </template> |
| 51 | 51 | </el-table-column> |
| 52 | 52 | <el-table-column label="使用时间" align="center" prop="useTime" width="180"> |
| 53 | - <template slot-scope="scope"> | |
| 53 | + <template v-slot="scope"> | |
| 54 | 54 | <span>{{ parseTime(scope.row.useTime) }}</span> |
| 55 | 55 | </template> |
| 56 | 56 | </el-table-column> |
| 57 | 57 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 58 | - <template slot-scope="scope"> | |
| 58 | + <template v-slot="scope"> | |
| 59 | 59 | <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" |
| 60 | 60 | v-hasPermi="['promotion:coupon:delete']">回收</el-button> |
| 61 | 61 | </template> | ... | ... |
yudao-ui-admin/src/views/mall/promotion/couponTemplate/index.vue
| ... | ... | @@ -44,7 +44,7 @@ |
| 44 | 44 | <el-table v-loading="loading" :data="list"> |
| 45 | 45 | <el-table-column label="优惠券名称" align="center" prop="name" /> |
| 46 | 46 | <el-table-column label="优惠券类型" align="center" prop="discountType"> |
| 47 | - <template slot-scope="scope"> | |
| 47 | + <template v-slot="scope"> | |
| 48 | 48 | <dict-tag :type="DICT_TYPE.PROMOTION_DISCOUNT_TYPE" :value="scope.row.discountType" /> |
| 49 | 49 | </template> |
| 50 | 50 | </el-table-column> |
| ... | ... | @@ -54,17 +54,17 @@ |
| 54 | 54 | <el-table-column label="领取上限" align="center" prop="takeLimitCount" :formatter="takeLimitCountFormat" /> |
| 55 | 55 | <el-table-column label="有效期限" align="center" prop="validityType" width="180" :formatter="validityTypeFormat" /> |
| 56 | 56 | <el-table-column label="状态" align="center" prop="status"> |
| 57 | - <template slot-scope="scope"> | |
| 57 | + <template v-slot="scope"> | |
| 58 | 58 | <el-switch v-model="scope.row.status" :active-value="0" :inactive-value="1" @change="handleStatusChange(scope.row)"/> |
| 59 | 59 | </template> |
| 60 | 60 | </el-table-column> |
| 61 | 61 | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
| 62 | - <template slot-scope="scope"> | |
| 62 | + <template v-slot="scope"> | |
| 63 | 63 | <span>{{ parseTime(scope.row.createTime) }}</span> |
| 64 | 64 | </template> |
| 65 | 65 | </el-table-column> |
| 66 | 66 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 67 | - <template slot-scope="scope"> | |
| 67 | + <template v-slot="scope"> | |
| 68 | 68 | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" |
| 69 | 69 | v-hasPermi="['promotion:coupon-template:update']">修改</el-button> |
| 70 | 70 | <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" | ... | ... |
yudao-ui-admin/src/views/mall/promotion/discountActivity/index.vue
| ... | ... | @@ -35,23 +35,23 @@ |
| 35 | 35 | <el-table v-loading="loading" :data="list"> |
| 36 | 36 | <el-table-column label="活动名称" align="center" prop="name" /> |
| 37 | 37 | <el-table-column label="活动时间" align="center" prop="startTime" width="240"> |
| 38 | - <template slot-scope="scope"> | |
| 38 | + <template v-slot="scope"> | |
| 39 | 39 | <div>开始:{{ parseTime(scope.row.startTime) }}</div> |
| 40 | 40 | <div>结束:{{ parseTime(scope.row.endTime) }}</div> |
| 41 | 41 | </template> |
| 42 | 42 | </el-table-column> |
| 43 | 43 | <el-table-column label="状态" align="center" prop="status"> |
| 44 | - <template slot-scope="scope"> | |
| 44 | + <template v-slot="scope"> | |
| 45 | 45 | <dict-tag :type="DICT_TYPE.PROMOTION_ACTIVITY_STATUS" :value="scope.row.status" /> |
| 46 | 46 | </template> |
| 47 | 47 | </el-table-column> |
| 48 | 48 | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
| 49 | - <template slot-scope="scope"> | |
| 49 | + <template v-slot="scope"> | |
| 50 | 50 | <span>{{ parseTime(scope.row.createTime) }}</span> |
| 51 | 51 | </template> |
| 52 | 52 | </el-table-column> |
| 53 | 53 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 54 | - <template slot-scope="scope"> | |
| 54 | + <template v-slot="scope"> | |
| 55 | 55 | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" |
| 56 | 56 | v-if="scope.row.status !== PromotionActivityStatusEnum.CLOSE.type" |
| 57 | 57 | v-hasPermi="['promotion:discount-activity:update']">修改</el-button> |
| ... | ... | @@ -92,18 +92,18 @@ |
| 92 | 92 | </el-select> |
| 93 | 93 | <el-table v-loading="loading" :data="form.products"> |
| 94 | 94 | <el-table-column label="商品名称" align="center" width="200"> |
| 95 | - <template slot-scope="scope"> | |
| 95 | + <template v-slot="scope"> | |
| 96 | 96 | {{ scope.row.spuName }} {{ scope.row.name}} |
| 97 | 97 | </template> |
| 98 | 98 | </el-table-column> |
| 99 | 99 | <el-table-column label="商品价格" align="center" prop="price"> |
| 100 | - <template slot-scope="scope"> | |
| 100 | + <template v-slot="scope"> | |
| 101 | 101 | ¥{{ (scope.row.price / 100.0).toFixed(2) }} |
| 102 | 102 | </template> |
| 103 | 103 | </el-table-column> |
| 104 | 104 | <el-table-column label="库存" align="center" prop="stock" /> |
| 105 | 105 | <el-table-column label="优惠类型" align="center" property="discountType"> |
| 106 | - <template slot-scope="scope"> | |
| 106 | + <template v-slot="scope"> | |
| 107 | 107 | <el-select v-model="scope.row.discountType" placeholder="请选择优惠类型"> |
| 108 | 108 | <el-option v-for="dict in getDictDatas(DICT_TYPE.PROMOTION_DISCOUNT_TYPE)" |
| 109 | 109 | :key="dict.value" :label="dict.label" :value="parseInt(dict.value)"/> |
| ... | ... | @@ -111,7 +111,7 @@ |
| 111 | 111 | </template> |
| 112 | 112 | </el-table-column> |
| 113 | 113 | <el-table-column label="优惠" align="center" prop="startTime" width="250"> |
| 114 | - <template slot-scope="scope"> | |
| 114 | + <template v-slot="scope"> | |
| 115 | 115 | <el-form-item v-if="scope.row.discountType === PromotionDiscountTypeEnum.PRICE.type" prop="discountPrice"> |
| 116 | 116 | 减 <el-input-number v-model="scope.row.discountPrice" placeholder="请输入优惠金额" |
| 117 | 117 | style="width: 190px" :precision="2" :min="0" :max="scope.row.price / 100.0 - 0.01" /> 元 |
| ... | ... | @@ -123,7 +123,7 @@ |
| 123 | 123 | </template> |
| 124 | 124 | </el-table-column> |
| 125 | 125 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 126 | - <template slot-scope="scope"> | |
| 126 | + <template v-slot="scope"> | |
| 127 | 127 | <el-button size="mini" type="text" icon="el-icon-delete" @click="removeFormSku(scope.row.skuId)">删除</el-button> |
| 128 | 128 | </template> |
| 129 | 129 | </el-table-column> | ... | ... |
yudao-ui-admin/src/views/mall/promotion/rewardActivity/index.vue
| ... | ... | @@ -31,23 +31,23 @@ |
| 31 | 31 | <el-table v-loading="loading" :data="list"> |
| 32 | 32 | <el-table-column label="活动名称" align="center" prop="name" /> |
| 33 | 33 | <el-table-column label="活动时间" align="center" prop="startTime" width="240"> |
| 34 | - <template slot-scope="scope"> | |
| 34 | + <template v-slot="scope"> | |
| 35 | 35 | <div>开始:{{ parseTime(scope.row.startTime) }}</div> |
| 36 | 36 | <div>结束:{{ parseTime(scope.row.endTime) }}</div> |
| 37 | 37 | </template> |
| 38 | 38 | </el-table-column> |
| 39 | 39 | <el-table-column label="状态" align="center" prop="status"> |
| 40 | - <template slot-scope="scope"> | |
| 40 | + <template v-slot="scope"> | |
| 41 | 41 | <dict-tag :type="DICT_TYPE.PROMOTION_ACTIVITY_STATUS" :value="scope.row.status" /> |
| 42 | 42 | </template> |
| 43 | 43 | </el-table-column> |
| 44 | 44 | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
| 45 | - <template slot-scope="scope"> | |
| 45 | + <template v-slot="scope"> | |
| 46 | 46 | <span>{{ parseTime(scope.row.createTime) }}</span> |
| 47 | 47 | </template> |
| 48 | 48 | </el-table-column> |
| 49 | 49 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 50 | - <template slot-scope="scope"> | |
| 50 | + <template v-slot="scope"> | |
| 51 | 51 | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" |
| 52 | 52 | v-if="scope.row.status !== PromotionActivityStatusEnum.CLOSE.type" |
| 53 | 53 | v-hasPermi="['promotion:reward-activity:update']">修改</el-button> | ... | ... |
yudao-ui-admin/src/views/mall/promotion/seckill/seckillActivity/index.vue
| ... | ... | @@ -47,12 +47,12 @@ |
| 47 | 47 | <el-table v-loading="loading" :data="list"> |
| 48 | 48 | <el-table-column label="活动名称" align="center" prop="name" /> |
| 49 | 49 | <el-table-column label="活动状态" align="center" prop="status"> |
| 50 | - <template slot-scope="scope"> | |
| 50 | + <template v-slot="scope"> | |
| 51 | 51 | <dict-tag :type="DICT_TYPE.PROMOTION_ACTIVITY_STATUS" :value="scope.row.status" /> |
| 52 | 52 | </template> |
| 53 | 53 | </el-table-column> |
| 54 | 54 | <el-table-column label="参与场次" prop="timeIds" width="250"> |
| 55 | - <template slot-scope="scope"> | |
| 55 | + <template v-slot="scope"> | |
| 56 | 56 | <span v-for="item in seckillTimeList" :key="item.id" |
| 57 | 57 | v-if="scope.row.timeIds.includes(item.id)"> |
| 58 | 58 | <el-tag style="margin:4px;" size="small">{{ item.name }}</el-tag> |
| ... | ... | @@ -60,7 +60,7 @@ |
| 60 | 60 | </template> |
| 61 | 61 | </el-table-column> |
| 62 | 62 | <el-table-column label="活动开始时间" align="center" prop="startTime" width="190"> |
| 63 | - <template slot-scope="scope"> | |
| 63 | + <template v-slot="scope"> | |
| 64 | 64 | <span>{{ "开始: " + parseTime(scope.row.startTime) }}</span> |
| 65 | 65 | <span>{{ "结束: " + parseTime(scope.row.endTime) }}</span> |
| 66 | 66 | </template> |
| ... | ... | @@ -69,12 +69,12 @@ |
| 69 | 69 | <el-table-column label="付款订单数" align="center" prop="orderCount" /> |
| 70 | 70 | <el-table-column label="付款人数" align="center" prop="userCount" /> |
| 71 | 71 | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
| 72 | - <template slot-scope="scope"> | |
| 72 | + <template v-slot="scope"> | |
| 73 | 73 | <span>{{ parseTime(scope.row.createTime) }}</span> |
| 74 | 74 | </template> |
| 75 | 75 | </el-table-column> |
| 76 | 76 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 77 | - <template slot-scope="scope"> | |
| 77 | + <template v-slot="scope"> | |
| 78 | 78 | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" |
| 79 | 79 | v-hasPermi="['promotion:seckill-activity:update']">修改</el-button> |
| 80 | 80 | <el-button size="mini" type="text" icon="el-icon-close" @click="handleClose(scope.row)" |
| ... | ... | @@ -137,37 +137,37 @@ |
| 137 | 137 | <el-table-column type="selection" width="55"> |
| 138 | 138 | </el-table-column> |
| 139 | 139 | <el-table-column label="商品名称" align="center" width="200"> |
| 140 | - <template slot-scope="scope"> | |
| 140 | + <template v-slot="scope"> | |
| 141 | 141 | {{ scope.row.spuName }} {{ scope.row.name }} |
| 142 | 142 | </template> |
| 143 | 143 | </el-table-column> |
| 144 | 144 | <el-table-column label="商品价格" align="center" prop="price"> |
| 145 | - <template slot-scope="scope"> | |
| 145 | + <template v-slot="scope"> | |
| 146 | 146 | ¥{{ (scope.row.price / 100.0).toFixed(2) }} |
| 147 | 147 | </template> |
| 148 | 148 | </el-table-column> |
| 149 | 149 | <el-table-column label="库存" align="center" prop="productStock" /> |
| 150 | 150 | <el-table-column label="限购(0为不限购)" align="center" width="150"> |
| 151 | - <template slot-scope="scope"> | |
| 151 | + <template v-slot="scope"> | |
| 152 | 152 | <el-input-number v-model="scope.row.limitBuyCount" size="mini" :min="0" :max="10000"> |
| 153 | 153 | </el-input-number> |
| 154 | 154 | </template> |
| 155 | 155 | </el-table-column> |
| 156 | 156 | <el-table-column label="秒杀价(元)" align="center" width="150"> |
| 157 | - <template slot-scope="scope"> | |
| 157 | + <template v-slot="scope"> | |
| 158 | 158 | <el-input-number v-model="scope.row.seckillPrice" size="mini" :precision="2" :min="0" |
| 159 | 159 | :max="10000"> |
| 160 | 160 | </el-input-number> |
| 161 | 161 | </template> |
| 162 | 162 | </el-table-column> |
| 163 | 163 | <el-table-column label="秒杀库存" align="center" width="150" prop="seckillStock"> |
| 164 | - <template slot-scope="scope"> | |
| 164 | + <template v-slot="scope"> | |
| 165 | 165 | <el-input-number v-model="scope.row.seckillStock" size="mini" :min="0" :max="10000"> |
| 166 | 166 | </el-input-number> |
| 167 | 167 | </template> |
| 168 | 168 | </el-table-column> |
| 169 | 169 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 170 | - <template slot-scope="scope"> | |
| 170 | + <template v-slot="scope"> | |
| 171 | 171 | <el-button size="mini" type="text" icon="el-icon-delete" |
| 172 | 172 | @click="removeFormSku(scope.row.skuId)">删除 |
| 173 | 173 | </el-button> | ... | ... |
yudao-ui-admin/src/views/mall/promotion/seckill/seckillTime/index.vue
| ... | ... | @@ -14,23 +14,23 @@ |
| 14 | 14 | <el-table v-loading="loading" :data="list"> |
| 15 | 15 | <el-table-column label="秒杀时段名称" align="center" prop="name" /> |
| 16 | 16 | <el-table-column label="开始时间点" align="center" prop="startTime" width="180"> |
| 17 | - <template slot-scope="scope"> | |
| 17 | + <template v-slot="scope"> | |
| 18 | 18 | <span>{{ scope.row.startTime }}</span> |
| 19 | 19 | </template> |
| 20 | 20 | </el-table-column> |
| 21 | 21 | <el-table-column label="结束时间点" align="center" prop="endTime" width="180"> |
| 22 | - <template slot-scope="scope"> | |
| 22 | + <template v-slot="scope"> | |
| 23 | 23 | <span>{{ scope.row.endTime }}</span> |
| 24 | 24 | </template> |
| 25 | 25 | </el-table-column> |
| 26 | 26 | <el-table-column label="秒杀活动数量" align="center" prop="seckillActivityCount" /> |
| 27 | 27 | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
| 28 | - <template slot-scope="scope"> | |
| 28 | + <template v-slot="scope"> | |
| 29 | 29 | <span>{{ parseTime(scope.row.createTime) }}</span> |
| 30 | 30 | </template> |
| 31 | 31 | </el-table-column> |
| 32 | 32 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 33 | - <template slot-scope="scope"> | |
| 33 | + <template v-slot="scope"> | |
| 34 | 34 | <el-button size="mini" type="text" icon="el-icon-view" @click="handleOpenSeckillActivity(scope.row)"> |
| 35 | 35 | 查看秒杀活动</el-button> |
| 36 | 36 | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" | ... | ... |
yudao-ui-admin/src/views/mall/trade/afterSale/index.vue
| ... | ... | @@ -57,7 +57,7 @@ |
| 57 | 57 | <el-table-column label="订单编号" align="center" prop="orderNo" /> <!-- TODO 芋艿:未来要加个订单链接 --> |
| 58 | 58 | <el-table-column label="商品信息" align="center" prop="spuName" width="auto" min-width="300"> |
| 59 | 59 | <!-- TODO @小红:样式不太对,辛苦改改 --> |
| 60 | -<!-- <div slot-scope="{ row }" class="goods-info">--> | |
| 60 | +<!-- <div v-slot="{ row }" class="goods-info">--> | |
| 61 | 61 | <!-- <img :src="row.picUrl"/>--> |
| 62 | 62 | <!-- <span class="ellipsis-2" :title="row.name">{{row.name}}</span>--> |
| 63 | 63 | <!-- </div>--> | ... | ... |
yudao-ui-admin/src/views/mall/trade/order/detail.vue
| ... | ... | @@ -56,25 +56,25 @@ |
| 56 | 56 | <el-descriptions-item labelClassName="no-colon"> |
| 57 | 57 | <el-table :data="order.items" border> |
| 58 | 58 | <el-table-column prop="spuName" label="商品" width="700"> |
| 59 | - <template slot-scope="{ row }"> | |
| 59 | + <template v-slot="{ row }"> | |
| 60 | 60 | {{row.spuName}} |
| 61 | 61 | <el-tag size="medium" v-for="property in row.properties" :key="property.propertyId"> |
| 62 | 62 | {{property.propertyName}}:{{property.valueName}}</el-tag> |
| 63 | 63 | </template> |
| 64 | 64 | </el-table-column> |
| 65 | 65 | <el-table-column prop="originalUnitPrice" label="单价(元)" width="180"> |
| 66 | - <template slot-scope="{ row }"> | |
| 66 | + <template v-slot="{ row }"> | |
| 67 | 67 | ¥{{ (row.originalUnitPrice / 100.0).toFixed(2) }} |
| 68 | 68 | </template> |
| 69 | 69 | </el-table-column> |
| 70 | 70 | <el-table-column prop="count" label="数量" width="180"/> |
| 71 | 71 | <el-table-column prop="originalPrice" label="小计(元)" width="180"> |
| 72 | - <template slot-scope="{ row }"> | |
| 72 | + <template v-slot="{ row }"> | |
| 73 | 73 | ¥{{ (row.originalPrice / 100.0).toFixed(2) }} |
| 74 | 74 | </template> |
| 75 | 75 | </el-table-column> |
| 76 | 76 | <el-table-column prop="afterSaleStatus" label="退款状态"> |
| 77 | - <template slot-scope="{ row }"> | |
| 77 | + <template v-slot="{ row }"> | |
| 78 | 78 | <dict-tag :type="DICT_TYPE.TRADE_ORDER_ITEM_AFTER_SALE_STATUS" :value="row.afterSaleStatus" /> |
| 79 | 79 | </template> |
| 80 | 80 | </el-table-column> | ... | ... |
yudao-ui-admin/src/views/mall/trade/order/index.vue
| ... | ... | @@ -71,7 +71,7 @@ |
| 71 | 71 | <!-- 列表 --> |
| 72 | 72 | <el-table v-loading="loading" :data="list" :show-header="false" class="order-table"> |
| 73 | 73 | <el-table-column> |
| 74 | - <template slot-scope="{ row }"> | |
| 74 | + <template v-slot="{ row }"> | |
| 75 | 75 | <el-row type="flex" align="middle"> |
| 76 | 76 | <el-col :span="5"> |
| 77 | 77 | 订单号:{{row.no}} |
| ... | ... | @@ -94,7 +94,7 @@ |
| 94 | 94 | <!-- 订单下的商品 --> |
| 95 | 95 | <el-table :data="row.items" border :show-header="true"> |
| 96 | 96 | <el-table-column label="商品" prop="goods" header-align="center" width="auto" min-width="300"> |
| 97 | - <template slot-scope="{ row, $index }"> | |
| 97 | + <template v-slot="{ row, $index }"> | |
| 98 | 98 | <div class="goods-info"> |
| 99 | 99 | <img :src="row.picUrl"/> |
| 100 | 100 | <span class="ellipsis-2" :title="row.spuName">{{row.spuName}}</span> |
| ... | ... | @@ -105,7 +105,7 @@ |
| 105 | 105 | </template> |
| 106 | 106 | </el-table-column> |
| 107 | 107 | <el-table-column label="单价(元)/数量" prop="fee" align="center" width="115"> |
| 108 | - <template slot-scope="{ row }"> | |
| 108 | + <template v-slot="{ row }"> | |
| 109 | 109 | <div>¥{{ (row.originalUnitPrice / 100.0).toFixed(2) }}</div> |
| 110 | 110 | <div>{{row.count}} 件</div> |
| 111 | 111 | </template> |
| ... | ... | @@ -114,7 +114,7 @@ |
| 114 | 114 | <el-table-column label="实付金额(元)" prop="amount" align="center" width="100"/> |
| 115 | 115 | <!-- TODO @小程:这里应该是一个订单下,多个商品,只展示订单上的收件信息;使用 order.receiverXXX 开头的字段 --> |
| 116 | 116 | <el-table-column label="买家/收货人" prop="buyer" header-align="center" width="auto" min-width="300"> |
| 117 | - <template slot-scope="{ row }"> | |
| 117 | + <template v-slot="{ row }"> | |
| 118 | 118 | <!-- TODO @芋艿:以后增加一个会员详情界面 --> |
| 119 | 119 | <div>{{row.buyer}}</div> |
| 120 | 120 | <div>{{row.receiver}}{{row.tel}}</div> | ... | ... |
yudao-ui-admin/src/views/mp/account/index.vue
| 1 | 1 | <template> |
| 2 | 2 | <div class="app-container"> |
| 3 | + <doc-alert title="公众号接入" url="https://doc.iocoder.cn/mp/account/" /> | |
| 3 | 4 | |
| 4 | 5 | <!-- 搜索工作栏 --> |
| 5 | 6 | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| ... | ... | @@ -43,12 +44,12 @@ |
| 43 | 44 | </el-table-column> |
| 44 | 45 | <el-table-column label="备注" align="center" prop="remark"/> |
| 45 | 46 | <!-- <el-table-column label="创建时间" align="center" prop="createTime" width="180">--> |
| 46 | -<!-- <template slot-scope="scope">--> | |
| 47 | +<!-- <template v-slot="scope">--> | |
| 47 | 48 | <!-- <span>{{ parseTime(scope.row.createTime) }}</span>--> |
| 48 | 49 | <!-- </template>--> |
| 49 | 50 | <!-- </el-table-column>--> |
| 50 | 51 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 51 | - <template slot-scope="scope"> | |
| 52 | + <template v-slot="scope"> | |
| 52 | 53 | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" |
| 53 | 54 | v-hasPermi="['mp:account:update']">修改 |
| 54 | 55 | </el-button> | ... | ... |
yudao-ui-admin/src/views/mp/autoReply/index.vue
| ... | ... | @@ -26,6 +26,8 @@ SOFTWARE. |
| 26 | 26 | --> |
| 27 | 27 | <template> |
| 28 | 28 | <div class="app-container"> |
| 29 | + <doc-alert title="自动回复" url="https://doc.iocoder.cn/mp/auto-reply/" /> | |
| 30 | + | |
| 29 | 31 | <!-- 搜索工作栏 --> |
| 30 | 32 | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| 31 | 33 | <el-form-item label="公众号" prop="accountId"> |
| ... | ... | @@ -77,7 +79,7 @@ SOFTWARE. |
| 77 | 79 | </template> |
| 78 | 80 | </el-table-column> |
| 79 | 81 | <el-table-column label="回复内容" align="center"> |
| 80 | - <template slot-scope="scope"> | |
| 82 | + <template v-slot="scope"> | |
| 81 | 83 | <div v-if="scope.row.responseMessageType === 'text'">{{ scope.row.responseContent }}</div> |
| 82 | 84 | <div v-else-if="scope.row.responseMessageType === 'voice'"> |
| 83 | 85 | <wx-voice-player :url="scope.row.responseMediaUrl" /> |
| ... | ... | @@ -101,12 +103,12 @@ SOFTWARE. |
| 101 | 103 | </template> |
| 102 | 104 | </el-table-column> |
| 103 | 105 | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
| 104 | - <template slot-scope="scope"> | |
| 106 | + <template v-slot="scope"> | |
| 105 | 107 | <span>{{ parseTime(scope.row.createTime) }}</span> |
| 106 | 108 | </template> |
| 107 | 109 | </el-table-column> |
| 108 | 110 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 109 | - <template slot-scope="scope"> | |
| 111 | + <template v-slot="scope"> | |
| 110 | 112 | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" |
| 111 | 113 | v-hasPermi="['mp:auto-reply:update']">修改 |
| 112 | 114 | </el-button> | ... | ... |
yudao-ui-admin/src/views/mp/components/wx-msg/main.vue
| ... | ... | @@ -110,7 +110,7 @@ import { getMessagePage, sendMessage } from '@/api/mp/message' |
| 110 | 110 | import WxNews from '@/views/mp/components/wx-news/main.vue'; |
| 111 | 111 | import WxLocation from '@/views/mp/components/wx-location/main.vue'; |
| 112 | 112 | import WxMusic from '@/views/mp/components/wx-music/main.vue'; |
| 113 | -import { getUser } from "@/api/mp/user"; | |
| 113 | +import { getUser } from "@/api/mp/mpuser"; | |
| 114 | 114 | |
| 115 | 115 | export default { |
| 116 | 116 | name: "wxMsg", | ... | ... |
yudao-ui-admin/src/views/mp/draft/index.vue
| ... | ... | @@ -27,6 +27,8 @@ SOFTWARE. |
| 27 | 27 | --> |
| 28 | 28 | <template> |
| 29 | 29 | <div class="app-container"> |
| 30 | + <doc-alert title="公众号图文" url="https://doc.iocoder.cn/mp/article/" /> | |
| 31 | + | |
| 30 | 32 | <!-- 搜索工作栏 --> |
| 31 | 33 | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| 32 | 34 | <el-form-item label="公众号" prop="accountId"> | ... | ... |
yudao-ui-admin/src/views/mp/freePublish/index.vue
| ... | ... | @@ -25,6 +25,8 @@ SOFTWARE. |
| 25 | 25 | --> |
| 26 | 26 | <template> |
| 27 | 27 | <div class="app-container"> |
| 28 | + <doc-alert title="公众号图文" url="https://doc.iocoder.cn/mp/article/" /> | |
| 29 | + | |
| 28 | 30 | <!-- 搜索工作栏 --> |
| 29 | 31 | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| 30 | 32 | <el-form-item label="公众号" prop="accountId"> | ... | ... |
yudao-ui-admin/src/views/mp/material/index.vue
| ... | ... | @@ -27,6 +27,8 @@ SOFTWARE. |
| 27 | 27 | --> |
| 28 | 28 | <template> |
| 29 | 29 | <div class="app-container"> |
| 30 | + <doc-alert title="公众号素材" url="https://doc.iocoder.cn/mp/material/" /> | |
| 31 | + | |
| 30 | 32 | <!-- 搜索工作栏 --> |
| 31 | 33 | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| 32 | 34 | <el-form-item label="公众号" prop="accountId"> |
| ... | ... | @@ -92,7 +94,7 @@ SOFTWARE. |
| 92 | 94 | </template> |
| 93 | 95 | </el-table-column> |
| 94 | 96 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 95 | - <template slot-scope="scope"> | |
| 97 | + <template v-slot="scope"> | |
| 96 | 98 | <el-button type="text" icon="el-icon-download" size="small" plain @click="handleDownload(scope.row)">下载</el-button> |
| 97 | 99 | <el-button type="text" icon="el-icon-delete" size="small" plain @click="handleDelete(scope.row)" |
| 98 | 100 | v-hasPermi="['mp:material:delete']">删除</el-button> | ... | ... |
yudao-ui-admin/src/views/mp/menu/index.vue
| ... | ... | @@ -26,6 +26,8 @@ SOFTWARE. |
| 26 | 26 | --> |
| 27 | 27 | <template> |
| 28 | 28 | <div class="app-container"> |
| 29 | + <doc-alert title="公众号菜单" url="https://doc.iocoder.cn/mp/menu/" /> | |
| 30 | + | |
| 29 | 31 | <!-- 搜索工作栏 --> |
| 30 | 32 | <el-form ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| 31 | 33 | <el-form-item label="公众号" prop="accountId"> | ... | ... |
yudao-ui-admin/src/views/mp/message/index.vue
| 1 | 1 | <template> |
| 2 | 2 | <div class="app-container"> |
| 3 | + <doc-alert title="公众号消息" url="https://doc.iocoder.cn/mp/message/" /> | |
| 3 | 4 | |
| 4 | 5 | <!-- 搜索工作栏 --> |
| 5 | 6 | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| ... | ... | @@ -36,20 +37,20 @@ |
| 36 | 37 | <!-- 列表 --> |
| 37 | 38 | <el-table v-loading="loading" :data="list"> |
| 38 | 39 | <el-table-column label="发送时间" align="center" prop="createTime" width="180"> |
| 39 | - <template slot-scope="scope"> | |
| 40 | + <template v-slot="scope"> | |
| 40 | 41 | <span>{{ parseTime(scope.row.createTime) }}</span> |
| 41 | 42 | </template> |
| 42 | 43 | </el-table-column> |
| 43 | 44 | <el-table-column label="消息类型" align="center" prop="type" width="80"/> |
| 44 | 45 | <el-table-column label="发送方" align="center" prop="sendFrom" width="80"> |
| 45 | - <template slot-scope="scope"> | |
| 46 | + <template v-slot="scope"> | |
| 46 | 47 | <el-tag v-if="scope.row.sendFrom === 1" type="success">粉丝</el-tag> |
| 47 | 48 | <el-tag v-else type="info">公众号</el-tag> |
| 48 | 49 | </template> |
| 49 | 50 | </el-table-column> |
| 50 | 51 | <el-table-column label="用户标识" align="center" prop="openid" width="300" /> |
| 51 | 52 | <el-table-column label="内容" prop="content"> |
| 52 | - <template slot-scope="scope"> | |
| 53 | + <template v-slot="scope"> | |
| 53 | 54 | <!-- 【事件】区域 --> |
| 54 | 55 | <div v-if="scope.row.type === 'event' && scope.row.event === 'subscribe'"> |
| 55 | 56 | <el-tag type="success" size="mini">关注</el-tag> |
| ... | ... | @@ -117,7 +118,7 @@ |
| 117 | 118 | </template> |
| 118 | 119 | </el-table-column> |
| 119 | 120 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 120 | - <template slot-scope="scope"> | |
| 121 | + <template v-slot="scope"> | |
| 121 | 122 | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleSend(scope.row)" |
| 122 | 123 | v-hasPermi="['mp:message:send']">消息 |
| 123 | 124 | </el-button> | ... | ... |
yudao-ui-admin/src/views/mp/user/index.vue renamed to yudao-ui-admin/src/views/mp/mpuser/index.vue
| 1 | 1 | <template> |
| 2 | 2 | <div class="app-container"> |
| 3 | + <doc-alert title="公众号粉丝" url="https://doc.iocoder.cn/mp/user/" /> | |
| 3 | 4 | |
| 4 | 5 | <!-- 搜索工作栏 --> |
| 5 | 6 | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| ... | ... | @@ -37,25 +38,25 @@ |
| 37 | 38 | <el-table-column label="昵称" align="center" prop="nickname" /> |
| 38 | 39 | <el-table-column label="备注" align="center" prop="remark" /> |
| 39 | 40 | <el-table-column label="标签" align="center" prop="tagIds" width="200"> |
| 40 | - <template slot-scope="scope"> | |
| 41 | + <template v-slot="scope"> | |
| 41 | 42 | <span v-for="(tagId, index) in scope.row.tagIds" :key="index"> |
| 42 | 43 | <el-tag>{{ tags.find(tag => tag.tagId === tagId)?.name }} </el-tag> |
| 43 | 44 | </span> |
| 44 | 45 | </template> |
| 45 | 46 | </el-table-column> |
| 46 | 47 | <el-table-column label="订阅状态" align="center" prop="subscribeStatus"> |
| 47 | - <template slot-scope="scope"> | |
| 48 | + <template v-slot="scope"> | |
| 48 | 49 | <el-tag v-if="scope.row.subscribeStatus === 0" type="success">已订阅</el-tag> |
| 49 | 50 | <el-tag v-else type="danger">未订阅</el-tag> |
| 50 | 51 | </template> |
| 51 | 52 | </el-table-column> |
| 52 | 53 | <el-table-column label="订阅时间" align="center" prop="subscribeTime" width="180"> |
| 53 | - <template slot-scope="scope"> | |
| 54 | + <template v-slot="scope"> | |
| 54 | 55 | <span>{{ parseTime(scope.row.subscribeTime) }}</span> |
| 55 | 56 | </template> |
| 56 | 57 | </el-table-column> |
| 57 | 58 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 58 | - <template slot-scope="scope"> | |
| 59 | + <template v-slot="scope"> | |
| 59 | 60 | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" |
| 60 | 61 | v-hasPermi="['mp:user:update']">修改</el-button> |
| 61 | 62 | </template> |
| ... | ... | @@ -89,7 +90,7 @@ |
| 89 | 90 | </template> |
| 90 | 91 | |
| 91 | 92 | <script> |
| 92 | -import { updateUser, getUser, getUserPage, syncUser } from "@/api/mp/user"; | |
| 93 | +import { updateUser, getUser, getUserPage, syncUser } from "@/api/mp/mpuser"; | |
| 93 | 94 | import { getSimpleAccounts } from "@/api/mp/account"; |
| 94 | 95 | import { getSimpleTags } from "@/api/mp/tag"; |
| 95 | 96 | ... | ... |
yudao-ui-admin/src/views/mp/statistics/index.vue
yudao-ui-admin/src/views/mp/tag/index.vue
| 1 | 1 | <template> |
| 2 | 2 | <div class="app-container"> |
| 3 | + <doc-alert title="公众号标签" url="https://doc.iocoder.cn/mp/tag/" /> | |
| 4 | + | |
| 3 | 5 | <!-- 搜索工作栏 --> |
| 4 | 6 | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> |
| 5 | 7 | <el-form-item label="公众号" prop="accountId"> |
| ... | ... | @@ -37,12 +39,12 @@ |
| 37 | 39 | <el-table-column label="标签名称" align="center" prop="name"/> |
| 38 | 40 | <el-table-column label="粉丝数" align="center" prop="count"/> |
| 39 | 41 | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
| 40 | - <template slot-scope="scope"> | |
| 42 | + <template v-slot="scope"> | |
| 41 | 43 | <span>{{ parseTime(scope.row.createTime) }}</span> |
| 42 | 44 | </template> |
| 43 | 45 | </el-table-column> |
| 44 | 46 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 45 | - <template slot-scope="scope"> | |
| 47 | + <template v-slot="scope"> | |
| 46 | 48 | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" |
| 47 | 49 | v-hasPermi="['mp:tag:update']">修改 |
| 48 | 50 | </el-button> | ... | ... |
yudao-ui-admin/src/views/system/mail/account/index.vue
0 → 100755
| 1 | +<template> | |
| 2 | + <div class="app-container"> | |
| 3 | + <doc-alert title="邮件配置" url="https://doc.iocoder.cn/mail" /> | |
| 4 | + | |
| 5 | + <!-- 搜索工作栏 --> | |
| 6 | + <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> | |
| 7 | + <el-form-item label="邮箱" prop="mail"> | |
| 8 | + <el-input v-model="queryParams.mail" placeholder="请输入邮箱" clearable @keyup.enter.native="handleQuery"/> | |
| 9 | + </el-form-item> | |
| 10 | + <el-form-item label="用户名" prop="username"> | |
| 11 | + <el-input v-model="queryParams.username" placeholder="请输入用户名" clearable @keyup.enter.native="handleQuery"/> | |
| 12 | + </el-form-item> | |
| 13 | + <el-form-item> | |
| 14 | + <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> | |
| 15 | + <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> | |
| 16 | + </el-form-item> | |
| 17 | + </el-form> | |
| 18 | + | |
| 19 | + <!-- 操作工具栏 --> | |
| 20 | + <el-row :gutter="10" class="mb8"> | |
| 21 | + <el-col :span="1.5"> | |
| 22 | + <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" | |
| 23 | + v-hasPermi="['system:mail-account:create']">新增</el-button> | |
| 24 | + </el-col> | |
| 25 | + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | |
| 26 | + </el-row> | |
| 27 | + | |
| 28 | + <!-- 列表 --> | |
| 29 | + <el-table v-loading="loading" :data="list"> | |
| 30 | + <el-table-column label="编号" align="center" prop="id" /> | |
| 31 | + <el-table-column label="邮箱" align="center" prop="mail" /> | |
| 32 | + <el-table-column label="用户名" align="center" prop="username" /> | |
| 33 | + <el-table-column label="SMTP 服务器域名" align="center" prop="host" /> | |
| 34 | + <el-table-column label="SMTP 服务器端口" align="center" prop="port" /> | |
| 35 | + <el-table-column label="是否开启 SSL" align="center" prop="sslEnable"> | |
| 36 | + <template v-slot="scope"> | |
| 37 | + <dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.sslEnable" /> | |
| 38 | + </template> | |
| 39 | + </el-table-column> | |
| 40 | + <el-table-column label="创建时间" align="center" prop="createTime" width="180"> | |
| 41 | + <template v-slot="scope"> | |
| 42 | + <span>{{ parseTime(scope.row.createTime) }}</span> | |
| 43 | + </template> | |
| 44 | + </el-table-column> | |
| 45 | + <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | |
| 46 | + <template v-slot="scope"> | |
| 47 | + <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" | |
| 48 | + v-hasPermi="['system:mail-account:update']">修改</el-button> | |
| 49 | + <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" | |
| 50 | + v-hasPermi="['system:mail-account:delete']">删除</el-button> | |
| 51 | + </template> | |
| 52 | + </el-table-column> | |
| 53 | + </el-table> | |
| 54 | + <!-- 分页组件 --> | |
| 55 | + <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" | |
| 56 | + @pagination="getList"/> | |
| 57 | + | |
| 58 | + <!-- 对话框(添加 / 修改) --> | |
| 59 | + <el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body> | |
| 60 | + <el-form ref="form" :model="form" :rules="rules" label-width="140px"> | |
| 61 | + <el-form-item label="邮箱" prop="mail"> | |
| 62 | + <el-input v-model="form.mail" placeholder="请输入邮箱" /> | |
| 63 | + </el-form-item> | |
| 64 | + <el-form-item label="用户名" prop="username"> | |
| 65 | + <el-input v-model="form.username" placeholder="请输入用户名,一般和邮箱一致" /> | |
| 66 | + </el-form-item> | |
| 67 | + <el-form-item label="密码" prop="password"> | |
| 68 | + <el-input v-model="form.password" placeholder="请输入密码" /> | |
| 69 | + </el-form-item> | |
| 70 | + <el-form-item label="SMTP 服务器域名" prop="host"> | |
| 71 | + <el-input v-model="form.host" placeholder="请输入 SMTP 服务器域名" /> | |
| 72 | + </el-form-item> | |
| 73 | + <el-form-item label="SMTP 服务器端口" prop="port"> | |
| 74 | + <el-input v-model="form.port" placeholder="请输入 SMTP 服务器端口" /> | |
| 75 | + </el-form-item> | |
| 76 | + <el-form-item label="是否开启 SSL" prop="sslEnable"> | |
| 77 | + <el-radio-group v-model="form.sslEnable"> | |
| 78 | + <el-radio v-for="dict in this.getDictDatas(DICT_TYPE.INFRA_BOOLEAN_STRING)" | |
| 79 | + :key="dict.value" :label="dict.value === 'true'">{{dict.label}}</el-radio> | |
| 80 | + </el-radio-group> | |
| 81 | + </el-form-item> | |
| 82 | + </el-form> | |
| 83 | + <div slot="footer" class="dialog-footer"> | |
| 84 | + <el-button type="primary" @click="submitForm">确 定</el-button> | |
| 85 | + <el-button @click="cancel">取 消</el-button> | |
| 86 | + </div> | |
| 87 | + </el-dialog> | |
| 88 | + </div> | |
| 89 | +</template> | |
| 90 | + | |
| 91 | +<script> | |
| 92 | +import { createMailAccount, updateMailAccount, deleteMailAccount, getMailAccount, getMailAccountPage } from "@/api/system/mail/account"; | |
| 93 | + | |
| 94 | +export default { | |
| 95 | + name: "MailAccount", | |
| 96 | + components: { | |
| 97 | + }, | |
| 98 | + data() { | |
| 99 | + return { | |
| 100 | + // 遮罩层 | |
| 101 | + loading: true, | |
| 102 | + // 显示搜索条件 | |
| 103 | + showSearch: true, | |
| 104 | + // 总条数 | |
| 105 | + total: 0, | |
| 106 | + // 邮箱账号列表 | |
| 107 | + list: [], | |
| 108 | + // 弹出层标题 | |
| 109 | + title: "", | |
| 110 | + // 是否显示弹出层 | |
| 111 | + open: false, | |
| 112 | + // 查询参数 | |
| 113 | + queryParams: { | |
| 114 | + pageNo: 1, | |
| 115 | + pageSize: 10, | |
| 116 | + mail: null, | |
| 117 | + username: null | |
| 118 | + }, | |
| 119 | + // 表单参数 | |
| 120 | + form: {}, | |
| 121 | + // 表单校验 | |
| 122 | + rules: { | |
| 123 | + mail: [{ required: true, message: "邮箱不能为空", trigger: "blur" }], | |
| 124 | + username: [{ required: true, message: "用户名不能为空", trigger: "blur" }], | |
| 125 | + password: [{ required: true, message: "密码不能为空", trigger: "blur" }], | |
| 126 | + host: [{ required: true, message: "SMTP 服务器域名不能为空", trigger: "blur" }], | |
| 127 | + port: [{ required: true, message: "SMTP 服务器端口不能为空", trigger: "blur" }], | |
| 128 | + sslEnable: [{ required: true, message: "是否开启 SSL不能为空", trigger: "blur" }], | |
| 129 | + }, | |
| 130 | + }; | |
| 131 | + }, | |
| 132 | + created() { | |
| 133 | + this.getList(); | |
| 134 | + }, | |
| 135 | + methods: { | |
| 136 | + /** 查询列表 */ | |
| 137 | + getList() { | |
| 138 | + this.loading = true; | |
| 139 | + // 执行查询 | |
| 140 | + getMailAccountPage(this.queryParams).then(response => { | |
| 141 | + this.list = response.data.list; | |
| 142 | + this.total = response.data.total; | |
| 143 | + this.loading = false; | |
| 144 | + }); | |
| 145 | + }, | |
| 146 | + /** 取消按钮 */ | |
| 147 | + cancel() { | |
| 148 | + this.open = false; | |
| 149 | + this.reset(); | |
| 150 | + }, | |
| 151 | + /** 表单重置 */ | |
| 152 | + reset() { | |
| 153 | + this.form = { | |
| 154 | + id: undefined, | |
| 155 | + mail: undefined, | |
| 156 | + username: undefined, | |
| 157 | + password: undefined, | |
| 158 | + host: undefined, | |
| 159 | + port: undefined, | |
| 160 | + sslEnable: true, | |
| 161 | + }; | |
| 162 | + this.resetForm("form"); | |
| 163 | + }, | |
| 164 | + /** 搜索按钮操作 */ | |
| 165 | + handleQuery() { | |
| 166 | + this.queryParams.pageNo = 1; | |
| 167 | + this.getList(); | |
| 168 | + }, | |
| 169 | + /** 重置按钮操作 */ | |
| 170 | + resetQuery() { | |
| 171 | + this.resetForm("queryForm"); | |
| 172 | + this.handleQuery(); | |
| 173 | + }, | |
| 174 | + /** 新增按钮操作 */ | |
| 175 | + handleAdd() { | |
| 176 | + this.reset(); | |
| 177 | + this.open = true; | |
| 178 | + this.title = "添加邮箱账号"; | |
| 179 | + }, | |
| 180 | + /** 修改按钮操作 */ | |
| 181 | + handleUpdate(row) { | |
| 182 | + this.reset(); | |
| 183 | + const id = row.id; | |
| 184 | + getMailAccount(id).then(response => { | |
| 185 | + this.form = response.data; | |
| 186 | + this.open = true; | |
| 187 | + this.title = "修改邮箱账号"; | |
| 188 | + }); | |
| 189 | + }, | |
| 190 | + /** 提交按钮 */ | |
| 191 | + submitForm() { | |
| 192 | + this.$refs["form"].validate(valid => { | |
| 193 | + if (!valid) { | |
| 194 | + return; | |
| 195 | + } | |
| 196 | + // 修改的提交 | |
| 197 | + if (this.form.id != null) { | |
| 198 | + updateMailAccount(this.form).then(response => { | |
| 199 | + this.$modal.msgSuccess("修改成功"); | |
| 200 | + this.open = false; | |
| 201 | + this.getList(); | |
| 202 | + }); | |
| 203 | + return; | |
| 204 | + } | |
| 205 | + // 添加的提交 | |
| 206 | + createMailAccount(this.form).then(response => { | |
| 207 | + this.$modal.msgSuccess("新增成功"); | |
| 208 | + this.open = false; | |
| 209 | + this.getList(); | |
| 210 | + }); | |
| 211 | + }); | |
| 212 | + }, | |
| 213 | + /** 删除按钮操作 */ | |
| 214 | + handleDelete(row) { | |
| 215 | + const id = row.id; | |
| 216 | + this.$modal.confirm('是否确认删除邮箱账号编号为"' + id + '"的数据项?').then(function() { | |
| 217 | + return deleteMailAccount(id); | |
| 218 | + }).then(() => { | |
| 219 | + this.getList(); | |
| 220 | + this.$modal.msgSuccess("删除成功"); | |
| 221 | + }).catch(() => {}); | |
| 222 | + } | |
| 223 | + } | |
| 224 | +}; | |
| 225 | +</script> | ... | ... |
yudao-ui-admin/src/views/system/mail/log/index.vue
0 → 100755
| 1 | +<template> | |
| 2 | + <div class="app-container"> | |
| 3 | + <doc-alert title="邮件配置" url="https://doc.iocoder.cn/mail" /> | |
| 4 | + | |
| 5 | + <!-- 搜索工作栏 --> | |
| 6 | + <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> | |
| 7 | + <el-form-item label="接收邮箱" prop="toMail"> | |
| 8 | + <el-input v-model="queryParams.toMail" placeholder="请输入接收邮箱" clearable @keyup.enter.native="handleQuery"/> | |
| 9 | + </el-form-item> | |
| 10 | + <el-form-item label="邮箱账号" prop="accountId"> | |
| 11 | + <el-select v-model="queryParams.accountId" placeholder="请输入邮箱账号" clearable> | |
| 12 | + <el-option v-for="account in accountOptions" :key="account.id" :value="account.id" :label="account.mail" /> | |
| 13 | + </el-select> | |
| 14 | + </el-form-item> | |
| 15 | + <el-form-item label="模板编号" prop="templateId"> | |
| 16 | + <el-input v-model="queryParams.templateId" placeholder="请输入模板编号" clearable @keyup.enter.native="handleQuery"/> | |
| 17 | + </el-form-item> | |
| 18 | + <el-form-item label="发送状态" prop="sendStatus"> | |
| 19 | + <el-select v-model="queryParams.sendStatus" placeholder="请选择发送状态" clearable size="small"> | |
| 20 | + <el-option v-for="dict in this.getDictDatas(DICT_TYPE.SYSTEM_MAIL_SEND_STATUS)" | |
| 21 | + :key="dict.value" :label="dict.label" :value="dict.value"/> | |
| 22 | + </el-select> | |
| 23 | + </el-form-item> | |
| 24 | + <el-form-item label="发送时间" prop="sendTime"> | |
| 25 | + <el-date-picker v-model="queryParams.sendTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange" | |
| 26 | + range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" /> | |
| 27 | + </el-form-item> | |
| 28 | + <el-form-item label="用户编号" prop="userId"> | |
| 29 | + <el-input v-model="queryParams.userId" placeholder="请输入用户编号" clearable @keyup.enter.native="handleQuery"/> | |
| 30 | + </el-form-item> | |
| 31 | + <el-form-item label="用户类型" prop="userType"> | |
| 32 | + <el-select v-model="queryParams.userType" placeholder="请选择用户类型" clearable> | |
| 33 | + <el-option v-for="dict in this.getDictDatas(DICT_TYPE.USER_TYPE)" | |
| 34 | + :key="dict.value" :label="dict.label" :value="dict.value"/> | |
| 35 | + </el-select> | |
| 36 | + </el-form-item> | |
| 37 | + <el-form-item> | |
| 38 | + <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> | |
| 39 | + <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> | |
| 40 | + </el-form-item> | |
| 41 | + </el-form> | |
| 42 | + | |
| 43 | + <!-- 操作工具栏 --> | |
| 44 | + <el-row :gutter="10" class="mb8"> | |
| 45 | + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | |
| 46 | + </el-row> | |
| 47 | + | |
| 48 | + <!-- 列表 --> | |
| 49 | + <el-table v-loading="loading" :data="list"> | |
| 50 | + <el-table-column label="编号" align="center" prop="id" /> | |
| 51 | + <el-table-column label="发送时间" align="center" prop="sendTime" width="180"> | |
| 52 | + <template v-slot="scope"> | |
| 53 | + <span>{{ parseTime(scope.row.sendTime) }}</span> | |
| 54 | + </template> | |
| 55 | + </el-table-column> | |
| 56 | + <el-table-column label="接收邮箱" align="center" prop="toMail" width="200"> | |
| 57 | + <template v-slot="scope"> | |
| 58 | + <div>{{ scope.row.toMail }}</div> | |
| 59 | + <div v-if="scope.row.userType && scope.row.userId"> | |
| 60 | + <dict-tag :type="DICT_TYPE.USER_TYPE" :value="scope.row.userType"/>{{ '(' + scope.row.userId + ')' }} | |
| 61 | + </div> | |
| 62 | + </template> | |
| 63 | + </el-table-column> | |
| 64 | + <el-table-column label="邮件标题" align="center" prop="templateTitle" /> | |
| 65 | + <el-table-column label="发送状态" align="center" prop="sendStatus"> | |
| 66 | + <template v-slot="scope"> | |
| 67 | + <dict-tag :type="DICT_TYPE.SYSTEM_MAIL_SEND_STATUS" :value="scope.row.sendStatus" /> | |
| 68 | + </template> | |
| 69 | + </el-table-column> | |
| 70 | + <el-table-column label="邮箱账号" align="center" prop="fromMail" /> | |
| 71 | + <el-table-column label="模板编号" align="center" prop="templateId" /> | |
| 72 | + <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | |
| 73 | + <template v-slot="scope"> | |
| 74 | + <el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)" | |
| 75 | + v-hasPermi="['system:mail-log:query']">详细</el-button> | |
| 76 | + </template> | |
| 77 | + </el-table-column> | |
| 78 | + </el-table> | |
| 79 | + <!-- 分页组件 --> | |
| 80 | + <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" | |
| 81 | + @pagination="getList"/> | |
| 82 | + | |
| 83 | + <!-- 邮件日志详细--> | |
| 84 | + <el-dialog :title="title" :visible.sync="open" width="700px" v-dialogDrag append-to-body> | |
| 85 | + <el-form ref="form" :model="form" label-width="160px"> | |
| 86 | + <el-row> | |
| 87 | + <el-col :span="24"> | |
| 88 | + <el-form-item label="日志主键:">{{ form.id }}</el-form-item> | |
| 89 | + <el-form-item label="用户编号:">{{ form.userId }}</el-form-item> | |
| 90 | + <el-form-item label="用户类型:"> | |
| 91 | + <dict-tag :type="DICT_TYPE.USER_TYPE" :value="form.userType"/> | |
| 92 | + </el-form-item> | |
| 93 | + <el-form-item label="接收邮箱地址:">{{ form.toMail }}</el-form-item> | |
| 94 | + <el-form-item label="邮箱账号编号:">{{ form.accountId }}</el-form-item> | |
| 95 | + <el-form-item label="发送邮箱地址:">{{ form.fromMail }}</el-form-item> | |
| 96 | + <el-form-item label="模板编号:">{{ form.templateId }}</el-form-item> | |
| 97 | + <el-form-item label="模板编码:">{{ form.templateCode }}</el-form-item> | |
| 98 | + <el-form-item label="模版发送人名称:">{{ form.templateNickname }}</el-form-item> | |
| 99 | + <el-form-item label="邮件标题:">{{ form.templateTitle }}</el-form-item> | |
| 100 | + <el-form-item label="邮件内容:"> | |
| 101 | + <editor v-model="form.templateContent" :min-height="192" read-only /> | |
| 102 | + </el-form-item> | |
| 103 | + <el-form-item label="邮件参数:">{{ form.templateParams }}</el-form-item> | |
| 104 | + <el-form-item label="发送状态:"> | |
| 105 | + <dict-tag :type="DICT_TYPE.SYSTEM_MAIL_SEND_STATUS" :value="form.sendStatus" /> | |
| 106 | + </el-form-item> | |
| 107 | + <el-form-item label="发送时间:">{{ parseTime(form.sendTime) }}</el-form-item> | |
| 108 | + <el-form-item label="发送返回的消息编号:">{{ form.sendMessageId }}</el-form-item> | |
| 109 | + <el-form-item label="发送异常:">{{ form.sendException }}</el-form-item> | |
| 110 | + </el-col> | |
| 111 | + </el-row> | |
| 112 | + </el-form> | |
| 113 | + <div slot="footer" class="dialog-footer"> | |
| 114 | + <el-button @click="open = false">关 闭</el-button> | |
| 115 | + </div> | |
| 116 | + </el-dialog> | |
| 117 | + </div> | |
| 118 | +</template> | |
| 119 | + | |
| 120 | +<script> | |
| 121 | +import { getMailLog, getMailLogPage } from "@/api/system/mail/log"; | |
| 122 | +import Editor from '@/components/Editor'; | |
| 123 | +import { getSimpleMailAccountList } from "@/api/system/mail/account"; | |
| 124 | + | |
| 125 | +export default { | |
| 126 | + name: "MailLog", | |
| 127 | + components: { | |
| 128 | + Editor, | |
| 129 | + }, | |
| 130 | + data() { | |
| 131 | + return { | |
| 132 | + // 遮罩层 | |
| 133 | + loading: true, | |
| 134 | + // 导出遮罩层 | |
| 135 | + exportLoading: false, | |
| 136 | + // 显示搜索条件 | |
| 137 | + showSearch: true, | |
| 138 | + // 总条数 | |
| 139 | + total: 0, | |
| 140 | + // 邮件日志列表 | |
| 141 | + list: [], | |
| 142 | + // 弹出层标题 | |
| 143 | + title: "邮件发送日志详细", | |
| 144 | + // 是否显示弹出层 | |
| 145 | + open: false, | |
| 146 | + // 查询参数 | |
| 147 | + queryParams: { | |
| 148 | + pageNo: 1, | |
| 149 | + pageSize: 10, | |
| 150 | + userId: null, | |
| 151 | + userType: null, | |
| 152 | + toMail: null, | |
| 153 | + accountId: null, | |
| 154 | + templateId: null, | |
| 155 | + sendStatus: null, | |
| 156 | + sendTime: [], | |
| 157 | + }, | |
| 158 | + // 表单参数 | |
| 159 | + form: {}, | |
| 160 | + // 邮箱账号 | |
| 161 | + accountOptions: [] | |
| 162 | + }; | |
| 163 | + }, | |
| 164 | + created() { | |
| 165 | + this.getList(); | |
| 166 | + // 获得邮箱账号列表 | |
| 167 | + getSimpleMailAccountList().then(response => { | |
| 168 | + this.accountOptions = response.data | |
| 169 | + }) | |
| 170 | + }, | |
| 171 | + methods: { | |
| 172 | + /** 查询列表 */ | |
| 173 | + getList() { | |
| 174 | + this.loading = true; | |
| 175 | + // 执行查询 | |
| 176 | + getMailLogPage(this.queryParams).then(response => { | |
| 177 | + this.list = response.data.list; | |
| 178 | + this.total = response.data.total; | |
| 179 | + this.loading = false; | |
| 180 | + }); | |
| 181 | + }, | |
| 182 | + /** 取消按钮 */ | |
| 183 | + cancel() { | |
| 184 | + this.open = false; | |
| 185 | + this.reset(); | |
| 186 | + }, | |
| 187 | + /** 表单重置 */ | |
| 188 | + reset() { | |
| 189 | + this.form = { | |
| 190 | + id: undefined, | |
| 191 | + userId: undefined, | |
| 192 | + userType: undefined, | |
| 193 | + toMail: undefined, | |
| 194 | + accountId: undefined, | |
| 195 | + fromMail: undefined, | |
| 196 | + templateId: undefined, | |
| 197 | + templateCode: undefined, | |
| 198 | + templateNickname: undefined, | |
| 199 | + templateTitle: undefined, | |
| 200 | + templateContent: undefined, | |
| 201 | + templateParams: undefined, | |
| 202 | + sendStatus: undefined, | |
| 203 | + sendTime: undefined, | |
| 204 | + sendMessageId: undefined, | |
| 205 | + sendException: undefined, | |
| 206 | + }; | |
| 207 | + this.resetForm("form"); | |
| 208 | + }, | |
| 209 | + /** 搜索按钮操作 */ | |
| 210 | + handleQuery() { | |
| 211 | + this.queryParams.pageNo = 1; | |
| 212 | + this.getList(); | |
| 213 | + }, | |
| 214 | + /** 重置按钮操作 */ | |
| 215 | + resetQuery() { | |
| 216 | + this.resetForm("queryForm"); | |
| 217 | + this.handleQuery(); | |
| 218 | + }, | |
| 219 | + /** 详细按钮操作 */ | |
| 220 | + handleView(row) { | |
| 221 | + this.open = true; | |
| 222 | + this.form = row; | |
| 223 | + } | |
| 224 | + } | |
| 225 | +}; | |
| 226 | +</script> | ... | ... |
yudao-ui-admin/src/views/system/mail/template/index.vue
0 → 100755
| 1 | +<template> | |
| 2 | + <div class="app-container"> | |
| 3 | + <doc-alert title="邮件配置" url="https://doc.iocoder.cn/mail" /> | |
| 4 | + | |
| 5 | + <!-- 搜索工作栏 --> | |
| 6 | + <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> | |
| 7 | + <el-form-item label="模板名称" prop="name"> | |
| 8 | + <el-input v-model="queryParams.name" placeholder="请输入模板名称" clearable @keyup.enter.native="handleQuery"/> | |
| 9 | + </el-form-item> | |
| 10 | + <el-form-item label="模板编码" prop="code"> | |
| 11 | + <el-input v-model="queryParams.code" placeholder="请输入模板编码" clearable @keyup.enter.native="handleQuery"/> | |
| 12 | + </el-form-item> | |
| 13 | + <el-form-item label="邮箱账号" prop="accountId"> | |
| 14 | + <el-select v-model="queryParams.accountId" placeholder="请输入邮箱账号" clearable> | |
| 15 | + <el-option v-for="account in accountOptions" :key="account.id" :value="account.id" :label="account.mail" /> | |
| 16 | + </el-select> | |
| 17 | + </el-form-item> | |
| 18 | + <el-form-item label="开启状态" prop="status"> | |
| 19 | + <el-select v-model="queryParams.status" placeholder="请选择开启状态" clearable size="small"> | |
| 20 | + <el-option v-for="dict in this.getDictDatas(DICT_TYPE.COMMON_STATUS)" | |
| 21 | + :key="dict.value" :label="dict.label" :value="dict.value"/> | |
| 22 | + </el-select> | |
| 23 | + </el-form-item> | |
| 24 | + <el-form-item label="创建时间" prop="createTime"> | |
| 25 | + <el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange" | |
| 26 | + range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" /> | |
| 27 | + </el-form-item> | |
| 28 | + <el-form-item> | |
| 29 | + <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> | |
| 30 | + <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> | |
| 31 | + </el-form-item> | |
| 32 | + </el-form> | |
| 33 | + | |
| 34 | + <!-- 操作工具栏 --> | |
| 35 | + <el-row :gutter="10" class="mb8"> | |
| 36 | + <el-col :span="1.5"> | |
| 37 | + <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" | |
| 38 | + v-hasPermi="['system:mail-template:create']">新增</el-button> | |
| 39 | + </el-col> | |
| 40 | + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | |
| 41 | + </el-row> | |
| 42 | + | |
| 43 | + <!-- 列表 --> | |
| 44 | + <el-table v-loading="loading" :data="list"> | |
| 45 | + <el-table-column label="模板编码" align="center" prop="code" /> | |
| 46 | + <el-table-column label="模板名称" align="center" prop="name" /> | |
| 47 | + <el-table-column label="模板标题" align="center" prop="title" /> | |
| 48 | + <el-table-column label="模板内容" align="center" prop="content" :show-overflow-tooltip="true" /> | |
| 49 | + <el-table-column label="邮箱账号" align="center" prop="accountId" width="200"> | |
| 50 | + <template v-slot="scope"> | |
| 51 | + {{ accountOptions.find(account => account.id === scope.row.accountId)?.mail }} | |
| 52 | + </template> | |
| 53 | + </el-table-column> | |
| 54 | + <el-table-column label="发送人名称" align="center" prop="nickname" /> | |
| 55 | + <el-table-column label="开启状态" align="center" prop="status"> | |
| 56 | + <template v-slot="scope"> | |
| 57 | + <dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status"/> | |
| 58 | + </template> | |
| 59 | + </el-table-column> | |
| 60 | + <el-table-column label="创建时间" align="center" prop="createTime" width="180"> | |
| 61 | + <template v-slot="scope"> | |
| 62 | + <span>{{ parseTime(scope.row.createTime) }}</span> | |
| 63 | + </template> | |
| 64 | + </el-table-column> | |
| 65 | + <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150"> | |
| 66 | + <template v-slot="scope"> | |
| 67 | + <el-button size="mini" type="text" icon="el-icon-share" @click="handleSend(scope.row)" | |
| 68 | + v-hasPermi="['system:mail-template:send-mail']">测试</el-button> | |
| 69 | + <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" | |
| 70 | + v-hasPermi="['system:mail-template:update']">修改</el-button> | |
| 71 | + <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" | |
| 72 | + v-hasPermi="['system:mail-template:delete']">删除</el-button> | |
| 73 | + </template> | |
| 74 | + </el-table-column> | |
| 75 | + </el-table> | |
| 76 | + <!-- 分页组件 --> | |
| 77 | + <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" | |
| 78 | + @pagination="getList"/> | |
| 79 | + | |
| 80 | + <!-- 对话框(添加 / 修改) --> | |
| 81 | + <el-dialog :title="title" :visible.sync="open" width="600px" v-dialogDrag append-to-body> | |
| 82 | + <el-form ref="form" :model="form" :rules="rules" label-width="100px"> | |
| 83 | + <el-form-item label="模板名称" prop="name"> | |
| 84 | + <el-input v-model="form.name" placeholder="请输入模板名称" /> | |
| 85 | + </el-form-item> | |
| 86 | + <el-form-item label="模板编码" prop="code"> | |
| 87 | + <el-input v-model="form.code" placeholder="请输入模板编码" /> | |
| 88 | + </el-form-item> | |
| 89 | + <el-form-item label="邮箱账号" prop="accountId"> | |
| 90 | + <el-select v-model="form.accountId" placeholder="请输入邮箱账号"> | |
| 91 | + <el-option v-for="account in accountOptions" :key="account.id" :value="account.id" :label="account.mail" /> | |
| 92 | + </el-select> | |
| 93 | + </el-form-item> | |
| 94 | + <el-form-item label="发送人名称" prop="nickname"> | |
| 95 | + <el-input v-model="form.nickname" placeholder="请输入发送人名称" /> | |
| 96 | + </el-form-item> | |
| 97 | + <el-form-item label="模板标题" prop="title"> | |
| 98 | + <el-input v-model="form.title" placeholder="请输入模板标题" /> | |
| 99 | + </el-form-item> | |
| 100 | + <el-form-item label="模板内容"> | |
| 101 | + <editor v-model="form.content" :min-height="192"/> | |
| 102 | + </el-form-item> | |
| 103 | + <el-form-item label="开启状态" prop="status"> | |
| 104 | + <el-radio-group v-model="form.status"> | |
| 105 | + <el-radio v-for="dict in this.getDictDatas(DICT_TYPE.COMMON_STATUS)" | |
| 106 | + :key="dict.value" :label="parseInt(dict.value)">{{dict.label}}</el-radio> | |
| 107 | + </el-radio-group> | |
| 108 | + </el-form-item> | |
| 109 | + <el-form-item label="备注" prop="remark"> | |
| 110 | + <el-input v-model="form.remark" placeholder="请输入备注" /> | |
| 111 | + </el-form-item> | |
| 112 | + </el-form> | |
| 113 | + <div slot="footer" class="dialog-footer"> | |
| 114 | + <el-button type="primary" @click="submitForm">确 定</el-button> | |
| 115 | + <el-button @click="cancel">取 消</el-button> | |
| 116 | + </div> | |
| 117 | + </el-dialog> | |
| 118 | + | |
| 119 | + <!-- 对话框(发送邮件) --> | |
| 120 | + <el-dialog title="测试发送邮件" :visible.sync="sendOpen" width="500px" append-to-body> | |
| 121 | + <el-form ref="sendForm" :model="sendForm" :rules="sendRules" label-width="140px"> | |
| 122 | + <el-form-item label="模板内容" prop="content"> | |
| 123 | + <editor v-model="sendForm.content" :min-height="192" readonly /> | |
| 124 | + </el-form-item> | |
| 125 | + <el-form-item label="收件邮箱" prop="mail"> | |
| 126 | + <el-input v-model="sendForm.mail" placeholder="请输入收件邮箱" /> | |
| 127 | + </el-form-item> | |
| 128 | + <el-form-item v-for="param in sendForm.params" :key="param" :label="'参数 {' + param + '}'" :prop="'templateParams.' + param"> | |
| 129 | + <el-input v-model="sendForm.templateParams[param]" :placeholder="'请输入 ' + param + ' 参数'" /> | |
| 130 | + </el-form-item> | |
| 131 | + </el-form> | |
| 132 | + <div slot="footer" class="dialog-footer"> | |
| 133 | + <el-button type="primary" @click="submitSendForm">确 定</el-button> | |
| 134 | + <el-button @click="cancelSend">取 消</el-button> | |
| 135 | + </div> | |
| 136 | + </el-dialog> | |
| 137 | + </div> | |
| 138 | +</template> | |
| 139 | + | |
| 140 | +<script> | |
| 141 | +import { createMailTemplate, updateMailTemplate, deleteMailTemplate, getMailTemplate, getMailTemplatePage, sendMail } from "@/api/system/mail/template"; | |
| 142 | +import Editor from '@/components/Editor'; | |
| 143 | +import { CommonStatusEnum } from "@/utils/constants"; | |
| 144 | +import { getSimpleMailAccountList } from "@/api/system/mail/account"; | |
| 145 | + | |
| 146 | +export default { | |
| 147 | + name: "MailTemplate", | |
| 148 | + components: { | |
| 149 | + Editor, | |
| 150 | + }, | |
| 151 | + data() { | |
| 152 | + return { | |
| 153 | + // 遮罩层 | |
| 154 | + loading: true, | |
| 155 | + // 显示搜索条件 | |
| 156 | + showSearch: true, | |
| 157 | + // 总条数 | |
| 158 | + total: 0, | |
| 159 | + // 邮件模版列表 | |
| 160 | + list: [], | |
| 161 | + // 弹出层标题 | |
| 162 | + title: "", | |
| 163 | + // 是否显示弹出层 | |
| 164 | + open: false, | |
| 165 | + // 查询参数 | |
| 166 | + queryParams: { | |
| 167 | + pageNo: 1, | |
| 168 | + pageSize: 10, | |
| 169 | + name: null, | |
| 170 | + code: null, | |
| 171 | + accountId: null, | |
| 172 | + status: null, | |
| 173 | + createTime: [], | |
| 174 | + }, | |
| 175 | + // 表单参数 | |
| 176 | + form: {}, | |
| 177 | + // 表单校验 | |
| 178 | + rules: { | |
| 179 | + name: [{ required: true, message: "模板名称不能为空", trigger: "blur" }], | |
| 180 | + code: [{ required: true, message: "模板编码不能为空", trigger: "blur" }], | |
| 181 | + accountId: [{ required: true, message: "邮箱账号不能为空", trigger: "blur" }], | |
| 182 | + title: [{ required: true, message: "模板标题不能为空", trigger: "blur" }], | |
| 183 | + content: [{ required: true, message: "模板内容不能为空", trigger: "blur" }], | |
| 184 | + status: [{ required: true, message: "开启状态不能为空", trigger: "blur" }], | |
| 185 | + }, | |
| 186 | + // 邮箱账号 | |
| 187 | + accountOptions: [], | |
| 188 | + | |
| 189 | + // 发送邮箱 | |
| 190 | + sendOpen: false, | |
| 191 | + sendForm: { | |
| 192 | + params: [], // 模板的参数列表 | |
| 193 | + }, | |
| 194 | + sendRules: { | |
| 195 | + mail: [{ required: true, message: "收件邮箱不能为空", trigger: "blur" }], | |
| 196 | + templateCode: [{ required: true, message: "模版编码不能为空", trigger: "blur" }], | |
| 197 | + templateParams: { } | |
| 198 | + } | |
| 199 | + }; | |
| 200 | + }, | |
| 201 | + created() { | |
| 202 | + this.getList(); | |
| 203 | + // 获得邮箱账号列表 | |
| 204 | + getSimpleMailAccountList().then(response => { | |
| 205 | + this.accountOptions = response.data | |
| 206 | + }) | |
| 207 | + }, | |
| 208 | + methods: { | |
| 209 | + /** 查询列表 */ | |
| 210 | + getList() { | |
| 211 | + this.loading = true; | |
| 212 | + // 执行查询 | |
| 213 | + getMailTemplatePage(this.queryParams).then(response => { | |
| 214 | + this.list = response.data.list; | |
| 215 | + this.total = response.data.total; | |
| 216 | + this.loading = false; | |
| 217 | + }); | |
| 218 | + }, | |
| 219 | + /** 取消按钮 */ | |
| 220 | + cancel() { | |
| 221 | + this.open = false; | |
| 222 | + this.reset(); | |
| 223 | + }, | |
| 224 | + /** 表单重置 */ | |
| 225 | + reset() { | |
| 226 | + this.form = { | |
| 227 | + id: undefined, | |
| 228 | + name: undefined, | |
| 229 | + code: undefined, | |
| 230 | + accountId: undefined, | |
| 231 | + nickname: undefined, | |
| 232 | + title: undefined, | |
| 233 | + content: undefined, | |
| 234 | + status: CommonStatusEnum.ENABLE, | |
| 235 | + remark: undefined, | |
| 236 | + }; | |
| 237 | + this.resetForm("form"); | |
| 238 | + }, | |
| 239 | + /** 搜索按钮操作 */ | |
| 240 | + handleQuery() { | |
| 241 | + this.queryParams.pageNo = 1; | |
| 242 | + this.getList(); | |
| 243 | + }, | |
| 244 | + /** 重置按钮操作 */ | |
| 245 | + resetQuery() { | |
| 246 | + this.resetForm("queryForm"); | |
| 247 | + this.handleQuery(); | |
| 248 | + }, | |
| 249 | + /** 新增按钮操作 */ | |
| 250 | + handleAdd() { | |
| 251 | + this.reset(); | |
| 252 | + this.open = true; | |
| 253 | + this.title = "添加邮件模版"; | |
| 254 | + }, | |
| 255 | + /** 修改按钮操作 */ | |
| 256 | + handleUpdate(row) { | |
| 257 | + this.reset(); | |
| 258 | + const id = row.id; | |
| 259 | + getMailTemplate(id).then(response => { | |
| 260 | + this.form = response.data; | |
| 261 | + this.open = true; | |
| 262 | + this.title = "修改邮件模版"; | |
| 263 | + }); | |
| 264 | + }, | |
| 265 | + /** 提交按钮 */ | |
| 266 | + submitForm() { | |
| 267 | + this.$refs["form"].validate(valid => { | |
| 268 | + if (!valid) { | |
| 269 | + return; | |
| 270 | + } | |
| 271 | + // 修改的提交 | |
| 272 | + if (this.form.id != null) { | |
| 273 | + updateMailTemplate(this.form).then(response => { | |
| 274 | + this.$modal.msgSuccess("修改成功"); | |
| 275 | + this.open = false; | |
| 276 | + this.getList(); | |
| 277 | + }); | |
| 278 | + return; | |
| 279 | + } | |
| 280 | + // 添加的提交 | |
| 281 | + createMailTemplate(this.form).then(response => { | |
| 282 | + this.$modal.msgSuccess("新增成功"); | |
| 283 | + this.open = false; | |
| 284 | + this.getList(); | |
| 285 | + }); | |
| 286 | + }); | |
| 287 | + }, | |
| 288 | + /** 删除按钮操作 */ | |
| 289 | + handleDelete(row) { | |
| 290 | + const id = row.id; | |
| 291 | + this.$modal.confirm('是否确认删除邮件模版编号为"' + id + '"的数据项?').then(function() { | |
| 292 | + return deleteMailTemplate(id); | |
| 293 | + }).then(() => { | |
| 294 | + this.getList(); | |
| 295 | + this.$modal.msgSuccess("删除成功"); | |
| 296 | + }).catch(() => {}); | |
| 297 | + }, | |
| 298 | + /** 发送短息按钮 */ | |
| 299 | + handleSend(row) { | |
| 300 | + this.resetSend(row); | |
| 301 | + // 设置参数 | |
| 302 | + this.sendForm.content = row.content; | |
| 303 | + this.sendForm.params = row.params; | |
| 304 | + this.sendForm.templateCode = row.code; | |
| 305 | + this.sendForm.templateParams = row.params.reduce(function(obj, item) { | |
| 306 | + obj[item] = undefined; | |
| 307 | + return obj; | |
| 308 | + }, {}); | |
| 309 | + // 根据 row 重置 rules | |
| 310 | + this.sendRules.templateParams = row.params.reduce(function(obj, item) { | |
| 311 | + obj[item] = { required: true, message: '参数 ' + item + " 不能为空", trigger: "change" }; | |
| 312 | + return obj; | |
| 313 | + }, {}); | |
| 314 | + // 设置打开 | |
| 315 | + this.sendOpen = true; | |
| 316 | + }, | |
| 317 | + /** 重置发送邮箱的表单 */ | |
| 318 | + resetSend() { | |
| 319 | + // 根据 row 重置表单 | |
| 320 | + this.sendForm = { | |
| 321 | + content: undefined, | |
| 322 | + params: undefined, | |
| 323 | + mail: undefined, | |
| 324 | + templateCode: undefined, | |
| 325 | + templateParams: {} | |
| 326 | + }; | |
| 327 | + this.resetForm("sendForm"); | |
| 328 | + }, | |
| 329 | + /** 取消发送邮箱 */ | |
| 330 | + cancelSend() { | |
| 331 | + this.sendOpen = false; | |
| 332 | + this.resetSend(); | |
| 333 | + }, | |
| 334 | + /** 提交按钮 */ | |
| 335 | + submitSendForm() { | |
| 336 | + this.$refs["sendForm"].validate(valid => { | |
| 337 | + if (!valid) { | |
| 338 | + return; | |
| 339 | + } | |
| 340 | + // 添加的提交 | |
| 341 | + sendMail(this.sendForm).then(response => { | |
| 342 | + this.$modal.msgSuccess("提交发送成功!发送结果,见发送日志编号:" + response.data); | |
| 343 | + this.sendOpen = false; | |
| 344 | + }); | |
| 345 | + }); | |
| 346 | + }, | |
| 347 | + } | |
| 348 | +}; | |
| 349 | +</script> | ... | ... |
yudao-ui-admin/src/views/system/notify/message/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="app-container"> | |
| 3 | + <doc-alert title="站内信配置" url="https://doc.iocoder.cn/notify/" /> | |
| 4 | + <!-- 搜索工作栏 --> | |
| 5 | + <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> | |
| 6 | + <el-form-item label="用户编号" prop="userId"> | |
| 7 | + <el-input v-model="queryParams.userId" placeholder="请输入用户编号" clearable @keyup.enter.native="handleQuery"/> | |
| 8 | + </el-form-item> | |
| 9 | + <el-form-item label="用户类型" prop="userType"> | |
| 10 | + <el-select v-model="queryParams.userType" placeholder="请选择用户类型" clearable size="small"> | |
| 11 | + <el-option v-for="dict in this.getDictDatas(DICT_TYPE.USER_TYPE)" | |
| 12 | + :key="dict.value" :label="dict.label" :value="dict.value"/> | |
| 13 | + </el-select> | |
| 14 | + </el-form-item> | |
| 15 | + <el-form-item label="模板编码" prop="templateCode"> | |
| 16 | + <el-input v-model="queryParams.templateCode" placeholder="请输入模板编码" clearable @keyup.enter.native="handleQuery"/> | |
| 17 | + </el-form-item> | |
| 18 | + <el-form-item label="模版类型" prop="templateType"> | |
| 19 | + <el-select v-model="queryParams.templateType" placeholder="请选择模版类型" clearable size="small"> | |
| 20 | + <el-option v-for="dict in this.getDictDatas(DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE)" | |
| 21 | + :key="dict.value" :label="dict.label" :value="dict.value"/> | |
| 22 | + </el-select> | |
| 23 | + </el-form-item> | |
| 24 | + <el-form-item label="创建时间" prop="createTime"> | |
| 25 | + <el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange" | |
| 26 | + range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" /> | |
| 27 | + </el-form-item> | |
| 28 | + <el-form-item> | |
| 29 | + <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> | |
| 30 | + <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> | |
| 31 | + </el-form-item> | |
| 32 | + </el-form> | |
| 33 | + | |
| 34 | + <!-- 操作工具栏 --> | |
| 35 | + <el-row :gutter="10" class="mb8"> | |
| 36 | + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | |
| 37 | + </el-row> | |
| 38 | + | |
| 39 | + <!-- 列表 --> | |
| 40 | + <el-table v-loading="loading" :data="list"> | |
| 41 | + <el-table-column label="编号" align="center" prop="id" /> | |
| 42 | + <el-table-column label="用户编号" align="center" prop="userId" /> | |
| 43 | + <el-table-column label="用户类型" align="center" prop="userType"> | |
| 44 | + <template v-slot="scope"> | |
| 45 | + <dict-tag :type="DICT_TYPE.USER_TYPE" :value="scope.row.userType" /> | |
| 46 | + </template> | |
| 47 | + </el-table-column> | |
| 48 | + <el-table-column label="模板编码" align="center" prop="templateCode" /> | |
| 49 | + <el-table-column label="发送人名称" align="center" prop="templateNickname" /> | |
| 50 | + <el-table-column label="模版内容" align="center" prop="templateContent" /> | |
| 51 | + <el-table-column label="模版类型" align="center" prop="templateType"> | |
| 52 | + <template v-slot="scope"> | |
| 53 | + <dict-tag :type="DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE" :value="scope.row.templateType" /> | |
| 54 | + </template> | |
| 55 | + </el-table-column> | |
| 56 | + <el-table-column label="是否已读" align="center" prop="readStatus"> | |
| 57 | + <template v-slot="scope"> | |
| 58 | + <dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.readStatus" /> | |
| 59 | + </template> | |
| 60 | + </el-table-column> | |
| 61 | + <el-table-column label="阅读时间" align="center" prop="readTime" width="180"> | |
| 62 | + <template v-slot="scope"> | |
| 63 | + <span>{{ parseTime(scope.row.readTime) }}</span> | |
| 64 | + </template> | |
| 65 | + </el-table-column> | |
| 66 | + <el-table-column label="创建时间" align="center" prop="createTime" width="180"> | |
| 67 | + <template v-slot="scope"> | |
| 68 | + <span>{{ parseTime(scope.row.createTime) }}</span> | |
| 69 | + </template> | |
| 70 | + </el-table-column> | |
| 71 | + <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> | |
| 72 | + <template v-slot="scope"> | |
| 73 | + <el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)" | |
| 74 | + v-hasPermi="['system:notify-message:query']">详细</el-button> | |
| 75 | + </template> | |
| 76 | + </el-table-column> | |
| 77 | + </el-table> | |
| 78 | + <!-- 分页组件 --> | |
| 79 | + <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" | |
| 80 | + @pagination="getList"/> | |
| 81 | + | |
| 82 | + <!-- 站内信详细--> | |
| 83 | + <el-dialog :title="title" :visible.sync="open" width="700px" v-dialogDrag append-to-body> | |
| 84 | + <el-form ref="form" :model="form" label-width="160px"> | |
| 85 | + <el-row> | |
| 86 | + <el-col :span="24"> | |
| 87 | + <el-form-item label="日志主键:">{{ form.id }}</el-form-item> | |
| 88 | + <el-form-item label="发送时间:">{{ parseTime(form.createTime) }}</el-form-item> | |
| 89 | + <el-form-item label="用户编号:">{{ form.userId }}</el-form-item> | |
| 90 | + <el-form-item label="用户类型:"> | |
| 91 | + <dict-tag :type="DICT_TYPE.USER_TYPE" :value="form.userType"/> | |
| 92 | + </el-form-item> | |
| 93 | + <el-form-item label="模板编号:">{{ form.templateId }}</el-form-item> | |
| 94 | + <el-form-item label="模板编码:">{{ form.templateCode }}</el-form-item> | |
| 95 | + <el-form-item label="模板类型:"> | |
| 96 | + <dict-tag :type="DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE" :value="form.templateType" /> | |
| 97 | + </el-form-item> | |
| 98 | + <el-form-item label="模版发送人名称:">{{ form.templateNickname }}</el-form-item> | |
| 99 | + <el-form-item label="邮件内容:">{{ form.templateContent }}</el-form-item> | |
| 100 | + <el-form-item label="模版参数:">{{ form.templateParams }}</el-form-item> | |
| 101 | + <el-form-item label="是否已读:"> | |
| 102 | + <dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="form.readStatus" /> | |
| 103 | + </el-form-item> | |
| 104 | + <el-form-item label="阅读时间:">{{ parseTime(form.readTime) }}</el-form-item> | |
| 105 | + </el-col> | |
| 106 | + </el-row> | |
| 107 | + </el-form> | |
| 108 | + <div slot="footer" class="dialog-footer"> | |
| 109 | + <el-button @click="open = false">关 闭</el-button> | |
| 110 | + </div> | |
| 111 | + </el-dialog> | |
| 112 | + </div> | |
| 113 | +</template> | |
| 114 | + | |
| 115 | +<script> | |
| 116 | +import { getNotifyMessagePage } from "@/api/system/notify/message"; | |
| 117 | + | |
| 118 | +export default { | |
| 119 | + name: "NotifyMessage", | |
| 120 | + data() { | |
| 121 | + return { | |
| 122 | + // 遮罩层 | |
| 123 | + loading: true, | |
| 124 | + // 显示搜索条件 | |
| 125 | + showSearch: true, | |
| 126 | + // 总条数 | |
| 127 | + total: 0, | |
| 128 | + // 站内信消息列表 | |
| 129 | + list: [], | |
| 130 | + // 弹出层标题 | |
| 131 | + title: "站内信详细", | |
| 132 | + // 是否显示弹出层 | |
| 133 | + open: false, | |
| 134 | + // 查询参数 | |
| 135 | + queryParams: { | |
| 136 | + pageNo: 1, | |
| 137 | + pageSize: 10, | |
| 138 | + userId: null, | |
| 139 | + userType: null, | |
| 140 | + templateCode: null, | |
| 141 | + templateType: null, | |
| 142 | + createTime: [], | |
| 143 | + }, | |
| 144 | + // 表单参数 | |
| 145 | + form: {}, | |
| 146 | + }; | |
| 147 | + }, | |
| 148 | + created() { | |
| 149 | + this.getList(); | |
| 150 | + }, | |
| 151 | + methods: { | |
| 152 | + /** 查询列表 */ | |
| 153 | + getList() { | |
| 154 | + this.loading = true; | |
| 155 | + // 执行查询 | |
| 156 | + getNotifyMessagePage(this.queryParams).then(response => { | |
| 157 | + this.list = response.data.list; | |
| 158 | + this.total = response.data.total; | |
| 159 | + this.loading = false; | |
| 160 | + }); | |
| 161 | + }, | |
| 162 | + /** 搜索按钮操作 */ | |
| 163 | + handleQuery() { | |
| 164 | + this.queryParams.pageNo = 1; | |
| 165 | + this.getList(); | |
| 166 | + }, | |
| 167 | + /** 重置按钮操作 */ | |
| 168 | + resetQuery() { | |
| 169 | + this.resetForm("queryForm"); | |
| 170 | + this.handleQuery(); | |
| 171 | + }, | |
| 172 | + /** 详细按钮操作 */ | |
| 173 | + handleView(row) { | |
| 174 | + this.open = true; | |
| 175 | + this.form = row; | |
| 176 | + } | |
| 177 | + } | |
| 178 | +}; | |
| 179 | +</script> | ... | ... |
yudao-ui-admin/src/views/system/notify/my/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="app-container"> | |
| 3 | + <doc-alert title="站内信配置" url="https://doc.iocoder.cn/notify/" /> | |
| 4 | + | |
| 5 | + <!-- 搜索工作栏 --> | |
| 6 | + <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> | |
| 7 | + <el-form-item label="是否已读" prop="readStatus"> | |
| 8 | + <el-select v-model="queryParams.readStatus" placeholder="请选择状态" clearable> | |
| 9 | + <el-option v-for="dict in this.getDictDatas(DICT_TYPE.INFRA_BOOLEAN_STRING)" | |
| 10 | + :key="dict.value" :label="dict.label" :value="dict.value"/> | |
| 11 | + </el-select> | |
| 12 | + </el-form-item> | |
| 13 | + <el-form-item label="发送时间" prop="createTime"> | |
| 14 | + <el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange" | |
| 15 | + range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" /> | |
| 16 | + </el-form-item> | |
| 17 | + <el-form-item> | |
| 18 | + <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> | |
| 19 | + <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> | |
| 20 | + </el-form-item> | |
| 21 | + </el-form> | |
| 22 | + | |
| 23 | + <!-- 操作工具栏 --> | |
| 24 | + <el-row :gutter="10" class="mb8"> | |
| 25 | + <el-col :span="1.5"> | |
| 26 | + <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleUpdateList">标记已读</el-button> | |
| 27 | + </el-col> | |
| 28 | + <el-col :span="1.5"> | |
| 29 | + <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleUpdateAll">全部已读</el-button> | |
| 30 | + </el-col> | |
| 31 | + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | |
| 32 | + </el-row> | |
| 33 | + | |
| 34 | + <!-- 列表 --> | |
| 35 | + <el-table v-loading="loading" ref="tables" :data="list"> | |
| 36 | + <el-table-column type="selection" width="55" /> | |
| 37 | + <el-table-column label="发送人" align="center" prop="templateNickname" width="120" /> | |
| 38 | + <el-table-column label="发送时间" align="center" prop="createTime" width="180"> | |
| 39 | + <template v-slot="scope"> | |
| 40 | + <span>{{ parseTime(scope.row.createTime) }}</span> | |
| 41 | + </template> | |
| 42 | + </el-table-column> | |
| 43 | + <el-table-column label="类型" align="center" prop="templateType" width="80"> | |
| 44 | + <template v-slot="scope"> | |
| 45 | + <dict-tag :type="DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE" :value="scope.row.templateType" /> | |
| 46 | + </template> | |
| 47 | + </el-table-column> | |
| 48 | + <el-table-column label="内容" align="center" prop="templateContent" /> | |
| 49 | + <el-table-column label="是否已读" align="center" prop="readStatus" width="80"> | |
| 50 | + <template v-slot="scope"> | |
| 51 | + <dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.readStatus"/> | |
| 52 | + </template> | |
| 53 | + </el-table-column> | |
| 54 | + <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150"> | |
| 55 | + <template v-slot="scope"> | |
| 56 | + <el-button v-show="!scope.row.readStatus" size="mini" type="text" icon="el-icon-check" @click="handleUpdateSingle(scope.row)">已读</el-button> | |
| 57 | + </template> | |
| 58 | + </el-table-column> | |
| 59 | + </el-table> | |
| 60 | + <!-- 分页组件 --> | |
| 61 | + <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" | |
| 62 | + @pagination="getList"/> | |
| 63 | + | |
| 64 | + </div> | |
| 65 | +</template> | |
| 66 | + | |
| 67 | +<script> | |
| 68 | +import {getMyNotifyMessagePage, updateAllNotifyMessageRead, updateNotifyMessageRead} from "@/api/system/notify/message"; | |
| 69 | + | |
| 70 | +export default { | |
| 71 | + name: "myNotify", | |
| 72 | + data() { | |
| 73 | + return { | |
| 74 | + // 遮罩层 | |
| 75 | + loading: true, | |
| 76 | + // 显示搜索条件 | |
| 77 | + showSearch: true, | |
| 78 | + // 总条数 | |
| 79 | + total: 0, | |
| 80 | + // 我的站内信列表 | |
| 81 | + list: [], | |
| 82 | + // 查询参数 | |
| 83 | + queryParams: { | |
| 84 | + pageNo: 1, | |
| 85 | + pageSize: 10, | |
| 86 | + readStatus: null, | |
| 87 | + createTime: [] | |
| 88 | + }, | |
| 89 | + }; | |
| 90 | + }, | |
| 91 | + created() { | |
| 92 | + this.getList(); | |
| 93 | + }, | |
| 94 | + methods: { | |
| 95 | + /** 查询列表 */ | |
| 96 | + getList() { | |
| 97 | + this.loading = true; | |
| 98 | + // 执行查询 | |
| 99 | + getMyNotifyMessagePage(this.queryParams).then(response => { | |
| 100 | + this.list = response.data.list; | |
| 101 | + this.total = response.data.total; | |
| 102 | + this.loading = false; | |
| 103 | + }); | |
| 104 | + }, | |
| 105 | + /** 搜索按钮操作 */ | |
| 106 | + handleQuery() { | |
| 107 | + this.queryParams.pageNo = 1; | |
| 108 | + this.getList(); | |
| 109 | + }, | |
| 110 | + /** 重置按钮操作 */ | |
| 111 | + resetQuery() { | |
| 112 | + this.resetForm("queryForm"); | |
| 113 | + this.handleQuery(); | |
| 114 | + }, | |
| 115 | + handleUpdateList() { | |
| 116 | + let list = this.$refs["tables"].selection; | |
| 117 | + if (list.length === 0) { | |
| 118 | + return; | |
| 119 | + } | |
| 120 | + this.handleUpdate(list.map(v => v.id)) | |
| 121 | + }, | |
| 122 | + handleUpdateSingle(row) { | |
| 123 | + this.handleUpdate([row.id]) | |
| 124 | + }, | |
| 125 | + handleUpdate(ids) { | |
| 126 | + updateNotifyMessageRead(ids).then(response => { | |
| 127 | + this.$modal.msgSuccess("标记已读成功!"); | |
| 128 | + this.getList(); | |
| 129 | + }); | |
| 130 | + }, | |
| 131 | + handleUpdateAll(){ | |
| 132 | + updateAllNotifyMessageRead().then(response => { | |
| 133 | + this.$modal.msgSuccess("全部已读成功!"); | |
| 134 | + this.getList(); | |
| 135 | + }); | |
| 136 | + } | |
| 137 | + } | |
| 138 | +} | |
| 139 | +</script> | ... | ... |
yudao-ui-admin/src/views/system/notify/template/index.vue
0 → 100644
| 1 | +<template> | |
| 2 | + <div class="app-container"> | |
| 3 | + <doc-alert title="站内信配置" url="https://doc.iocoder.cn/notify/" /> | |
| 4 | + | |
| 5 | + <!-- 搜索工作栏 --> | |
| 6 | + <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> | |
| 7 | + <el-form-item label="模板名称" prop="name"> | |
| 8 | + <el-input v-model="queryParams.name" placeholder="请输入模板名称" clearable @keyup.enter.native="handleQuery"/> | |
| 9 | + </el-form-item> | |
| 10 | + <el-form-item label="模版编码" prop="code"> | |
| 11 | + <el-input v-model="queryParams.code" placeholder="请输入模版编码" clearable @keyup.enter.native="handleQuery"/> | |
| 12 | + </el-form-item> | |
| 13 | + <el-form-item label="状态" prop="status"> | |
| 14 | + <el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small"> | |
| 15 | + <el-option v-for="dict in this.getDictDatas(DICT_TYPE.COMMON_STATUS)" | |
| 16 | + :key="dict.value" :label="dict.label" :value="dict.value"/> | |
| 17 | + </el-select> | |
| 18 | + </el-form-item> | |
| 19 | + <el-form-item label="创建时间" prop="createTime"> | |
| 20 | + <el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange" | |
| 21 | + range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" /> | |
| 22 | + </el-form-item> | |
| 23 | + <el-form-item> | |
| 24 | + <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> | |
| 25 | + <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> | |
| 26 | + </el-form-item> | |
| 27 | + </el-form> | |
| 28 | + | |
| 29 | + <!-- 操作工具栏 --> | |
| 30 | + <el-row :gutter="10" class="mb8"> | |
| 31 | + <el-col :span="1.5"> | |
| 32 | + <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" | |
| 33 | + v-hasPermi="['system:notify-template:create']">新增</el-button> | |
| 34 | + </el-col> | |
| 35 | + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | |
| 36 | + </el-row> | |
| 37 | + | |
| 38 | + <!-- 列表 --> | |
| 39 | + <el-table v-loading="loading" :data="list"> | |
| 40 | + <el-table-column label="模板编码" align="center" prop="code" /> | |
| 41 | + <el-table-column label="模板名称" align="center" prop="name" /> | |
| 42 | + <el-table-column label="类型" align="center" prop="type"> | |
| 43 | + <template v-slot="scope"> | |
| 44 | + <dict-tag :type="DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE" :value="scope.row.type" /> | |
| 45 | + </template> | |
| 46 | + </el-table-column> | |
| 47 | + <el-table-column label="发送人名称" align="center" prop="nickname" /> | |
| 48 | + <el-table-column label="模板内容" align="center" prop="content" width="300" /> | |
| 49 | + <el-table-column label="开启状态" align="center" prop="status"> | |
| 50 | + <template v-slot="scope"> | |
| 51 | + <dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status"/> | |
| 52 | + </template> | |
| 53 | + </el-table-column> | |
| 54 | + <el-table-column label="备注" align="center" prop="remark" /> | |
| 55 | + <el-table-column label="创建时间" align="center" prop="createTime" width="180"> | |
| 56 | + <template v-slot="scope"> | |
| 57 | + <span>{{ parseTime(scope.row.createTime) }}</span> | |
| 58 | + </template> | |
| 59 | + </el-table-column> | |
| 60 | + <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150"> | |
| 61 | + <template v-slot="scope"> | |
| 62 | + <el-button size="mini" type="text" icon="el-icon-share" @click="handleSendNotify(scope.row)" | |
| 63 | + v-hasPermi="['system:notify-template:send-notify']">测试</el-button> | |
| 64 | + <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" | |
| 65 | + v-hasPermi="['system:notify-template:update']">修改</el-button> | |
| 66 | + <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" | |
| 67 | + v-hasPermi="['system:notify-template:delete']">删除</el-button> | |
| 68 | + </template> | |
| 69 | + </el-table-column> | |
| 70 | + </el-table> | |
| 71 | + <!-- 分页组件 --> | |
| 72 | + <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" | |
| 73 | + @pagination="getList"/> | |
| 74 | + | |
| 75 | + <!-- 对话框(添加 / 修改) --> | |
| 76 | + <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> | |
| 77 | + <el-form ref="form" :model="form" :rules="rules" label-width="140px"> | |
| 78 | + <el-form-item label="模版编码" prop="code"> | |
| 79 | + <el-input v-model="form.code" placeholder="请输入模版编码" /> | |
| 80 | + </el-form-item> | |
| 81 | + <el-form-item label="模板名称" prop="name"> | |
| 82 | + <el-input v-model="form.name" placeholder="请输入模版名称" /> | |
| 83 | + </el-form-item> | |
| 84 | + <el-form-item label="发件人名称" prop="nickname"> | |
| 85 | + <el-input v-model="form.nickname" placeholder="请输入发件人名称" /> | |
| 86 | + </el-form-item> | |
| 87 | + <el-form-item label="模板内容" prop="content"> | |
| 88 | + <el-input type="textarea" v-model="form.content" placeholder="请输入模板内容" /> | |
| 89 | + </el-form-item> | |
| 90 | + <el-form-item label="类型" prop="type"> | |
| 91 | + <el-select v-model="form.type" placeholder="请选择类型"> | |
| 92 | + <el-option v-for="dict in this.getDictDatas(DICT_TYPE.SYSTEM_NOTIFY_TEMPLATE_TYPE)" | |
| 93 | + :key="dict.value" :label="dict.label" :value="parseInt(dict.value)" /> | |
| 94 | + </el-select> | |
| 95 | + </el-form-item> | |
| 96 | + <el-form-item label="开启状态" prop="status"> | |
| 97 | + <el-radio-group v-model="form.status"> | |
| 98 | + <el-radio v-for="dict in this.getDictDatas(DICT_TYPE.COMMON_STATUS)" | |
| 99 | + :key="dict.value" :label="parseInt(dict.value)">{{dict.label}}</el-radio> | |
| 100 | + </el-radio-group> | |
| 101 | + </el-form-item> | |
| 102 | + <el-form-item label="备注" prop="remark"> | |
| 103 | + <el-input v-model="form.remark" placeholder="请输入备注" /> | |
| 104 | + </el-form-item> | |
| 105 | + </el-form> | |
| 106 | + <div slot="footer" class="dialog-footer"> | |
| 107 | + <el-button type="primary" @click="submitForm">确 定</el-button> | |
| 108 | + <el-button @click="cancel">取 消</el-button> | |
| 109 | + </div> | |
| 110 | + </el-dialog> | |
| 111 | + | |
| 112 | + <!-- 对话框(发送站内信) --> | |
| 113 | + <el-dialog title="发送站内信" :visible.sync="sendNotifyOpen" width="500px" append-to-body> | |
| 114 | + <el-form ref="sendNotifyForm" :model="sendNotifyForm" :rules="sendNotifyRules" label-width="140px"> | |
| 115 | + <el-form-item label="模板内容" prop="content"> | |
| 116 | + <el-input v-model="sendNotifyForm.content" type="textarea" placeholder="请输入模板内容" readonly /> | |
| 117 | + </el-form-item> | |
| 118 | + <el-form-item label="接收人" prop="userId"> | |
| 119 | + <el-select v-model="sendNotifyForm.userId" placeholder="请输入接收人" clearable style="width: 100%"> | |
| 120 | + <el-option v-for="item in users" :key="parseInt(item.id)" :label="item.nickname" :value="parseInt(item.id)" /> | |
| 121 | + </el-select> | |
| 122 | + </el-form-item> | |
| 123 | + <el-form-item v-for="param in sendNotifyForm.params" :key="param" :label="'参数 {' + param + '}'" :prop="'templateParams.' + param"> | |
| 124 | + <el-input v-model="sendNotifyForm.templateParams[param]" :placeholder="'请输入 ' + param + ' 参数'" /> | |
| 125 | + </el-form-item> | |
| 126 | + </el-form> | |
| 127 | + <div slot="footer" class="dialog-footer"> | |
| 128 | + <el-button type="primary" @click="submitSendNotifyForm">确 定</el-button> | |
| 129 | + <el-button @click="cancelSendNotify">取 消</el-button> | |
| 130 | + </div> | |
| 131 | + </el-dialog> | |
| 132 | + | |
| 133 | + </div> | |
| 134 | +</template> | |
| 135 | + | |
| 136 | +<script> | |
| 137 | +import { createNotifyTemplate, updateNotifyTemplate, deleteNotifyTemplate, getNotifyTemplate, getNotifyTemplatePage, | |
| 138 | + sendNotify } from "@/api/system/notify/template"; | |
| 139 | +import {listSimpleUsers} from "@/api/system/user"; | |
| 140 | +import {CommonStatusEnum} from "@/utils/constants"; | |
| 141 | + | |
| 142 | +export default { | |
| 143 | + name: "NotifyTemplate", | |
| 144 | + data() { | |
| 145 | + return { | |
| 146 | + // 遮罩层 | |
| 147 | + loading: true, | |
| 148 | + // 显示搜索条件 | |
| 149 | + showSearch: true, | |
| 150 | + // 总条数 | |
| 151 | + total: 0, | |
| 152 | + // 短信模板列表 | |
| 153 | + list: [], | |
| 154 | + // 弹出层标题 | |
| 155 | + title: "", | |
| 156 | + // 是否显示弹出层 | |
| 157 | + open: false, | |
| 158 | + // 查询参数 | |
| 159 | + queryParams: { | |
| 160 | + pageNo: 1, | |
| 161 | + pageSize: 10, | |
| 162 | + status: null, | |
| 163 | + code: null, | |
| 164 | + title: null, | |
| 165 | + createTime: [] | |
| 166 | + }, | |
| 167 | + // 表单参数 | |
| 168 | + form: {}, | |
| 169 | + // 表单校验 | |
| 170 | + rules: { | |
| 171 | + name: [{ required: true, message: "模板名称不能为空", trigger: "blur" }], | |
| 172 | + code: [{ required: true, message: "模版编码不能为空", trigger: "blur" }], | |
| 173 | + nickname: [{ required: true, message: "发件人名称不能为空", trigger: "blur" }], | |
| 174 | + content: [{ required: true, message: "模版内容不能为空", trigger: "blur" }], | |
| 175 | + type: [{ required: true, message: "类型不能为空", trigger: "change" }], | |
| 176 | + status: [{ required: true, message: "状态不能为空", trigger: "blur" }], | |
| 177 | + }, | |
| 178 | + // 用户列表 | |
| 179 | + users: [], | |
| 180 | + // 发送短信 | |
| 181 | + sendNotifyOpen: false, | |
| 182 | + sendNotifyForm: { | |
| 183 | + params: [], // 模板的参数列表 | |
| 184 | + }, | |
| 185 | + sendNotifyRules: { | |
| 186 | + userId: [{ required: true, message: "接收人不能为空", trigger: "blur" }], | |
| 187 | + templateCode: [{ required: true, message: "模版编码不能为空", trigger: "blur" }], | |
| 188 | + templateParams: { } | |
| 189 | + } | |
| 190 | + }; | |
| 191 | + }, | |
| 192 | + created() { | |
| 193 | + this.getList(); | |
| 194 | + // 获得用户列表 | |
| 195 | + listSimpleUsers().then(response => { | |
| 196 | + this.users = response.data; | |
| 197 | + }) | |
| 198 | + }, | |
| 199 | + methods: { | |
| 200 | + /** 查询列表 */ | |
| 201 | + getList() { | |
| 202 | + this.loading = true; | |
| 203 | + // 执行查询 | |
| 204 | + getNotifyTemplatePage(this.queryParams).then(response => { | |
| 205 | + this.list = response.data.list; | |
| 206 | + this.total = response.data.total; | |
| 207 | + this.loading = false; | |
| 208 | + }); | |
| 209 | + }, | |
| 210 | + /** 取消按钮 */ | |
| 211 | + cancel() { | |
| 212 | + this.open = false; | |
| 213 | + this.reset(); | |
| 214 | + }, | |
| 215 | + /** 表单重置 */ | |
| 216 | + reset() { | |
| 217 | + this.form = { | |
| 218 | + id: undefined, | |
| 219 | + name: undefined, | |
| 220 | + code: undefined, | |
| 221 | + nickname: undefined, | |
| 222 | + content: undefined, | |
| 223 | + type: undefined, | |
| 224 | + params: undefined, | |
| 225 | + status: CommonStatusEnum.ENABLE, | |
| 226 | + remark: undefined, | |
| 227 | + }; | |
| 228 | + this.resetForm("form"); | |
| 229 | + }, | |
| 230 | + /** 搜索按钮操作 */ | |
| 231 | + handleQuery() { | |
| 232 | + this.queryParams.pageNo = 1; | |
| 233 | + this.getList(); | |
| 234 | + }, | |
| 235 | + /** 重置按钮操作 */ | |
| 236 | + resetQuery() { | |
| 237 | + this.resetForm("queryForm"); | |
| 238 | + this.handleQuery(); | |
| 239 | + }, | |
| 240 | + /** 新增按钮操作 */ | |
| 241 | + handleAdd() { | |
| 242 | + this.reset(); | |
| 243 | + this.open = true; | |
| 244 | + this.title = "添加站内信模板"; | |
| 245 | + }, | |
| 246 | + /** 修改按钮操作 */ | |
| 247 | + handleUpdate(row) { | |
| 248 | + this.reset(); | |
| 249 | + const id = row.id; | |
| 250 | + getNotifyTemplate(id).then(response => { | |
| 251 | + this.form = response.data; | |
| 252 | + this.open = true; | |
| 253 | + this.title = "修改站内信模板"; | |
| 254 | + }); | |
| 255 | + }, | |
| 256 | + /** 提交按钮 */ | |
| 257 | + submitForm() { | |
| 258 | + this.$refs["form"].validate(valid => { | |
| 259 | + if (!valid) { | |
| 260 | + return; | |
| 261 | + } | |
| 262 | + // 修改的提交 | |
| 263 | + if (this.form.id != null) { | |
| 264 | + updateNotifyTemplate(this.form).then(response => { | |
| 265 | + this.$modal.msgSuccess("修改成功"); | |
| 266 | + this.open = false; | |
| 267 | + this.getList(); | |
| 268 | + }); | |
| 269 | + return; | |
| 270 | + } | |
| 271 | + // 添加的提交 | |
| 272 | + createNotifyTemplate(this.form).then(response => { | |
| 273 | + this.$modal.msgSuccess("新增成功"); | |
| 274 | + this.open = false; | |
| 275 | + this.getList(); | |
| 276 | + }); | |
| 277 | + }); | |
| 278 | + }, | |
| 279 | + /** 删除按钮操作 */ | |
| 280 | + handleDelete(row) { | |
| 281 | + const id = row.id; | |
| 282 | + this.$modal.confirm('是否确认删除站内信模板编号为"' + id + '"的数据项?').then(function() { | |
| 283 | + return deleteNotifyTemplate(id); | |
| 284 | + }).then(() => { | |
| 285 | + this.getList(); | |
| 286 | + this.$modal.msgSuccess("删除成功"); | |
| 287 | + }).catch(() => {}); | |
| 288 | + }, | |
| 289 | + /** 发送站内信按钮 */ | |
| 290 | + handleSendNotify(row) { | |
| 291 | + this.resetSendNotify(row); | |
| 292 | + // 设置参数 | |
| 293 | + this.sendNotifyForm.content = row.content; | |
| 294 | + this.sendNotifyForm.params = row.params; | |
| 295 | + this.sendNotifyForm.templateCode = row.code; | |
| 296 | + this.sendNotifyForm.templateParams = row.params.reduce(function(obj, item) { | |
| 297 | + obj[item] = undefined; | |
| 298 | + return obj; | |
| 299 | + }, {}); | |
| 300 | + // 根据 row 重置 rules | |
| 301 | + this.sendNotifyRules.templateParams = row.params.reduce(function(obj, item) { | |
| 302 | + obj[item] = { required: true, message: '参数 ' + item + " 不能为空", trigger: "change" }; | |
| 303 | + return obj; | |
| 304 | + }, {}); | |
| 305 | + // 设置打开 | |
| 306 | + this.sendNotifyOpen = true; | |
| 307 | + }, | |
| 308 | + /** 重置发送站内信的表单 */ | |
| 309 | + resetSendNotify() { | |
| 310 | + // 根据 row 重置表单 | |
| 311 | + this.sendNotifyForm = { | |
| 312 | + content: undefined, | |
| 313 | + params: undefined, | |
| 314 | + userId: undefined, | |
| 315 | + templateCode: undefined, | |
| 316 | + templateParams: {} | |
| 317 | + }; | |
| 318 | + this.resetForm("sendNotifyForm"); | |
| 319 | + }, | |
| 320 | + /** 取消发送站内信 */ | |
| 321 | + cancelSendNotify() { | |
| 322 | + this.sendNotifyOpen = false; | |
| 323 | + this.resetSendNotify(); | |
| 324 | + }, | |
| 325 | + /** 提交按钮 */ | |
| 326 | + submitSendNotifyForm() { | |
| 327 | + this.$refs["sendNotifyForm"].validate(valid => { | |
| 328 | + if (!valid) { | |
| 329 | + return; | |
| 330 | + } | |
| 331 | + // 添加的提交 | |
| 332 | + sendNotify(this.sendNotifyForm).then(response => { | |
| 333 | + this.$modal.msgSuccess("提交发送成功!发送结果,见发送日志编号:" + response.data); | |
| 334 | + this.sendNotifyOpen = false; | |
| 335 | + }); | |
| 336 | + }); | |
| 337 | + }, | |
| 338 | + } | |
| 339 | +}; | |
| 340 | +</script> | ... | ... |
yudao-ui-admin/src/views/system/oauth2/client/index.vue
yudao-ui-admin/src/views/system/oauth2/token/index.vue
| 1 | 1 | <template> |
| 2 | 2 | <div class="app-container"> |
| 3 | + <doc-alert title="OAuth 2.0(SSO 单点登录)" url="https://doc.iocoder.cn/oauth2/" /> | |
| 3 | 4 | <doc-alert title="用户体系" url="https://doc.iocoder.cn/user-center/" /> |
| 5 | + | |
| 4 | 6 | <!-- 搜索工作栏 --> |
| 5 | 7 | <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px"> |
| 6 | 8 | <el-form-item label="用户编号" prop="userId"> | ... | ... |
yudao-ui-admin/src/views/system/role/index.vue
| ... | ... | @@ -43,23 +43,23 @@ |
| 43 | 43 | <el-table-column label="角色名称" prop="name" :show-overflow-tooltip="true" width="150" /> |
| 44 | 44 | <el-table-column label="角色标识" prop="code" :show-overflow-tooltip="true" width="150" /> |
| 45 | 45 | <el-table-column label="角色类型" prop="type" width="80"> |
| 46 | - <template slot-scope="scope"> | |
| 46 | + <template v-slot="scope"> | |
| 47 | 47 | <dict-tag :type="DICT_TYPE.SYSTEM_ROLE_TYPE" :value="scope.row.type"/> |
| 48 | 48 | </template> |
| 49 | 49 | </el-table-column> |
| 50 | 50 | <el-table-column label="显示顺序" prop="sort" width="100" /> |
| 51 | 51 | <el-table-column label="状态" align="center" width="100"> |
| 52 | - <template slot-scope="scope"> | |
| 52 | + <template v-slot="scope"> | |
| 53 | 53 | <el-switch v-model="scope.row.status" :active-value="0" :inactive-value="1" @change="handleStatusChange(scope.row)"/> |
| 54 | 54 | </template> |
| 55 | 55 | </el-table-column> |
| 56 | 56 | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
| 57 | - <template slot-scope="scope"> | |
| 57 | + <template v-slot="scope"> | |
| 58 | 58 | <span>{{ parseTime(scope.row.createTime) }}</span> |
| 59 | 59 | </template> |
| 60 | 60 | </el-table-column> |
| 61 | 61 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 62 | - <template slot-scope="scope"> | |
| 62 | + <template v-slot="scope"> | |
| 63 | 63 | <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" |
| 64 | 64 | v-hasPermi="['system:role:update']">修改</el-button> |
| 65 | 65 | <el-button size="mini" type="text" icon="el-icon-circle-check" @click="handleMenu(scope.row)" | ... | ... |
yudao-ui-admin/src/views/system/sms/smsLog.vue
| ... | ... | @@ -94,7 +94,7 @@ |
| 94 | 94 | </el-table-column> |
| 95 | 95 | <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
| 96 | 96 | <template v-slot="scope"> |
| 97 | - <el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row,scope.index)" | |
| 97 | + <el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)" | |
| 98 | 98 | v-hasPermi="['system:sms-log:query']">详细</el-button> |
| 99 | 99 | </template> |
| 100 | 100 | </el-table-column> | ... | ... |
yudao-ui-admin/src/views/system/sms/smsTemplate.vue
| ... | ... | @@ -216,7 +216,7 @@ export default { |
| 216 | 216 | }, |
| 217 | 217 | sendSmsRules: { |
| 218 | 218 | mobile: [{ required: true, message: "手机不能为空", trigger: "blur" }], |
| 219 | - templateCode: [{ required: true, message: "手机不能为空", trigger: "blur" }], | |
| 219 | + templateCode: [{ required: true, message: "模版编码不能为空", trigger: "blur" }], | |
| 220 | 220 | templateParams: { } |
| 221 | 221 | } |
| 222 | 222 | }; | ... | ... |