Commit b697ee3298a51f7fa4c553bea3114cc236726a04
Merge remote-tracking branch 'yudao/feature/mall_product' into feature/mall_product
# Conflicts: # yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderServiceTest.java
Showing
105 changed files
with
890 additions
and
2044 deletions
Docker-HOWTO.md
| ... | ... | @@ -45,13 +45,11 @@ docker compose --env-file docker.env up -d |
| 45 | 45 | 第一次执行,由于数据库未初始化,因此yudao-server容器会运行失败。执行如下命令初始化数据库: |
| 46 | 46 | |
| 47 | 47 | ```shell |
| 48 | -docker exec -i yudao-mysql \ | |
| 49 | - sh -c 'exec mysql -uroot -p"$MYSQL_ROOT_PASSWORD" ruoyi-vue-pro' \ | |
| 48 | +docker compose exec -T mysql \ | |
| 49 | + sh -c 'exec mysql -uroot -p"$MYSQL_ROOT_PASSWORD" --default-character-set=utf8mb4 ruoyi-vue-pro' \ | |
| 50 | 50 | < ./sql/mysql/ruoyi-vue-pro.sql |
| 51 | 51 | ``` |
| 52 | 52 | |
| 53 | -注意:这里用docker compose exec 会出现 `the input device is not a TTY` 报错 | |
| 54 | - | |
| 55 | 53 | ## Server:Port |
| 56 | 54 | |
| 57 | 55 | - admin: http://localhost:8080 | ... | ... |
README.md
| ... | ... | @@ -249,7 +249,7 @@ ps:核心功能已经实现,正在对接微信小程序中... |
| 249 | 249 | |
| 250 | 250 | | 框架 | 说明 | 版本 | 学习指南 | |
| 251 | 251 | |---------------------------------------------------------------------------------------------|------------------|-------------|----------------------------------------------------------------| |
| 252 | -| [Spring Boot](https://spring.io/projects/spring-boot) | 应用开发框架 | 2.7.11 | [文档](https://github.com/YunaiV/SpringBoot-Labs) | | |
| 252 | +| [Spring Boot](https://spring.io/projects/spring-boot) | 应用开发框架 | 2.7.12 | [文档](https://github.com/YunaiV/SpringBoot-Labs) | | |
| 253 | 253 | | [MySQL](https://www.mysql.com/cn/) | 数据库服务器 | 5.7 / 8.0+ | | |
| 254 | 254 | | [Druid](https://github.com/alibaba/druid) | JDBC 连接池、监控组件 | 1.2.16 | [文档](http://www.iocoder.cn/Spring-Boot/datasource-pool/?yudao) | |
| 255 | 255 | | [MyBatis Plus](https://mp.baomidou.com/) | MyBatis 增强工具包 | 3.5.3.1 | [文档](http://www.iocoder.cn/Spring-Boot/MyBatis/?yudao) | | ... | ... |
pom.xml
| ... | ... | @@ -39,7 +39,7 @@ |
| 39 | 39 | <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version> |
| 40 | 40 | <!-- 看看咋放到 bom 里 --> |
| 41 | 41 | <lombok.version>1.18.26</lombok.version> |
| 42 | - <spring.boot.version>2.7.11</spring.boot.version> | |
| 42 | + <spring.boot.version>2.7.12</spring.boot.version> | |
| 43 | 43 | <mapstruct.version>1.5.5.Final</mapstruct.version> |
| 44 | 44 | <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
| 45 | 45 | </properties> | ... | ... |
sql/mysql/point.sql renamed to sql/mysql/optional/member_point.sql
| ... | ... | @@ -11,7 +11,7 @@ |
| 11 | 11 | Target Server Version : 80030 |
| 12 | 12 | File Encoding : 65001 |
| 13 | 13 | |
| 14 | - Date: 10/06/2023 20:13:57 | |
| 14 | + Date: 28/06/2023 22:40:52 | |
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | 17 | SET NAMES utf8mb4; |
| ... | ... | @@ -22,27 +22,27 @@ SET FOREIGN_KEY_CHECKS = 0; |
| 22 | 22 | -- ---------------------------- |
| 23 | 23 | DROP TABLE IF EXISTS `member_point_config`; |
| 24 | 24 | CREATE TABLE `member_point_config` ( |
| 25 | - `id` int NOT NULL AUTO_INCREMENT COMMENT '自增主键', | |
| 26 | - `trade_deduct_enable` int DEFAULT NULL COMMENT '1 开启积分抵扣\n0 关闭积分抵扣', | |
| 27 | - `trade_deduct_unit_price` decimal(10,2) DEFAULT NULL COMMENT '积分抵扣,抵扣最低为分 以0.01表示 1积分抵扣0.01元(单位:元)', | |
| 28 | - `trade_deduct_max_price` bigint DEFAULT NULL COMMENT '积分抵扣最大值', | |
| 29 | - `trade_give_point` bigint DEFAULT NULL COMMENT '1元赠送多少分', | |
| 30 | - `create_time` datetime DEFAULT NULL COMMENT '创建时间', | |
| 31 | - `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '变更时间', | |
| 32 | - `tenant_id` varchar(255) DEFAULT NULL COMMENT '租户id', | |
| 33 | - `deleted` int DEFAULT '0' COMMENT '是否被删除 0 未删除 1已删除', | |
| 34 | - `creator` varchar(255) DEFAULT NULL COMMENT '创建人', | |
| 35 | - `updater` varchar(255) DEFAULT NULL COMMENT '更新人', | |
| 36 | - PRIMARY KEY (`id`) | |
| 37 | -) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='积分设置'; | |
| 25 | + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '自增主键', | |
| 26 | + `trade_deduct_enable` bit(1) DEFAULT NULL COMMENT '1 开启积分抵扣\n0 关闭积分抵扣', | |
| 27 | + `trade_deduct_unit_price` int DEFAULT NULL COMMENT '积分抵扣(单位:分)', | |
| 28 | + `trade_deduct_max_price` int DEFAULT NULL COMMENT '积分抵扣最大值', | |
| 29 | + `trade_give_point` bigint DEFAULT NULL COMMENT '1元赠送多少分', | |
| 30 | + `creator` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '创建人', | |
| 31 | + `create_time` datetime DEFAULT NULL COMMENT '创建时间', | |
| 32 | + `updater` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '更新人', | |
| 33 | + `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '变更时间', | |
| 34 | + `tenant_id` varchar(255) DEFAULT NULL COMMENT '租户id', | |
| 35 | + `deleted` bit(1) DEFAULT b'0' COMMENT '是否被删除 0 未删除 1已删除', | |
| 36 | + PRIMARY KEY (`id`) | |
| 37 | +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='会员积分配置表'; | |
| 38 | 38 | |
| 39 | 39 | -- ---------------------------- |
| 40 | 40 | -- Records of member_point_config |
| 41 | 41 | -- ---------------------------- |
| 42 | 42 | BEGIN; |
| 43 | -INSERT INTO `member_point_config` (`id`, `trade_deduct_enable`, `trade_deduct_unit_price`, `trade_deduct_max_price`, `trade_give_point`, `create_time`, `update_time`, `tenant_id`, `deleted`, `creator`, `updater`) VALUES (1, 1, 0.01, 10000, 1, '2023-06-10 10:57:22', '2023-06-10 03:06:58', '1', 1, '1', '1'); | |
| 44 | -INSERT INTO `member_point_config` (`id`, `trade_deduct_enable`, `trade_deduct_unit_price`, `trade_deduct_max_price`, `trade_give_point`, `create_time`, `update_time`, `tenant_id`, `deleted`, `creator`, `updater`) VALUES (2, 1, 0.01, 10000, 10, '2023-06-10 11:07:12', '2023-06-10 11:07:12', '1', 0, '1', '1'); | |
| 45 | -INSERT INTO `member_point_config` (`id`, `trade_deduct_enable`, `trade_deduct_unit_price`, `trade_deduct_max_price`, `trade_give_point`, `create_time`, `update_time`, `tenant_id`, `deleted`, `creator`, `updater`) VALUES (3, 1, 12.00, 12, 12, '2023-06-10 16:09:26', '2023-06-10 08:10:53', '1', 1, '1', '1'); | |
| 43 | +INSERT INTO `member_point_config` (`id`, `trade_deduct_enable`, `trade_deduct_unit_price`, `trade_deduct_max_price`, `trade_give_point`, `creator`, `create_time`, `updater`, `update_time`, `tenant_id`, `deleted`) VALUES (1, b'1', 0, 10000, 1, '1', '2023-06-10 10:57:22', '1', '2023-06-10 03:06:58', '1', b'1'); | |
| 44 | +INSERT INTO `member_point_config` (`id`, `trade_deduct_enable`, `trade_deduct_unit_price`, `trade_deduct_max_price`, `trade_give_point`, `creator`, `create_time`, `updater`, `update_time`, `tenant_id`, `deleted`) VALUES (2, b'1', 32, 10003, 1212, '1', '2023-06-10 11:07:12', '1', '2023-06-28 21:50:34', '1', b'0'); | |
| 45 | +INSERT INTO `member_point_config` (`id`, `trade_deduct_enable`, `trade_deduct_unit_price`, `trade_deduct_max_price`, `trade_give_point`, `creator`, `create_time`, `updater`, `update_time`, `tenant_id`, `deleted`) VALUES (3, b'1', 12, 12, 12, '1', '2023-06-10 16:09:26', '1', '2023-06-10 08:10:53', '1', b'1'); | |
| 46 | 46 | COMMIT; |
| 47 | 47 | |
| 48 | 48 | -- ---------------------------- |
| ... | ... | @@ -50,27 +50,27 @@ COMMIT; |
| 50 | 50 | -- ---------------------------- |
| 51 | 51 | DROP TABLE IF EXISTS `member_point_record`; |
| 52 | 52 | CREATE TABLE `member_point_record` ( |
| 53 | - `id` bigint NOT NULL AUTO_INCREMENT COMMENT '自增主键', | |
| 54 | - `biz_id` varchar(255) DEFAULT NULL COMMENT '业务编码', | |
| 55 | - `biz_type` varchar(255) DEFAULT NULL COMMENT '业务类型', | |
| 56 | - `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '1增加 0扣减', | |
| 57 | - `title` varchar(255) DEFAULT NULL COMMENT '积分标题', | |
| 58 | - `description` varchar(5000) DEFAULT NULL COMMENT '积分描述', | |
| 59 | - `point` int DEFAULT NULL COMMENT '积分', | |
| 60 | - `total_point` int NOT NULL COMMENT '变动后的积分', | |
| 61 | - `status` int DEFAULT NULL COMMENT '状态:1-订单创建,2-冻结期,3-完成,4-失效(订单退款)\n', | |
| 62 | - `user_id` int DEFAULT NULL COMMENT '用户id', | |
| 63 | - `freezing_time` datetime DEFAULT NULL COMMENT '冻结时间', | |
| 64 | - `thawing_time` datetime DEFAULT NULL COMMENT '解冻时间', | |
| 65 | - `create_time` datetime DEFAULT NULL COMMENT '发生时间', | |
| 66 | - `tenant_id` varchar(255) DEFAULT NULL COMMENT '租户', | |
| 67 | - `deleted` int DEFAULT '0' COMMENT '是否删除', | |
| 68 | - `creator` varchar(255) DEFAULT NULL COMMENT '创建用户', | |
| 69 | - `updater` varchar(255) DEFAULT NULL COMMENT '更新用户', | |
| 70 | - `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', | |
| 71 | - PRIMARY KEY (`id`), | |
| 72 | - KEY `index_userId` (`user_id`), | |
| 73 | - KEY `index_title` (`title`) USING BTREE | |
| 53 | + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '自增主键', | |
| 54 | + `biz_id` varchar(255) DEFAULT NULL COMMENT '业务编码', | |
| 55 | + `biz_type` varchar(255) DEFAULT NULL COMMENT '业务类型', | |
| 56 | + `type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '1增加 0扣减', | |
| 57 | + `title` varchar(255) DEFAULT NULL COMMENT '积分标题', | |
| 58 | + `description` varchar(5000) DEFAULT NULL COMMENT '积分描述', | |
| 59 | + `point` int DEFAULT NULL COMMENT '积分', | |
| 60 | + `total_point` int NOT NULL COMMENT '变动后的积分', | |
| 61 | + `status` int DEFAULT NULL COMMENT '状态:1-订单创建,2-冻结期,3-完成,4-失效(订单退款)\n', | |
| 62 | + `user_id` int DEFAULT NULL COMMENT '用户id', | |
| 63 | + `freezing_time` datetime DEFAULT NULL COMMENT '冻结时间', | |
| 64 | + `thawing_time` datetime DEFAULT NULL COMMENT '解冻时间', | |
| 65 | + `create_time` datetime DEFAULT NULL COMMENT '发生时间', | |
| 66 | + `tenant_id` varchar(255) DEFAULT NULL COMMENT '租户', | |
| 67 | + `deleted` int DEFAULT '0' COMMENT '是否删除', | |
| 68 | + `creator` varchar(255) DEFAULT NULL COMMENT '创建用户', | |
| 69 | + `updater` varchar(255) DEFAULT NULL COMMENT '更新用户', | |
| 70 | + `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', | |
| 71 | + PRIMARY KEY (`id`), | |
| 72 | + KEY `index_userId` (`user_id`), | |
| 73 | + KEY `index_title` (`title`) USING BTREE | |
| 74 | 74 | ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户积分记录'; |
| 75 | 75 | |
| 76 | 76 | -- ---------------------------- |
| ... | ... | @@ -87,16 +87,16 @@ COMMIT; |
| 87 | 87 | -- ---------------------------- |
| 88 | 88 | DROP TABLE IF EXISTS `member_sign_in_config`; |
| 89 | 89 | CREATE TABLE `member_sign_in_config` ( |
| 90 | - `id` int NOT NULL AUTO_INCREMENT COMMENT '规则自增主键', | |
| 91 | - `day` int DEFAULT NULL COMMENT '签到第x天', | |
| 92 | - `point` int DEFAULT NULL COMMENT '签到天数对应分数', | |
| 93 | - `create_time` datetime DEFAULT NULL COMMENT '创建时间', | |
| 94 | - `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '变更时间', | |
| 95 | - `tenant_id` varchar(255) DEFAULT NULL COMMENT '租户id', | |
| 96 | - `deleted` int DEFAULT '0' COMMENT '是否删除', | |
| 97 | - `creator` varchar(255) DEFAULT NULL COMMENT '创建人', | |
| 98 | - `updater` varchar(255) DEFAULT NULL COMMENT '变更人', | |
| 99 | - PRIMARY KEY (`id`) | |
| 90 | + `id` int NOT NULL AUTO_INCREMENT COMMENT '规则自增主键', | |
| 91 | + `day` int DEFAULT NULL COMMENT '签到第x天', | |
| 92 | + `point` int DEFAULT NULL COMMENT '签到天数对应分数', | |
| 93 | + `create_time` datetime DEFAULT NULL COMMENT '创建时间', | |
| 94 | + `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '变更时间', | |
| 95 | + `tenant_id` varchar(255) DEFAULT NULL COMMENT '租户id', | |
| 96 | + `deleted` int DEFAULT '0' COMMENT '是否删除', | |
| 97 | + `creator` varchar(255) DEFAULT NULL COMMENT '创建人', | |
| 98 | + `updater` varchar(255) DEFAULT NULL COMMENT '变更人', | |
| 99 | + PRIMARY KEY (`id`) | |
| 100 | 100 | ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='积分签到规则'; |
| 101 | 101 | |
| 102 | 102 | -- ---------------------------- |
| ... | ... | @@ -115,17 +115,17 @@ COMMIT; |
| 115 | 115 | -- ---------------------------- |
| 116 | 116 | DROP TABLE IF EXISTS `member_sign_in_record`; |
| 117 | 117 | CREATE TABLE `member_sign_in_record` ( |
| 118 | - `id` bigint NOT NULL AUTO_INCREMENT COMMENT '签到自增id', | |
| 119 | - `user_id` int DEFAULT NULL COMMENT '签到用户', | |
| 120 | - `day` int DEFAULT NULL COMMENT '第几天签到', | |
| 121 | - `point` int DEFAULT NULL COMMENT '签到的分数', | |
| 122 | - `create_time` datetime DEFAULT NULL COMMENT '签到时间', | |
| 123 | - `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '变更时间', | |
| 124 | - `tenant_id` varchar(255) DEFAULT NULL COMMENT '租户id', | |
| 125 | - `deleted` int DEFAULT '0' COMMENT '是否删除', | |
| 126 | - `creator` varchar(255) DEFAULT NULL COMMENT '创建人', | |
| 127 | - `updater` varchar(255) DEFAULT NULL COMMENT '更新人', | |
| 128 | - PRIMARY KEY (`id`) | |
| 118 | + `id` bigint NOT NULL AUTO_INCREMENT COMMENT '签到自增id', | |
| 119 | + `user_id` int DEFAULT NULL COMMENT '签到用户', | |
| 120 | + `day` int DEFAULT NULL COMMENT '第几天签到', | |
| 121 | + `point` int DEFAULT NULL COMMENT '签到的分数', | |
| 122 | + `create_time` datetime DEFAULT NULL COMMENT '签到时间', | |
| 123 | + `update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '变更时间', | |
| 124 | + `tenant_id` varchar(255) DEFAULT NULL COMMENT '租户id', | |
| 125 | + `deleted` int DEFAULT '0' COMMENT '是否删除', | |
| 126 | + `creator` varchar(255) DEFAULT NULL COMMENT '创建人', | |
| 127 | + `updater` varchar(255) DEFAULT NULL COMMENT '更新人', | |
| 128 | + PRIMARY KEY (`id`) | |
| 129 | 129 | ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户签到积分'; |
| 130 | 130 | |
| 131 | 131 | -- ---------------------------- |
| ... | ... | @@ -138,15 +138,37 @@ INSERT INTO `member_sign_in_record` (`id`, `user_id`, `day`, `point`, `create_ti |
| 138 | 138 | INSERT INTO `member_sign_in_record` (`id`, `user_id`, `day`, `point`, `create_time`, `update_time`, `tenant_id`, `deleted`, `creator`, `updater`) VALUES (4, 12, 12, 1212, '2023-06-10 20:01:27', '2023-06-10 20:01:27', '1', 0, '1', '1'); |
| 139 | 139 | COMMIT; |
| 140 | 140 | |
| 141 | -SET FOREIGN_KEY_CHECKS = 1; | |
| 142 | - | |
| 143 | 141 | |
| 144 | -INSERT INTO `mall`.`system_dict_type` ( `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES ( '积分业务类型', 'point_biz_type', 0, '', '1', '2023-06-10 12:15:00', '1', '2023-06-10 04:25:07', b'0', '1970-01-01 00:00:00'); | |
| 145 | -INSERT INTO `mall`.`system_dict_type` ( `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES ( '积分订单状态', 'point_status', 0, '', '1', '2023-06-10 12:16:27', '1', '2023-06-10 12:16:27', b'0', '1970-01-01 00:00:00'); | |
| 142 | +INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (170, '积分业务类型', 'member_point_biz_type', 0, '', '1', '2023-06-10 12:15:00', '1', '2023-06-28 13:48:20', b'0', '1970-01-01 00:00:00'); | |
| 143 | +INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (171, '积分订单状态', 'member_point_status', 0, '', '1', '2023-06-10 12:16:27', '1', '2023-06-28 13:48:17', b'0', '1970-01-01 00:00:00'); | |
| 144 | +INSERT INTO `system_dict_type` (`id`, `name`, `type`, `status`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `deleted_time`) VALUES (169, '是否抵扣积分', 'trade_deduct_enable', 0, NULL, '1', '2023-06-10 00:34:12', '1', '2023-06-10 04:14:20', b'1', '2023-06-10 12:14:20'); | |
| 145 | + | |
| 146 | +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 (1235, 1, '购物', '1', 'member_point_biz_type', 0, '', '', '', '1', '2023-06-10 12:15:27', '1', '2023-06-28 13:48:28', b'0'); | |
| 147 | +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 (1236, 2, '签到', '2', 'member_point_biz_type', 0, '', '', '', '1', '2023-06-10 12:15:48', '1', '2023-06-28 13:48:31', b'0'); | |
| 148 | +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 (1237, 1, '订单创建', '1', 'member_point_status', 0, '', '', '', '1', '2023-06-10 12:16:42', '1', '2023-06-28 13:48:34', b'0'); | |
| 149 | +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 (1238, 2, '冻结期', '2', 'member_point_status', 0, '', '', '', '1', '2023-06-10 12:16:58', '1', '2023-06-28 13:48:36', b'0'); | |
| 150 | +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 (1239, 3, '完成', '3', 'member_point_status', 0, '', '', '', '1', '2023-06-10 12:17:07', '1', '2023-06-28 13:48:38', b'0'); | |
| 151 | +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 (1240, 4, '失效(订单退款)', '4', 'member_point_status', 0, '', '', '', '1', '2023-06-10 12:17:21', '1', '2023-06-28 13:48:42', b'0'); | |
| 152 | + | |
| 153 | + | |
| 154 | +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2162, '会员中心', '', 1, 55, 0, '/member', 'date-range', NULL, NULL, 0, b'1', b'1', b'1', '1', '2023-06-10 00:42:03', '1', '2023-06-28 21:52:34', b'0'); | |
| 155 | +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2175, '积分配置', '', 2, 0, 2199, 'config', '', 'member/point/config/index', 'PointConfig', 0, b'1', b'1', b'1', '', '2023-06-10 02:07:44', '1', '2023-06-27 22:50:59', b'0'); | |
| 156 | +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2176, '积分设置查询', 'point:config:query', 3, 1, 2175, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 02:07:44', '', '2023-06-10 02:07:44', b'0'); | |
| 157 | +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2177, '积分设置创建', 'point:config:save', 3, 2, 2175, '', '', '', '', 0, b'1', b'1', b'1', '', '2023-06-10 02:07:44', '1', '2023-06-27 20:32:31', b'0'); | |
| 158 | +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2181, '签到配置', '', 2, 2, 2200, 'sign-in-config', '', 'member/signin/config/index', 'SignInConfig', 0, b'1', b'1', b'1', '', '2023-06-10 03:26:12', '1', '2023-06-27 22:51:45', b'0'); | |
| 159 | +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2182, '积分签到规则查询', 'point:sign-in-config:query', 3, 1, 2181, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 03:26:12', '', '2023-06-10 03:26:12', b'0'); | |
| 160 | +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2183, '积分签到规则创建', 'point:sign-in-config:create', 3, 2, 2181, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 03:26:12', '', '2023-06-10 03:26:12', b'0'); | |
| 161 | +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2184, '积分签到规则更新', 'point:sign-in-config:update', 3, 3, 2181, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 03:26:12', '', '2023-06-10 03:26:12', b'0'); | |
| 162 | +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2185, '积分签到规则删除', 'point:sign-in-config:delete', 3, 4, 2181, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 03:26:12', '', '2023-06-10 03:26:12', b'0'); | |
| 163 | +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2186, '积分签到规则导出', 'point:sign-in-config:export', 3, 5, 2181, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 03:26:12', '', '2023-06-10 03:26:12', b'0'); | |
| 164 | +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2187, '积分记录', '', 2, 1, 2199, 'record', '', 'member/point/record/index', 'PointRecord', 0, b'1', b'1', b'1', '', '2023-06-10 04:18:50', '1', '2023-06-27 22:51:07', b'0'); | |
| 165 | +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2188, '用户积分记录查询', 'point:record:query', 3, 1, 2187, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 04:18:50', '', '2023-06-10 04:18:50', b'0'); | |
| 166 | +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2192, '用户积分记录导出', 'point:record:export', 3, 5, 2187, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 04:18:50', '', '2023-06-10 04:18:50', b'0'); | |
| 167 | +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2193, '签到记录', '', 2, 3, 2200, 'sign-in-record', '', 'member/signin/record/index', 'SignInRecord', 0, b'1', b'1', b'1', '', '2023-06-10 04:48:22', '1', '2023-06-27 22:51:54', b'0'); | |
| 168 | +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2194, '用户签到积分查询', 'point:sign-in-record:query', 3, 1, 2193, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 04:48:22', '', '2023-06-10 04:48:22', b'0'); | |
| 169 | +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2197, '用户签到积分删除', 'point:sign-in-record:delete', 3, 4, 2193, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 04:48:22', '', '2023-06-10 04:48:22', b'0'); | |
| 170 | +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2198, '用户签到积分导出', 'point:sign-in-record:export', 3, 5, 2193, '', '', '', NULL, 0, b'1', b'1', b'1', '', '2023-06-10 04:48:22', '', '2023-06-10 04:48:22', b'0'); | |
| 171 | +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2199, '会员积分', '', 1, 1, 2162, 'point', '', '', '', 0, b'1', b'1', b'1', '1', '2023-06-27 22:48:51', '1', '2023-06-27 22:48:51', b'0'); | |
| 172 | +INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES (2200, '会员签到', '', 1, 2, 2162, 'signin', '', '', '', 0, b'1', b'1', b'1', '1', '2023-06-27 22:49:53', '1', '2023-06-27 22:49:53', b'0'); | |
| 146 | 173 | |
| 147 | -INSERT INTO `mall`.`system_dict_data` ( `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( 1, '购物', '1', 'point_biz_type', 0, '', '', '', '1', '2023-06-10 12:15:27', '1', '2023-06-10 04:25:15', b'0'); | |
| 148 | -INSERT INTO `mall`.`system_dict_data` ( `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( 2, '签到', '2', 'point_biz_type', 0, '', '', '', '1', '2023-06-10 12:15:48', '1', '2023-06-10 04:25:18', b'0'); | |
| 149 | -INSERT INTO `mall`.`system_dict_data` ( `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( 1, '订单创建', '1', 'point_status', 0, '', '', '', '1', '2023-06-10 12:16:42', '1', '2023-06-10 12:16:42', b'0'); | |
| 150 | -INSERT INTO `mall`.`system_dict_data` ( `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( 2, '冻结期', '2', 'point_status', 0, '', '', '', '1', '2023-06-10 12:16:58', '1', '2023-06-10 12:16:58', b'0'); | |
| 151 | -INSERT INTO `mall`.`system_dict_data` ( `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( 3, '完成', '3', 'point_status', 0, '', '', '', '1', '2023-06-10 12:17:07', '1', '2023-06-10 12:17:07', b'0'); | |
| 152 | -INSERT INTO `mall`.`system_dict_data` ( `sort`, `label`, `value`, `dict_type`, `status`, `color_type`, `css_class`, `remark`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES ( 4, '失效(订单退款)', '4', 'point_status', 0, '', '', '', '1', '2023-06-10 12:17:21', '1', '2023-06-10 12:17:21', b'0'); | |
| 174 | +SET FOREIGN_KEY_CHECKS = 1; | ... | ... |
sql/postgresql/ruoyi-vue-pro.sql
| ... | ... | @@ -2405,6 +2405,10 @@ INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "st |
| 2405 | 2405 | INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1158, 3, 'implicit', 'implicit', 'system_oauth2_grant_type', 0, 'success', '', '简化模式', '1', '2022-05-12 00:23:40', '1', '2022-05-11 16:26:05', 0); |
| 2406 | 2406 | INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1159, 4, 'client_credentials', 'client_credentials', 'system_oauth2_grant_type', 0, 'default', '', '客户端模式', '1', '2022-05-12 00:23:51', '1', '2022-05-11 16:26:08', 0); |
| 2407 | 2407 | INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1160, 5, 'refresh_token', 'refresh_token', 'system_oauth2_grant_type', 0, 'info', '', '刷新模式', '1', '2022-05-12 00:24:02', '1', '2022-05-11 16:26:11', 0); |
| 2408 | +INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1161, 4, 'Vue 3 Vben', '30', 'infra_codegen_front_type', 0, '', '', '', '1', '2023-06-14 15:24:37.447', '1', '2023-06-14 15:24:37.447', 0); | |
| 2409 | +INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1162, 3, 'Vue 3 Schema', '21', 'infra_codegen_front_type', 0, '', '', 'Vue 3 Element Plus Schema', '1', '2023-06-14 15:24:18.714', '1', '2023-06-14 15:36:40.317', 0); | |
| 2410 | +INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1163, 2, 'Vue 3', '20', 'infra_codegen_front_type', 0, '', '', 'Vue 3 Element Plus', '1', '2023-06-14 15:24:05.654', '1', '2023-06-14 15:24:05.654', 0); | |
| 2411 | +INSERT INTO "system_dict_data" ("id", "sort", "label", "value", "dict_type", "status", "color_type", "css_class", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (1164, 1, 'Vue 2', '10', 'infra_codegen_front_type', 0, '', '', 'Vue 2', '1', '2023-06-14 15:23:12.211', '1', '2023-06-14 15:23:57.816', 0); | |
| 2408 | 2412 | COMMIT; |
| 2409 | 2413 | |
| 2410 | 2414 | -- ---------------------------- |
| ... | ... | @@ -2500,6 +2504,7 @@ INSERT INTO "system_dict_type" ("id", "name", "type", "status", "remark", "creat |
| 2500 | 2504 | INSERT INTO "system_dict_type" ("id", "name", "type", "status", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (145, '角色类型', 'system_role_type', 0, '角色类型', '1', '2022-02-16 13:01:46', '1', '2022-02-16 13:01:46', 0); |
| 2501 | 2505 | INSERT INTO "system_dict_type" ("id", "name", "type", "status", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (146, '文件存储器', 'infra_file_storage', 0, '文件存储器', '1', '2022-03-15 00:24:38', '1', '2022-03-15 00:24:38', 0); |
| 2502 | 2506 | INSERT INTO "system_dict_type" ("id", "name", "type", "status", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (147, 'OAuth 2.0 授权类型', 'system_oauth2_grant_type', 0, 'OAuth 2.0 授权类型(模式)', '1', '2022-05-12 00:20:52', '1', '2022-05-11 16:25:49', 0); |
| 2507 | +INSERT INTO "system_dict_type" ("id", "name", "type", "status", "remark", "creator", "create_time", "updater", "update_time", "deleted") VALUES (148, '生成前端代码类型', 'infra_codegen_front_type', 0, '生成前端代码类型', '1', '2023-6-14 16:07:35', '1', '2023-6-14 16:07:39', 0); | |
| 2503 | 2508 | COMMIT; |
| 2504 | 2509 | |
| 2505 | 2510 | -- ---------------------------- |
| ... | ... | @@ -2589,7 +2594,7 @@ COMMIT; |
| 2589 | 2594 | -- ---------------------------- |
| 2590 | 2595 | DROP TABLE IF EXISTS "system_menu"; |
| 2591 | 2596 | CREATE TABLE "system_menu" ( |
| 2592 | - "id" int8 NOT NULL, | |
| 2597 | + "id" int8 NOT NULL DEFAULT nextval('system_menu_seq'::regclass), | |
| 2593 | 2598 | "name" varchar(50) COLLATE "pg_catalog"."default" NOT NULL, |
| 2594 | 2599 | "permission" varchar(100) COLLATE "pg_catalog"."default" NOT NULL, |
| 2595 | 2600 | "type" int2 NOT NULL, |
| ... | ... | @@ -2599,15 +2604,15 @@ CREATE TABLE "system_menu" ( |
| 2599 | 2604 | "icon" varchar(100) COLLATE "pg_catalog"."default", |
| 2600 | 2605 | "component" varchar(255) COLLATE "pg_catalog"."default", |
| 2601 | 2606 | "status" int2 NOT NULL, |
| 2602 | - "visible" bool NOT NULL, | |
| 2603 | - "keep_alive" bool NOT NULL, | |
| 2607 | + "visible" bool NOT NULL DEFAULT true, | |
| 2608 | + "keep_alive" bool NOT NULL DEFAULT false, | |
| 2604 | 2609 | "creator" varchar(64) COLLATE "pg_catalog"."default", |
| 2605 | - "create_time" timestamp(6) NOT NULL, | |
| 2610 | + "create_time" timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), | |
| 2606 | 2611 | "updater" varchar(64) COLLATE "pg_catalog"."default", |
| 2607 | - "update_time" timestamp(6) NOT NULL, | |
| 2612 | + "update_time" timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), | |
| 2608 | 2613 | "deleted" int2 NOT NULL DEFAULT 0, |
| 2609 | 2614 | "component_name" varchar(255) COLLATE "pg_catalog"."default", |
| 2610 | - "always_show" char(1) COLLATE "pg_catalog"."default" | |
| 2615 | + "always_show" bool NOT NULL DEFAULT false | |
| 2611 | 2616 | ) |
| 2612 | 2617 | ; |
| 2613 | 2618 | COMMENT ON COLUMN "system_menu"."id" IS '菜单ID'; |
| ... | ... | @@ -2738,19 +2743,19 @@ INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_i |
| 2738 | 2743 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1091, '文件查询', 'infra:file:query', 3, 1, 1090, '', '', '', 0, 't', 't', '', '2021-03-12 20:16:20', '', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2739 | 2744 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1092, '文件删除', 'infra:file:delete', 3, 4, 1090, '', '', '', 0, 't', 't', '', '2021-03-12 20:16:20', '', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2740 | 2745 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1093, '短信管理', '', 1, 11, 1, 'sms', 'validCode', NULL, 0, 't', 't', '1', '2021-04-05 01:10:16', '1', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2741 | -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1094, '短信渠道', '', 2, 0, 1093, 'sms-channel', 'phone', 'system/sms/smsChannel', 0, 't', 't', '', '2021-04-01 11:07:15', '1', '2022-04-20 17:03:10', 0, NULL, '1'); | |
| 2746 | +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1094, '短信渠道', '', 2, 0, 1093, 'sms-channel', 'phone', 'system/sms/channel', 0, 't', 't', '', '2021-04-01 11:07:15', '1', '2022-04-20 17:03:10', 0, NULL, '1'); | |
| 2742 | 2747 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1095, '短信渠道查询', 'system:sms-channel:query', 3, 1, 1094, '', '', '', 0, 't', 't', '', '2021-04-01 11:07:15', '', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2743 | 2748 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1096, '短信渠道创建', 'system:sms-channel:create', 3, 2, 1094, '', '', '', 0, 't', 't', '', '2021-04-01 11:07:15', '', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2744 | 2749 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1097, '短信渠道更新', 'system:sms-channel:update', 3, 3, 1094, '', '', '', 0, 't', 't', '', '2021-04-01 11:07:15', '', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2745 | 2750 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1098, '短信渠道删除', 'system:sms-channel:delete', 3, 4, 1094, '', '', '', 0, 't', 't', '', '2021-04-01 11:07:15', '', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2746 | -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1100, '短信模板', '', 2, 1, 1093, 'sms-template', 'phone', 'system/sms/smsTemplate', 0, 't', 't', '', '2021-04-01 17:35:17', '1', '2022-04-20 17:03:10', 0, NULL, '1'); | |
| 2751 | +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1100, '短信模板', '', 2, 1, 1093, 'sms-template', 'phone', 'system/sms/template', 0, 't', 't', '', '2021-04-01 17:35:17', '1', '2022-04-20 17:03:10', 0, NULL, '1'); | |
| 2747 | 2752 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1101, '短信模板查询', 'system:sms-template:query', 3, 1, 1100, '', '', '', 0, 't', 't', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2748 | 2753 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1102, '短信模板创建', 'system:sms-template:create', 3, 2, 1100, '', '', '', 0, 't', 't', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2749 | 2754 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1103, '短信模板更新', 'system:sms-template:update', 3, 3, 1100, '', '', '', 0, 't', 't', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2750 | 2755 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1104, '短信模板删除', 'system:sms-template:delete', 3, 4, 1100, '', '', '', 0, 't', 't', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2751 | 2756 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1105, '短信模板导出', 'system:sms-template:export', 3, 5, 1100, '', '', '', 0, 't', 't', '', '2021-04-01 17:35:17', '', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2752 | 2757 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1106, '发送测试短信', 'system:sms-template:send-sms', 3, 6, 1100, '', '', '', 0, 't', 't', '1', '2021-04-11 00:26:40', '1', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2753 | -INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1107, '短信日志', '', 2, 2, 1093, 'sms-log', 'phone', 'system/sms/smsLog', 0, 't', 't', '', '2021-04-11 08:37:05', '1', '2022-04-20 17:03:10', 0, NULL, '1'); | |
| 2758 | +INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1107, '短信日志', '', 2, 2, 1093, 'sms-log', 'phone', 'system/sms/log', 0, 't', 't', '', '2021-04-11 08:37:05', '1', '2022-04-20 17:03:10', 0, NULL, '1'); | |
| 2754 | 2759 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1108, '短信日志查询', 'system:sms-log:query', 3, 1, 1107, '', '', '', 0, 't', 't', '', '2021-04-11 08:37:05', '', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2755 | 2760 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1109, '短信日志导出', 'system:sms-log:export', 3, 5, 1107, '', '', '', 0, 't', 't', '', '2021-04-11 08:37:05', '', '2022-04-20 17:03:10', 0, NULL, '1'); |
| 2756 | 2761 | INSERT INTO "system_menu" ("id", "name", "permission", "type", "sort", "parent_id", "path", "icon", "component", "status", "visible", "keep_alive", "creator", "create_time", "updater", "update_time", "deleted", "component_name", "always_show") VALUES (1110, '错误码管理', '', 2, 12, 1, 'error-code', 'code', 'system/errorCode/index', 0, 't', 't', '', '2021-04-13 21:46:42', '1', '2022-04-20 17:03:10', 0, NULL, '1'); |
| ... | ... | @@ -4239,7 +4244,7 @@ CREATE TABLE "system_notify_message" ( |
| 4239 | 4244 | "template_content" varchar(1024) COLLATE "pg_catalog"."default" NOT NULL, |
| 4240 | 4245 | "template_type" int4 NOT NULL, |
| 4241 | 4246 | "template_params" varchar(255) COLLATE "pg_catalog"."default" NOT NULL, |
| 4242 | - "read_status" varchar(1) COLLATE "pg_catalog"."default" NOT NULL, | |
| 4247 | + "read_status" bool NOT NULL DEFAULT false, | |
| 4243 | 4248 | "read_time" timestamp(6), |
| 4244 | 4249 | "creator" varchar(64) COLLATE "pg_catalog"."default", |
| 4245 | 4250 | "create_time" timestamp(6) NOT NULL, | ... | ... |
yudao-dependencies/pom.xml
| ... | ... | @@ -16,7 +16,7 @@ |
| 16 | 16 | <properties> |
| 17 | 17 | <revision>1.7.3-snapshot</revision> |
| 18 | 18 | <!-- 统一依赖管理 --> |
| 19 | - <spring.boot.version>2.7.11</spring.boot.version> | |
| 19 | + <spring.boot.version>2.7.12</spring.boot.version> | |
| 20 | 20 | <!-- Web 相关 --> |
| 21 | 21 | <springdoc.version>1.6.15</springdoc.version> |
| 22 | 22 | <knife4j.version>4.1.0</knife4j.version> |
| ... | ... | @@ -52,10 +52,10 @@ |
| 52 | 52 | <velocity.version>2.3</velocity.version> |
| 53 | 53 | <screw.version>1.0.5</screw.version> |
| 54 | 54 | <fastjson.version>1.2.83</fastjson.version> |
| 55 | - <guava.version>31.1-jre</guava.version> | |
| 55 | + <guava.version>32.0.0-jre</guava.version> | |
| 56 | 56 | <guice.version>5.1.0</guice.version> |
| 57 | 57 | <transmittable-thread-local.version>2.14.2</transmittable-thread-local.version> |
| 58 | - <commons-net.version>3.8.0</commons-net.version> | |
| 58 | + <commons-net.version>3.9.0</commons-net.version> | |
| 59 | 59 | <jsch.version>0.1.55</jsch.version> |
| 60 | 60 | <tika-core.version>2.7.0</tika-core.version> |
| 61 | 61 | <netty-all.version>4.1.90.Final</netty-all.version> |
| ... | ... | @@ -67,7 +67,7 @@ |
| 67 | 67 | <minio.version>8.5.2</minio.version> |
| 68 | 68 | <aliyun-java-sdk-core.version>4.6.3</aliyun-java-sdk-core.version> |
| 69 | 69 | <aliyun-java-sdk-dysmsapi.version>2.2.1</aliyun-java-sdk-dysmsapi.version> |
| 70 | - <tencentcloud-sdk-java.version>3.1.715</tencentcloud-sdk-java.version> | |
| 70 | + <tencentcloud-sdk-java.version>3.1.758</tencentcloud-sdk-java.version> | |
| 71 | 71 | <justauth.version>1.4.0</justauth.version> |
| 72 | 72 | <jimureport.version>1.5.6</jimureport.version> |
| 73 | 73 | <xercesImpl.version>2.12.2</xercesImpl.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.11</spring.boot.version> | |
| 24 | + <spring.boot.version>2.7.12</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.11</spring.boot.version> | |
| 24 | + <spring.boot.version>2.7.12</spring.boot.version> | |
| 25 | 25 | </properties> |
| 26 | 26 | |
| 27 | 27 | <dependencyManagement> | ... | ... |
yudao-framework/yudao-spring-boot-starter-biz-data-permission/src/main/java/cn/iocoder/yudao/framework/datapermission/core/rule/dept/DeptDataPermissionRule.java
| ... | ... | @@ -36,7 +36,7 @@ import java.util.Set; |
| 36 | 36 | * 注意,使用 DeptDataPermissionRule 时,需要保证表中有 dept_id 部门编号的字段,可自定义。 |
| 37 | 37 | * |
| 38 | 38 | * 实际业务场景下,会存在一个经典的问题?当用户修改部门时,冗余的 dept_id 是否需要修改? |
| 39 | - * 1. 一般情况下,dept_id 不进行修改,则会导致用户看到之前的数据。【yudao-server 采用该方案】 | |
| 39 | + * 1. 一般情况下,dept_id 不进行修改,则会导致用户看不到之前的数据。【yudao-server 采用该方案】 | |
| 40 | 40 | * 2. 部分情况下,希望该用户还是能看到之前的数据,则有两种方式解决:【需要你改造该 DeptDataPermissionRule 的实现代码】 |
| 41 | 41 | * 1)编写洗数据的脚本,将 dept_id 修改成新部门的编号;【建议】 |
| 42 | 42 | * 最终过滤条件是 WHERE dept_id = ? | ... | ... |
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/config/PayProperties.java
| ... | ... | @@ -23,13 +23,4 @@ public class PayProperties { |
| 23 | 23 | @URL(message = "回调地址的格式必须是 URL") |
| 24 | 24 | private String callbackUrl; |
| 25 | 25 | |
| 26 | - /** | |
| 27 | - * 回跳地址 | |
| 28 | - * | |
| 29 | - * 实际上,对应的 PayNotifyController 的 returnCallback 方法的 URL | |
| 30 | - */ | |
| 31 | - @URL(message = "回跳地址的格式必须是 URL") | |
| 32 | - @NotEmpty(message = "回跳地址不能为空") | |
| 33 | - private String returnUrl; | |
| 34 | - | |
| 35 | 26 | } | ... | ... |
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AlipayPcPayClient.java
| 1 | 1 | package cn.iocoder.yudao.framework.pay.core.client.impl.alipay; |
| 2 | 2 | |
| 3 | -import cn.hutool.core.map.MapUtil; | |
| 4 | -import cn.hutool.core.util.StrUtil; | |
| 3 | +import cn.hutool.core.util.ObjectUtil; | |
| 5 | 4 | import cn.hutool.http.Method; |
| 6 | 5 | import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedReqDTO; |
| 7 | 6 | import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedRespDTO; |
| ... | ... | @@ -41,11 +40,11 @@ public class AlipayPcPayClient extends AbstractAlipayClient { |
| 41 | 40 | model.setTimeExpire(formatTime(reqDTO.getExpireTime())); |
| 42 | 41 | model.setProductCode("FAST_INSTANT_TRADE_PAY"); // 销售产品码. 目前 PC 支付场景下仅支持 FAST_INSTANT_TRADE_PAY |
| 43 | 42 | // ② 个性化的参数 |
| 44 | - // 参考 https://www.pingxx.com/api/支付渠道 extra 参数说明.html 的 alipay_pc_direct 部分 | |
| 45 | - model.setQrPayMode(MapUtil.getStr(reqDTO.getChannelExtras(), "qr_pay_mode")); | |
| 46 | - model.setQrcodeWidth(MapUtil.getLong(reqDTO.getChannelExtras(), "qr_code_width")); | |
| 47 | - // ③ 支付宝 PC 支付有多种展示模式,因此这里需要计算 | |
| 48 | - String displayMode = getDisplayMode(reqDTO.getDisplayMode(), model.getQrPayMode()); | |
| 43 | + // 如果想弄更多个性化的参数,可参考 https://www.pingxx.com/api/支付渠道 extra 参数说明.html 的 alipay_pc_direct 部分进行拓展 | |
| 44 | + model.setQrPayMode("2"); // 跳转模式 - 订单码,效果参见:https://help.pingxx.com/article/1137360/ | |
| 45 | + // ③ 支付宝 PC 支付有两种展示模式:FORM、URL | |
| 46 | + String displayMode = ObjectUtil.defaultIfNull(reqDTO.getDisplayMode(), | |
| 47 | + PayDisplayModeEnum.URL.getMode()); | |
| 49 | 48 | |
| 50 | 49 | // 1.2 构建 AlipayTradePagePayRequest 请求 |
| 51 | 50 | AlipayTradePagePayRequest request = new AlipayTradePagePayRequest(); |
| ... | ... | @@ -67,25 +66,4 @@ public class AlipayPcPayClient extends AbstractAlipayClient { |
| 67 | 66 | .setDisplayContent(response.getBody()); |
| 68 | 67 | } |
| 69 | 68 | |
| 70 | - /** | |
| 71 | - * 获得最终的支付 UI 展示模式 | |
| 72 | - * | |
| 73 | - * @param displayMode 前端传递的 UI 展示模式 | |
| 74 | - * @param qrPayMode 前端传递的二维码模式 | |
| 75 | - * @return 最终的支付 UI 展示模式 | |
| 76 | - */ | |
| 77 | - private String getDisplayMode(String displayMode, String qrPayMode) { | |
| 78 | - // 1.1 支付宝二维码的前置模式 | |
| 79 | - if (StrUtil.equalsAny(qrPayMode, "0", "1", "3", "4")) { | |
| 80 | - return PayDisplayModeEnum.IFRAME.getMode(); | |
| 81 | - } | |
| 82 | - // 1.2 支付宝二维码的跳转模式 | |
| 83 | - if (StrUtil.equals(qrPayMode, "2")) { | |
| 84 | - return PayDisplayModeEnum.URL.getMode(); | |
| 85 | - } | |
| 86 | - // 2. 前端传递了 UI 展示模式 | |
| 87 | - return displayMode != null ? displayMode : | |
| 88 | - PayDisplayModeEnum.URL.getMode(); // 模式使用 URL 跳转 | |
| 89 | - } | |
| 90 | - | |
| 91 | 69 | } | ... | ... |
yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AlipayWapPayClient.java
| 1 | 1 | package cn.iocoder.yudao.framework.pay.core.client.impl.alipay; |
| 2 | 2 | |
| 3 | -import cn.hutool.core.util.ObjectUtil; | |
| 4 | 3 | import cn.hutool.http.Method; |
| 5 | 4 | import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedReqDTO; |
| 6 | 5 | import cn.iocoder.yudao.framework.pay.core.client.dto.order.PayOrderUnifiedRespDTO; |
| ... | ... | @@ -37,9 +36,8 @@ public class AlipayWapPayClient extends AbstractAlipayClient { |
| 37 | 36 | model.setTotalAmount(formatAmount(reqDTO.getAmount())); |
| 38 | 37 | model.setProductCode("QUICK_WAP_PAY"); // 销售产品码. 目前 Wap 支付场景下仅支持 QUICK_WAP_PAY |
| 39 | 38 | // ② 个性化的参数【无】 |
| 40 | - // ③ 支付宝 Wap 支付只有一种展示,考虑到前端可能希望二维码扫描后,手机打开 | |
| 41 | - String displayMode = ObjectUtil.defaultIfNull(reqDTO.getDisplayMode(), | |
| 42 | - PayDisplayModeEnum.URL.getMode()); | |
| 39 | + // ③ 支付宝 Wap 支付只有一种展示:URL | |
| 40 | + String displayMode = PayDisplayModeEnum.URL.getMode(); | |
| 43 | 41 | |
| 44 | 42 | // 1.2 构建 AlipayTradeWapPayRequest 请求 |
| 45 | 43 | AlipayTradeWapPayRequest request = new AlipayTradeWapPayRequest(); | ... | ... |
yudao-framework/yudao-spring-boot-starter-captcha/src/main/java/cn/iocoder/yudao/framework/captcha/config/YudaoCaptchaConfiguration.java
| ... | ... | @@ -3,11 +3,15 @@ package cn.iocoder.yudao.framework.captcha.config; |
| 3 | 3 | import cn.hutool.core.util.ClassUtil; |
| 4 | 4 | import cn.iocoder.yudao.framework.captcha.core.enums.CaptchaRedisKeyConstants; |
| 5 | 5 | import cn.iocoder.yudao.framework.captcha.core.service.RedisCaptchaServiceImpl; |
| 6 | +import com.xingyuv.captcha.properties.AjCaptchaProperties; | |
| 6 | 7 | import com.xingyuv.captcha.service.CaptchaCacheService; |
| 8 | +import com.xingyuv.captcha.service.impl.CaptchaServiceFactory; | |
| 7 | 9 | import org.springframework.boot.autoconfigure.AutoConfiguration; |
| 8 | 10 | import org.springframework.context.annotation.Bean; |
| 9 | 11 | import org.springframework.data.redis.core.StringRedisTemplate; |
| 10 | 12 | |
| 13 | +import javax.annotation.Resource; | |
| 14 | + | |
| 11 | 15 | @AutoConfiguration |
| 12 | 16 | public class YudaoCaptchaConfiguration { |
| 13 | 17 | |
| ... | ... | @@ -17,9 +21,17 @@ public class YudaoCaptchaConfiguration { |
| 17 | 21 | ClassUtil.loadClass(CaptchaRedisKeyConstants.class.getName()); |
| 18 | 22 | } |
| 19 | 23 | |
| 24 | + @Resource | |
| 25 | + private StringRedisTemplate stringRedisTemplate; | |
| 26 | + | |
| 20 | 27 | @Bean |
| 21 | - public CaptchaCacheService captchaCacheService(StringRedisTemplate stringRedisTemplate) { | |
| 22 | - return new RedisCaptchaServiceImpl(stringRedisTemplate); | |
| 28 | + public CaptchaCacheService captchaCacheService(AjCaptchaProperties config) { | |
| 29 | + // 缓存类型 redis/local/.... | |
| 30 | + CaptchaCacheService ret = CaptchaServiceFactory.getCache(config.getCacheType().name()); | |
| 31 | + if (ret instanceof RedisCaptchaServiceImpl) { | |
| 32 | + ((RedisCaptchaServiceImpl) ret).setStringRedisTemplate(stringRedisTemplate); | |
| 33 | + } | |
| 34 | + return ret; | |
| 23 | 35 | } |
| 24 | 36 | |
| 25 | 37 | } | ... | ... |
yudao-framework/yudao-spring-boot-starter-captcha/src/main/java/cn/iocoder/yudao/framework/captcha/core/service/RedisCaptchaServiceImpl.java
| ... | ... | @@ -25,6 +25,10 @@ public class RedisCaptchaServiceImpl implements CaptchaCacheService { |
| 25 | 25 | return "redis"; |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | + public void setStringRedisTemplate(StringRedisTemplate stringRedisTemplate) { | |
| 29 | + this.stringRedisTemplate = stringRedisTemplate; | |
| 30 | + } | |
| 31 | + | |
| 28 | 32 | @Override |
| 29 | 33 | public void set(String key, String value, long expiresInSeconds) { |
| 30 | 34 | stringRedisTemplate.opsForValue().set(key, value, expiresInSeconds, TimeUnit.SECONDS); | ... | ... |
yudao-framework/yudao-spring-boot-starter-mq/src/main/java/cn/iocoder/yudao/framework/mq/job/RedisPendingMessageResendJob.java
| ... | ... | @@ -7,17 +7,14 @@ import lombok.AllArgsConstructor; |
| 7 | 7 | import lombok.extern.slf4j.Slf4j; |
| 8 | 8 | import org.redisson.api.RLock; |
| 9 | 9 | import org.redisson.api.RedissonClient; |
| 10 | -import org.springframework.data.redis.connection.stream.Consumer; | |
| 11 | -import org.springframework.data.redis.connection.stream.MapRecord; | |
| 12 | -import org.springframework.data.redis.connection.stream.PendingMessagesSummary; | |
| 13 | -import org.springframework.data.redis.connection.stream.ReadOffset; | |
| 14 | -import org.springframework.data.redis.connection.stream.StreamOffset; | |
| 15 | -import org.springframework.data.redis.connection.stream.StreamRecords; | |
| 10 | +import org.springframework.data.domain.Range; | |
| 11 | +import org.springframework.data.redis.connection.stream.*; | |
| 16 | 12 | import org.springframework.data.redis.core.StreamOperations; |
| 17 | 13 | import org.springframework.scheduling.annotation.Scheduled; |
| 18 | 14 | |
| 19 | 15 | import java.util.List; |
| 20 | 16 | import java.util.Map; |
| 17 | +import java.util.Objects; | |
| 21 | 18 | |
| 22 | 19 | /** |
| 23 | 20 | * 这个任务用于处理,crash 之后的消费者未消费完的消息 |
| ... | ... | @@ -28,6 +25,14 @@ public class RedisPendingMessageResendJob { |
| 28 | 25 | |
| 29 | 26 | private static final String LOCK_KEY = "redis:pending:msg:lock"; |
| 30 | 27 | |
| 28 | + /** | |
| 29 | + * 消息超时时间,默认 5 分钟 | |
| 30 | + * | |
| 31 | + * 1. 超时的消息才会被重新投递 | |
| 32 | + * 2. 由于定时任务 1 分钟一次,消息超时后不会被立即重投,极端情况下消息5分钟过期后,再等 1 分钟才会被扫瞄到 | |
| 33 | + */ | |
| 34 | + private static final int EXPIRE_TIME = 5 * 60; | |
| 35 | + | |
| 31 | 36 | private final List<AbstractStreamMessageListener<?>> listeners; |
| 32 | 37 | private final RedisMQTemplate redisTemplate; |
| 33 | 38 | private final String groupName; |
| ... | ... | @@ -51,29 +56,44 @@ public class RedisPendingMessageResendJob { |
| 51 | 56 | } |
| 52 | 57 | } |
| 53 | 58 | |
| 59 | + /** | |
| 60 | + * 执行清理逻辑 | |
| 61 | + * | |
| 62 | + * @see <a href="https://gitee.com/zhijiantianya/ruoyi-vue-pro/pulls/480/files">讨论</a> | |
| 63 | + */ | |
| 54 | 64 | private void execute() { |
| 55 | 65 | StreamOperations<String, Object, Object> ops = redisTemplate.getRedisTemplate().opsForStream(); |
| 56 | 66 | listeners.forEach(listener -> { |
| 57 | - PendingMessagesSummary pendingMessagesSummary = ops.pending(listener.getStreamKey(), groupName); | |
| 67 | + PendingMessagesSummary pendingMessagesSummary = Objects.requireNonNull(ops.pending(listener.getStreamKey(), groupName)); | |
| 58 | 68 | // 每个消费者的 pending 队列消息数量 |
| 59 | 69 | Map<String, Long> pendingMessagesPerConsumer = pendingMessagesSummary.getPendingMessagesPerConsumer(); |
| 60 | 70 | pendingMessagesPerConsumer.forEach((consumerName, pendingMessageCount) -> { |
| 61 | 71 | log.info("[processPendingMessage][消费者({}) 消息数量({})]", consumerName, pendingMessageCount); |
| 62 | - | |
| 63 | - // 从消费者的 pending 队列中读取消息 | |
| 64 | - List<MapRecord<String, Object, Object>> records = ops.read(Consumer.from(groupName, consumerName), StreamOffset.create(listener.getStreamKey(), ReadOffset.from("0"))); | |
| 65 | - if (CollUtil.isEmpty(records)) { | |
| 72 | + // 每个消费者的 pending消息的详情信息 | |
| 73 | + PendingMessages pendingMessages = ops.pending(listener.getStreamKey(), Consumer.from(groupName, consumerName), Range.unbounded(), pendingMessageCount); | |
| 74 | + if (pendingMessages.isEmpty()) { | |
| 66 | 75 | return; |
| 67 | 76 | } |
| 68 | - for (MapRecord<String, Object, Object> record : records) { | |
| 77 | + pendingMessages.forEach(pendingMessage -> { | |
| 78 | + // 获取消息上一次传递到 consumer 的时间, | |
| 79 | + long lastDelivery = pendingMessage.getElapsedTimeSinceLastDelivery().getSeconds(); | |
| 80 | + if (lastDelivery < EXPIRE_TIME){ | |
| 81 | + return; | |
| 82 | + } | |
| 83 | + // 获取指定 id 的消息体 | |
| 84 | + List<MapRecord<String, Object, Object>> records = ops.range(listener.getStreamKey(), | |
| 85 | + Range.of(Range.Bound.inclusive(pendingMessage.getIdAsString()), Range.Bound.inclusive(pendingMessage.getIdAsString()))); | |
| 86 | + if (CollUtil.isEmpty(records)) { | |
| 87 | + return; | |
| 88 | + } | |
| 69 | 89 | // 重新投递消息 |
| 70 | 90 | redisTemplate.getRedisTemplate().opsForStream().add(StreamRecords.newRecord() |
| 71 | - .ofObject(record.getValue()) // 设置内容 | |
| 91 | + .ofObject(records.get(0).getValue()) // 设置内容 | |
| 72 | 92 | .withStreamKey(listener.getStreamKey())); |
| 73 | - | |
| 74 | 93 | // ack 消息消费完成 |
| 75 | - redisTemplate.getRedisTemplate().opsForStream().acknowledge(groupName, record); | |
| 76 | - } | |
| 94 | + redisTemplate.getRedisTemplate().opsForStream().acknowledge(groupName, records.get(0)); | |
| 95 | + log.info("[processPendingMessage][消息({})重新投递成功]", records.get(0).getId()); | |
| 96 | + }); | |
| 77 | 97 | }); |
| 78 | 98 | }); |
| 79 | 99 | } | ... | ... |
yudao-module-infra/yudao-module-infra-biz/src/main/resources/codegen/vue3_vben/views/data.ts.vm
| ... | ... | @@ -122,7 +122,7 @@ export const createFormSchema: FormSchema[] = [ |
| 122 | 122 | #end |
| 123 | 123 | } |
| 124 | 124 | #elseif($column.htmlType == "radio")## 单选框 |
| 125 | - component: 'Radio', | |
| 125 | + component: 'RadioButtonGroup', | |
| 126 | 126 | componentProps: { |
| 127 | 127 | #if ("" != $dictType)## 有数据字典 |
| 128 | 128 | options: getDictOptions(DICT_TYPE.$dictType.toUpperCase(), 'number') |
| ... | ... | @@ -188,7 +188,7 @@ export const updateFormSchema: FormSchema[] = [ |
| 188 | 188 | #end |
| 189 | 189 | } |
| 190 | 190 | #elseif($column.htmlType == "radio")## 单选框 |
| 191 | - component: 'Radio', | |
| 191 | + component: 'RadioButtonGroup', | |
| 192 | 192 | componentProps: { |
| 193 | 193 | #if ("" != $dictType)## 有数据字典 |
| 194 | 194 | options: getDictOptions(DICT_TYPE.$dictType.toUpperCase(), 'number') | ... | ... |
yudao-module-mall/yudao-module-trade-api/src/main/java/cn/iocoder/yudao/module/trade/enums/delivery/DeliveryTypeEnum.java
yudao-module-mall/yudao-module-trade-biz/pom.xml
| ... | ... | @@ -93,6 +93,10 @@ |
| 93 | 93 | <groupId>cn.iocoder.boot</groupId> |
| 94 | 94 | <artifactId>yudao-spring-boot-starter-excel</artifactId> |
| 95 | 95 | </dependency> |
| 96 | + <dependency> | |
| 97 | + <groupId>cn.iocoder.boot</groupId> | |
| 98 | + <artifactId>yudao-spring-boot-starter-biz-dict</artifactId> | |
| 99 | + </dependency> | |
| 96 | 100 | |
| 97 | 101 | </dependencies> |
| 98 | 102 | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/delivery/AppDeliverPickUpStoreController.java
| ... | ... | @@ -4,6 +4,7 @@ import cn.hutool.core.util.RandomUtil; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 5 | 5 | import cn.iocoder.yudao.module.trade.controller.app.delivery.vo.pickup.AppDeliveryPickUpStoreRespVO; |
| 6 | 6 | import io.swagger.v3.oas.annotations.Operation; |
| 7 | +import io.swagger.v3.oas.annotations.Parameter; | |
| 7 | 8 | import io.swagger.v3.oas.annotations.tags.Tag; |
| 8 | 9 | import org.springframework.validation.annotation.Validated; |
| 9 | 10 | import org.springframework.web.bind.annotation.GetMapping; |
| ... | ... | @@ -17,7 +18,7 @@ import java.util.Random; |
| 17 | 18 | |
| 18 | 19 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 19 | 20 | |
| 20 | -@Tag(name = "用户 App - 门店自提") | |
| 21 | +@Tag(name = "用户 App - 自提门店") | |
| 21 | 22 | @RestController |
| 22 | 23 | @RequestMapping("/trade/delivery/pick-up-store") |
| 23 | 24 | @Validated |
| ... | ... | @@ -37,8 +38,8 @@ public class AppDeliverPickUpStoreController { |
| 37 | 38 | store.setLogo("https://www.iocoder.cn/" + (i + 1) + ".png"); |
| 38 | 39 | store.setPhone("15601691300"); |
| 39 | 40 | store.setAreaId(random.nextInt(100000)); |
| 40 | - store.setAreaName(RandomUtil.randomString(10)); | |
| 41 | - store.setDetailAddress(RandomUtil.randomString(10)); | |
| 41 | + store.setAreaName("上海-" + RandomUtil.randomString(10)); | |
| 42 | + store.setDetailAddress("普陀区-" + RandomUtil.randomString(10)); | |
| 42 | 43 | store.setLatitude(random.nextDouble() * 10); |
| 43 | 44 | store.setLongitude(random.nextDouble() * 10); |
| 44 | 45 | store.setDistance(random.nextInt(1000)); |
| ... | ... | @@ -49,4 +50,23 @@ public class AppDeliverPickUpStoreController { |
| 49 | 50 | return success(list); |
| 50 | 51 | } |
| 51 | 52 | |
| 53 | + @GetMapping("/get") | |
| 54 | + @Operation(summary = "获得自提门店") | |
| 55 | + @Parameter(name = "id", description = "门店编号") | |
| 56 | + public CommonResult<AppDeliveryPickUpStoreRespVO> getOrder(@RequestParam("id") Long id) { | |
| 57 | + AppDeliveryPickUpStoreRespVO store = new AppDeliveryPickUpStoreRespVO(); | |
| 58 | + Random random = new Random(); | |
| 59 | + store.setId(random.nextLong()); | |
| 60 | + store.setName(RandomUtil.randomString(10)); | |
| 61 | + store.setLogo("https://www.iocoder.cn/" + (1) + ".png"); | |
| 62 | + store.setPhone("15601691300"); | |
| 63 | + store.setAreaId(random.nextInt(100000)); | |
| 64 | + store.setAreaName("上海-" + RandomUtil.randomString(10)); | |
| 65 | + store.setDetailAddress("普陀区-" + RandomUtil.randomString(10)); | |
| 66 | + store.setLatitude(random.nextDouble() * 10); | |
| 67 | + store.setLongitude(random.nextDouble() * 10); | |
| 68 | + store.setDistance(random.nextInt(1000)); | |
| 69 | + return success(store); | |
| 70 | + } | |
| 71 | + | |
| 52 | 72 | } | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/AppTradeOrderController.java
| ... | ... | @@ -127,6 +127,14 @@ public class AppTradeOrderController { |
| 127 | 127 | return success(orderCount); |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | + @PutMapping("/take") | |
| 131 | + @Operation(summary = "确认交易订单收货") | |
| 132 | + @Parameter(name = "id", description = "交易订单编号") | |
| 133 | + public CommonResult<Boolean> takeOrder(@RequestParam("id") Long id) { | |
| 134 | + // TODO @芋艿:未实现,mock 用 | |
| 135 | + return success(true); | |
| 136 | + } | |
| 137 | + | |
| 130 | 138 | @DeleteMapping("/cancel") |
| 131 | 139 | @Operation(summary = "取消交易订单") |
| 132 | 140 | @Parameter(name = "id", description = "交易订单编号") | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderDetailRespVO.java
| ... | ... | @@ -55,8 +55,10 @@ public class AppTradeOrderDetailRespVO { |
| 55 | 55 | @Schema(description = "付款超时时间", requiredMode = Schema.RequiredMode.REQUIRED) |
| 56 | 56 | private LocalDateTime payExpireTime; |
| 57 | 57 | |
| 58 | - @Schema(description = "支付渠道", requiredMode = Schema.RequiredMode.REQUIRED, example = "wx_lite_pay") | |
| 58 | + @Schema(description = "支付渠道", example = "wx_lite_pay") | |
| 59 | 59 | private String payChannelCode; |
| 60 | + @Schema(description = "支付渠道名", example = "微信小程序支付") | |
| 61 | + private String payChannelName; | |
| 60 | 62 | |
| 61 | 63 | @Schema(description = "商品原价(总)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1000") |
| 62 | 64 | private Integer totalPrice; |
| ... | ... | @@ -102,6 +104,9 @@ public class AppTradeOrderDetailRespVO { |
| 102 | 104 | @Schema(description = "收件人详细地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "中关村大街 1 号") |
| 103 | 105 | private String receiverDetailAddress; |
| 104 | 106 | |
| 107 | + @Schema(description = "自提门店编号", example = "1088") | |
| 108 | + private Long pickUpStoreId; | |
| 109 | + | |
| 105 | 110 | // ========== 售后基本信息 ========== |
| 106 | 111 | |
| 107 | 112 | // ========== 营销基本信息 ========== | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/controller/app/order/vo/AppTradeOrderSettlementReqVO.java
| ... | ... | @@ -44,7 +44,7 @@ public class AppTradeOrderSettlementReqVO { |
| 44 | 44 | private Long addressId; |
| 45 | 45 | |
| 46 | 46 | @Schema(description = "自提门店编号", example = "1088") |
| 47 | - private Long pickupStoreId; | |
| 47 | + private Long pickUpStoreId; | |
| 48 | 48 | @Schema(description = "收件人名称", example = "芋艿") // 选择门店自提时,该字段为联系人名 |
| 49 | 49 | private String receiverName; |
| 50 | 50 | @Schema(description = "收件人手机", example = "15601691300") // 选择门店自提时,该字段为联系人手机 | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/convert/order/TradeOrderConvert.java
| 1 | 1 | package cn.iocoder.yudao.module.trade.convert.order; |
| 2 | 2 | |
| 3 | 3 | import cn.hutool.core.collection.CollUtil; |
| 4 | +import cn.hutool.core.util.StrUtil; | |
| 4 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 5 | 6 | import cn.iocoder.yudao.framework.common.util.collection.CollectionUtils; |
| 7 | +import cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils; | |
| 6 | 8 | import cn.iocoder.yudao.framework.ip.core.utils.AreaUtils; |
| 7 | 9 | import cn.iocoder.yudao.module.member.api.address.dto.AddressRespDTO; |
| 8 | 10 | import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; |
| 9 | 11 | import cn.iocoder.yudao.module.pay.api.order.dto.PayOrderCreateReqDTO; |
| 12 | +import cn.iocoder.yudao.module.pay.enums.DictTypeConstants; | |
| 10 | 13 | import cn.iocoder.yudao.module.product.api.comment.dto.ProductCommentCreateReqDTO; |
| 11 | 14 | import cn.iocoder.yudao.module.product.api.property.dto.ProductPropertyValueDetailRespDTO; |
| 12 | 15 | import cn.iocoder.yudao.module.product.api.sku.dto.ProductSkuUpdateStockReqDTO; |
| ... | ... | @@ -234,6 +237,9 @@ public interface TradeOrderConvert { |
| 234 | 237 | List<ProductPropertyValueDetailRespDTO> propertyValueDetails, TradeOrderProperties tradeOrderProperties) { |
| 235 | 238 | AppTradeOrderDetailRespVO orderVO = convert3(order, orderItems); |
| 236 | 239 | orderVO.setPayExpireTime(addTime(tradeOrderProperties.getExpireTime())); |
| 240 | + if (StrUtil.isNotEmpty(order.getPayChannelCode())) { | |
| 241 | + orderVO.setPayChannelName(DictFrameworkUtils.getDictDataLabel(DictTypeConstants.CHANNEL_CODE_TYPE, order.getPayChannelCode())); | |
| 242 | + } | |
| 237 | 243 | // 处理商品属性 |
| 238 | 244 | Map<Long, ProductPropertyValueDetailRespDTO> propertyValueDetailMap = convertMap(propertyValueDetails, ProductPropertyValueDetailRespDTO::getValueId); |
| 239 | 245 | for (int i = 0; i < orderItems.size(); i++) { | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/main/java/cn/iocoder/yudao/module/trade/dal/dataobject/order/TradeOrderDO.java
| ... | ... | @@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.trade.dal.dataobject.order; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.enums.TerminalEnum; |
| 4 | 4 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| 5 | +import cn.iocoder.yudao.module.trade.dal.dataobject.delivery.DeliveryPickUpStoreDO; | |
| 5 | 6 | import cn.iocoder.yudao.module.trade.enums.delivery.DeliveryTypeEnum; |
| 6 | 7 | import cn.iocoder.yudao.module.trade.enums.order.*; |
| 7 | 8 | import com.baomidou.mybatisplus.annotation.KeySequence; |
| ... | ... | @@ -172,13 +173,6 @@ public class TradeOrderDO extends BaseDO { |
| 172 | 173 | */ |
| 173 | 174 | private Integer deliveryType; |
| 174 | 175 | /** |
| 175 | - * 配置模板的编号 | |
| 176 | - * | |
| 177 | - * 关联 DeliveryTemplateDO 的 id 编号 | |
| 178 | - */ | |
| 179 | - // TODO 芋艿:需要删除 | |
| 180 | - private Long deliveryTemplateId; | |
| 181 | - /** | |
| 182 | 176 | * 发货物流公司编号 |
| 183 | 177 | */ |
| 184 | 178 | private Long logisticsId; |
| ... | ... | @@ -197,7 +191,6 @@ public class TradeOrderDO extends BaseDO { |
| 197 | 191 | */ |
| 198 | 192 | private LocalDateTime deliveryTime; |
| 199 | 193 | |
| 200 | - // TODO @芋艿:pickUpStoreId; | |
| 201 | 194 | /** |
| 202 | 195 | * 收货时间 |
| 203 | 196 | */ |
| ... | ... | @@ -219,6 +212,13 @@ public class TradeOrderDO extends BaseDO { |
| 219 | 212 | */ |
| 220 | 213 | private String receiverDetailAddress; |
| 221 | 214 | |
| 215 | + /** | |
| 216 | + * 自提门店编号 | |
| 217 | + * | |
| 218 | + * 关联 {@link DeliveryPickUpStoreDO#getId()} | |
| 219 | + */ | |
| 220 | + private Long pickUpStoreId; | |
| 221 | + | |
| 222 | 222 | // ========== 售后基本信息 ========== |
| 223 | 223 | /** |
| 224 | 224 | * 售后状态 | ... | ... |
yudao-module-mall/yudao-module-trade-biz/src/test/java/cn/iocoder/yudao/module/trade/service/order/TradeOrderServiceTest.java
| ... | ... | @@ -115,7 +115,6 @@ public class TradeOrderServiceTest extends BaseDbUnitTest { |
| 115 | 115 | when(productSpuApi.getSpuList(eq(asSet(11L, 21L)))).thenReturn(Arrays.asList(spu01, spu02)); |
| 116 | 116 | // mock 方法(用户收件地址的校验) |
| 117 | 117 | AddressRespDTO addressRespDTO = new AddressRespDTO().setId(10L).setUserId(userId).setName("芋艿") |
| 118 | - //.setMobile("15601691300").setAreaId(3306).setPostCode("85757").setDetailAddress("土豆村"); | |
| 119 | 118 | .setMobile("15601691300").setAreaId(3306).setDetailAddress("土豆村"); |
| 120 | 119 | when(addressApi.getAddress(eq(10L), eq(userId))).thenReturn(addressRespDTO); |
| 121 | 120 | // mock 方法(价格计算) |
| ... | ... | @@ -177,7 +176,6 @@ public class TradeOrderServiceTest extends BaseDbUnitTest { |
| 177 | 176 | assertEquals(tradeOrderDO.getPayPrice(), 80); |
| 178 | 177 | assertEquals(tradeOrderDO.getPayOrderId(), 1000L); |
| 179 | 178 | assertNull(tradeOrderDO.getPayChannelCode()); |
| 180 | - assertNull(tradeOrderDO.getDeliveryTemplateId()); | |
| 181 | 179 | assertNull(tradeOrderDO.getLogisticsId()); |
| 182 | 180 | assertEquals(tradeOrderDO.getDeliveryStatus(), TradeOrderDeliveryStatusEnum.UNDELIVERED.getStatus()); |
| 183 | 181 | assertNull(tradeOrderDO.getDeliveryTime()); | ... | ... |
yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/enums/ErrorCodeConstants.java
| ... | ... | @@ -23,4 +23,15 @@ public interface ErrorCodeConstants { |
| 23 | 23 | // ========== 用户收件地址 1004004000 ========== |
| 24 | 24 | ErrorCode ADDRESS_NOT_EXISTS = new ErrorCode(1004004000, "用户收件地址不存在"); |
| 25 | 25 | |
| 26 | + //========== 用户积分 1004005000 ========== | |
| 27 | + | |
| 28 | + // TODO @xiaqing:错误码要分段;例如说这里,积分配置、积分记录、签到配置、签到记录;分成 4 段; | |
| 29 | + | |
| 30 | + ErrorCode SIGN_IN_CONFIG_NOT_EXISTS = new ErrorCode(1004005003, "签到天数规则不存在"); | |
| 31 | + ErrorCode SIGN_IN_CONFIG_EXISTS = new ErrorCode(1004005004, "签到天数规则已存在"); | |
| 32 | + | |
| 33 | + ErrorCode RECORD_NOT_EXISTS = new ErrorCode( 1004005005, "用户积分记录不存在"); | |
| 34 | + | |
| 35 | + ErrorCode SIGN_IN_RECORD_NOT_EXISTS = new ErrorCode(1004005006, "用户签到积分不存在"); | |
| 36 | + | |
| 26 | 37 | } | ... | ... |
yudao-module-member/yudao-module-member-biz/pom.xml
| ... | ... | @@ -86,6 +86,11 @@ |
| 86 | 86 | <!-- 工具类相关 --> |
| 87 | 87 | <dependency> |
| 88 | 88 | <groupId>cn.iocoder.boot</groupId> |
| 89 | + <artifactId>yudao-spring-boot-starter-excel</artifactId> | |
| 90 | + </dependency> | |
| 91 | + | |
| 92 | + <dependency> | |
| 93 | + <groupId>cn.iocoder.boot</groupId> | |
| 89 | 94 | <artifactId>yudao-spring-boot-starter-biz-ip</artifactId> |
| 90 | 95 | </dependency> |
| 91 | 96 | ... | ... |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/MemberPointConfigController.java
| ... | ... | @@ -26,9 +26,9 @@ public class MemberPointConfigController { |
| 26 | 26 | @Resource |
| 27 | 27 | private MemberPointConfigService memberPointConfigService; |
| 28 | 28 | |
| 29 | - @PutMapping("/update") | |
| 29 | + @PutMapping("/save") | |
| 30 | 30 | @Operation(summary = "保存会员积分配置") |
| 31 | - @PreAuthorize("@ss.hasPermission('member:point-config:save')") | |
| 31 | + @PreAuthorize("@ss.hasPermission('point:config:save')") | |
| 32 | 32 | public CommonResult<Boolean> updateConfig(@Valid @RequestBody MemberPointConfigSaveReqVO saveReqVO) { |
| 33 | 33 | memberPointConfigService.saveConfig(saveReqVO); |
| 34 | 34 | return success(true); |
| ... | ... | @@ -36,7 +36,7 @@ public class MemberPointConfigController { |
| 36 | 36 | |
| 37 | 37 | @GetMapping("/get") |
| 38 | 38 | @Operation(summary = "获得会员积分配置") |
| 39 | - @PreAuthorize("@ss.hasPermission('member:point-config:query')") | |
| 39 | + @PreAuthorize("@ss.hasPermission('point:config:query')") | |
| 40 | 40 | public CommonResult<MemberPointConfigRespVO> getConfig() { |
| 41 | 41 | MemberPointConfigDO config = memberPointConfigService.getConfig(); |
| 42 | 42 | return success(MemberPointConfigConvert.INSTANCE.convert(config)); | ... | ... |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/MemberPointRecordController.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.member.controller.admin.point; | |
| 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.member.controller.admin.point.vo.recrod.MemberPointRecordPageReqVO; | |
| 6 | +import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordRespVO; | |
| 7 | +import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordUpdateReqVO; | |
| 8 | +import cn.iocoder.yudao.module.member.convert.point.MemberPointRecordConvert; | |
| 9 | +import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointRecordDO; | |
| 10 | +import cn.iocoder.yudao.module.member.service.point.MemberPointRecordService; | |
| 11 | +import io.swagger.v3.oas.annotations.Operation; | |
| 12 | +import io.swagger.v3.oas.annotations.Parameter; | |
| 13 | +import io.swagger.v3.oas.annotations.tags.Tag; | |
| 14 | +import org.springframework.security.access.prepost.PreAuthorize; | |
| 15 | +import org.springframework.validation.annotation.Validated; | |
| 16 | +import org.springframework.web.bind.annotation.*; | |
| 17 | + | |
| 18 | +import javax.annotation.Resource; | |
| 19 | +import javax.validation.Valid; | |
| 20 | + | |
| 21 | +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | |
| 22 | + | |
| 23 | +@Tag(name = "管理后台 - 用户积分记录") | |
| 24 | +@RestController | |
| 25 | +@RequestMapping("/point/record") | |
| 26 | +@Validated | |
| 27 | +public class MemberPointRecordController { | |
| 28 | + | |
| 29 | + @Resource | |
| 30 | + private MemberPointRecordService recordService; | |
| 31 | + | |
| 32 | + // TODO @xiaqing:积分应该没有更新操作呀?可以删除哈; | |
| 33 | + @PutMapping("/update") | |
| 34 | + @Operation(summary = "更新用户积分记录") | |
| 35 | + @PreAuthorize("@ss.hasPermission('point:record:update')") | |
| 36 | + public CommonResult<Boolean> updateRecord(@Valid @RequestBody MemberPointRecordUpdateReqVO updateReqVO) { | |
| 37 | + recordService.updateRecord(updateReqVO); | |
| 38 | + return success(true); | |
| 39 | + } | |
| 40 | + | |
| 41 | + @GetMapping("/get") | |
| 42 | + @Operation(summary = "获得用户积分记录") | |
| 43 | + @Parameter(name = "id", description = "编号", required = true, example = "1024") | |
| 44 | + @PreAuthorize("@ss.hasPermission('point:record:query')") | |
| 45 | + public CommonResult<MemberPointRecordRespVO> getRecord(@RequestParam("id") Long id) { | |
| 46 | + MemberPointRecordDO record = recordService.getRecord(id); | |
| 47 | + return success(MemberPointRecordConvert.INSTANCE.convert(record)); | |
| 48 | + } | |
| 49 | + | |
| 50 | + @GetMapping("/page") | |
| 51 | + @Operation(summary = "获得用户积分记录分页") | |
| 52 | + @PreAuthorize("@ss.hasPermission('point:record:query')") | |
| 53 | + public CommonResult<PageResult<MemberPointRecordRespVO>> getRecordPage(@Valid MemberPointRecordPageReqVO pageVO) { | |
| 54 | + PageResult<MemberPointRecordDO> pageResult = recordService.getRecordPage(pageVO); | |
| 55 | + return success(MemberPointRecordConvert.INSTANCE.convertPage(pageResult)); | |
| 56 | + } | |
| 57 | + | |
| 58 | +} | ... | ... |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/config/MemberPointConfigBaseVO.java
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordBaseVO.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordBaseVO.java
| 1 | -package cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo; | |
| 1 | +package cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod; | |
| 2 | 2 | |
| 3 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | 4 | import lombok.*; |
| 5 | -import java.util.*; | |
| 6 | -import java.time.LocalDateTime; | |
| 7 | -import java.time.LocalDateTime; | |
| 8 | -import java.time.LocalDateTime; | |
| 5 | + | |
| 9 | 6 | import java.time.LocalDateTime; |
| 10 | 7 | import javax.validation.constraints.*; |
| 11 | 8 | import org.springframework.format.annotation.DateTimeFormat; |
| ... | ... | @@ -17,7 +14,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ |
| 17 | 14 | * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
| 18 | 15 | */ |
| 19 | 16 | @Data |
| 20 | -public class PointRecordBaseVO { | |
| 17 | +public class MemberPointRecordBaseVO { | |
| 21 | 18 | |
| 22 | 19 | @Schema(description = "业务编码", example = "22706") |
| 23 | 20 | @NotNull(message = "业务编码不能为空") | ... | ... |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordCreateReqVO.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordCreateReqVO.java
| 1 | -package cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo; | |
| 1 | +package cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod; | |
| 2 | 2 | |
| 3 | 3 | import lombok.*; |
| 4 | -import java.util.*; | |
| 5 | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | -import javax.validation.constraints.*; | |
| 7 | 5 | |
| 8 | 6 | @Schema(description = "管理后台 - 用户积分记录创建 Request VO") |
| 9 | 7 | @Data |
| 10 | 8 | @EqualsAndHashCode(callSuper = true) |
| 11 | 9 | @ToString(callSuper = true) |
| 12 | -public class PointRecordCreateReqVO extends PointRecordBaseVO { | |
| 10 | +public class MemberPointRecordCreateReqVO extends MemberPointRecordBaseVO { | |
| 13 | 11 | |
| 14 | 12 | } | ... | ... |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordExportReqVO.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordExportReqVO.java
| 1 | -package cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo; | |
| 1 | +package cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod; | |
| 2 | 2 | |
| 3 | 3 | import lombok.*; |
| 4 | -import java.util.*; | |
| 5 | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | -import cn.iocoder.yudao.framework.common.pojo.PageParam; | |
| 7 | 5 | |
| 8 | 6 | @Schema(description = "管理后台 - 用户积分记录 Excel 导出 Request VO,参数和 PointRecordPageReqVO 是一致的") |
| 9 | 7 | @Data |
| 10 | -public class PointRecordExportReqVO { | |
| 8 | +public class MemberPointRecordExportReqVO { | |
| 11 | 9 | |
| 12 | 10 | @Schema(description = "业务编码", example = "22706") |
| 13 | 11 | private String bizId; | ... | ... |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordPageReqVO.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordPageReqVO.java
| 1 | -package cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo; | |
| 1 | +package cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod; | |
| 2 | 2 | |
| 3 | 3 | import lombok.*; |
| 4 | -import java.util.*; | |
| 5 | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 7 | 6 | |
| ... | ... | @@ -9,7 +8,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 9 | 8 | @Data |
| 10 | 9 | @EqualsAndHashCode(callSuper = true) |
| 11 | 10 | @ToString(callSuper = true) |
| 12 | -public class PointRecordPageReqVO extends PageParam { | |
| 11 | +public class MemberPointRecordPageReqVO extends PageParam { | |
| 13 | 12 | |
| 14 | 13 | @Schema(description = "业务编码", example = "22706") |
| 15 | 14 | private String bizId; | ... | ... |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordRespVO.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordRespVO.java
| 1 | -package cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo; | |
| 1 | +package cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod; | |
| 2 | 2 | |
| 3 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | 4 | import lombok.*; |
| ... | ... | @@ -8,7 +8,7 @@ import java.time.LocalDateTime; |
| 8 | 8 | @Data |
| 9 | 9 | @EqualsAndHashCode(callSuper = true) |
| 10 | 10 | @ToString(callSuper = true) |
| 11 | -public class PointRecordRespVO extends PointRecordBaseVO { | |
| 11 | +public class MemberPointRecordRespVO extends MemberPointRecordBaseVO { | |
| 12 | 12 | |
| 13 | 13 | @Schema(description = "自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31457") |
| 14 | 14 | private Long id; | ... | ... |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordUpdateReqVO.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordUpdateReqVO.java
| 1 | -package cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo; | |
| 1 | +package cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod; | |
| 2 | 2 | |
| 3 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | 4 | import lombok.*; |
| 5 | -import java.util.*; | |
| 5 | + | |
| 6 | 6 | import javax.validation.constraints.*; |
| 7 | 7 | |
| 8 | 8 | @Schema(description = "管理后台 - 用户积分记录更新 Request VO") |
| 9 | 9 | @Data |
| 10 | 10 | @EqualsAndHashCode(callSuper = true) |
| 11 | 11 | @ToString(callSuper = true) |
| 12 | -public class PointRecordUpdateReqVO extends PointRecordBaseVO { | |
| 12 | +public class MemberPointRecordUpdateReqVO extends MemberPointRecordBaseVO { | |
| 13 | 13 | |
| 14 | 14 | @Schema(description = "自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31457") |
| 15 | 15 | @NotNull(message = "自增主键不能为空") | ... | ... |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/package-info.java deleted
| 1 | -package cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod; |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/SignInConfigController.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/MemberSignInConfigController.java
| 1 | -package cn.iocoder.yudao.module.point.controller.admin.signinconfig; | |
| 1 | +package cn.iocoder.yudao.module.member.controller.admin.signin; | |
| 2 | 2 | |
| 3 | -import org.springframework.web.bind.annotation.*; | |
| 4 | -import javax.annotation.Resource; | |
| 5 | -import org.springframework.validation.annotation.Validated; | |
| 6 | -import org.springframework.security.access.prepost.PreAuthorize; | |
| 7 | -import io.swagger.v3.oas.annotations.tags.Tag; | |
| 8 | -import io.swagger.v3.oas.annotations.Parameter; | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.CommonResult; | |
| 4 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 5 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigCreateReqVO; | |
| 6 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigPageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigRespVO; | |
| 8 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigUpdateReqVO; | |
| 9 | +import cn.iocoder.yudao.module.member.convert.signin.MemberSignInConfigConvert; | |
| 10 | +import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO; | |
| 11 | +import cn.iocoder.yudao.module.member.service.signin.MemberSignInConfigService; | |
| 9 | 12 | import io.swagger.v3.oas.annotations.Operation; |
| 13 | +import io.swagger.v3.oas.annotations.Parameter; | |
| 14 | +import io.swagger.v3.oas.annotations.tags.Tag; | |
| 15 | +import org.springframework.security.access.prepost.PreAuthorize; | |
| 16 | +import org.springframework.validation.annotation.Validated; | |
| 17 | +import org.springframework.web.bind.annotation.*; | |
| 10 | 18 | |
| 11 | -import javax.validation.constraints.*; | |
| 12 | -import javax.validation.*; | |
| 13 | -import javax.servlet.http.*; | |
| 14 | -import java.util.*; | |
| 15 | -import java.io.IOException; | |
| 19 | +import javax.annotation.Resource; | |
| 20 | +import javax.validation.Valid; | |
| 16 | 21 | |
| 17 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 18 | -import cn.iocoder.yudao.framework.common.pojo.CommonResult; | |
| 19 | 22 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 20 | 23 | |
| 21 | -import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | |
| 22 | - | |
| 23 | -import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | |
| 24 | -import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*; | |
| 25 | - | |
| 26 | -import cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo.*; | |
| 27 | -import cn.iocoder.yudao.module.point.dal.dataobject.signinconfig.SignInConfigDO; | |
| 28 | -import cn.iocoder.yudao.module.point.convert.signinconfig.SignInConfigConvert; | |
| 29 | -import cn.iocoder.yudao.module.point.service.signinconfig.SignInConfigService; | |
| 30 | - | |
| 31 | 24 | @Tag(name = "管理后台 - 积分签到规则") |
| 32 | 25 | @RestController |
| 33 | 26 | @RequestMapping("/point/sign-in-config") |
| 34 | 27 | @Validated |
| 35 | -public class SignInConfigController { | |
| 28 | +public class MemberSignInConfigController { | |
| 36 | 29 | |
| 37 | 30 | @Resource |
| 38 | - private SignInConfigService signInConfigService; | |
| 31 | + private MemberSignInConfigService memberSignInConfigService; | |
| 39 | 32 | |
| 40 | 33 | @PostMapping("/create") |
| 41 | 34 | @Operation(summary = "创建积分签到规则") |
| 42 | 35 | @PreAuthorize("@ss.hasPermission('point:sign-in-config:create')") |
| 43 | - public CommonResult<Integer> createSignInConfig(@Valid @RequestBody SignInConfigCreateReqVO createReqVO) { | |
| 44 | - return success(signInConfigService.createSignInConfig(createReqVO)); | |
| 36 | + public CommonResult<Integer> createSignInConfig(@Valid @RequestBody MemberSignInConfigCreateReqVO createReqVO) { | |
| 37 | + return success(memberSignInConfigService.createSignInConfig(createReqVO)); | |
| 45 | 38 | } |
| 46 | 39 | |
| 47 | 40 | @PutMapping("/update") |
| 48 | 41 | @Operation(summary = "更新积分签到规则") |
| 49 | 42 | @PreAuthorize("@ss.hasPermission('point:sign-in-config:update')") |
| 50 | - public CommonResult<Boolean> updateSignInConfig(@Valid @RequestBody SignInConfigUpdateReqVO updateReqVO) { | |
| 51 | - signInConfigService.updateSignInConfig(updateReqVO); | |
| 43 | + public CommonResult<Boolean> updateSignInConfig(@Valid @RequestBody MemberSignInConfigUpdateReqVO updateReqVO) { | |
| 44 | + memberSignInConfigService.updateSignInConfig(updateReqVO); | |
| 52 | 45 | return success(true); |
| 53 | 46 | } |
| 54 | 47 | |
| ... | ... | @@ -57,7 +50,7 @@ public class SignInConfigController { |
| 57 | 50 | @Parameter(name = "id", description = "编号", required = true) |
| 58 | 51 | @PreAuthorize("@ss.hasPermission('point:sign-in-config:delete')") |
| 59 | 52 | public CommonResult<Boolean> deleteSignInConfig(@RequestParam("id") Integer id) { |
| 60 | - signInConfigService.deleteSignInConfig(id); | |
| 53 | + memberSignInConfigService.deleteSignInConfig(id); | |
| 61 | 54 | return success(true); |
| 62 | 55 | } |
| 63 | 56 | |
| ... | ... | @@ -65,38 +58,17 @@ public class SignInConfigController { |
| 65 | 58 | @Operation(summary = "获得积分签到规则") |
| 66 | 59 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 67 | 60 | @PreAuthorize("@ss.hasPermission('point:sign-in-config:query')") |
| 68 | - public CommonResult<SignInConfigRespVO> getSignInConfig(@RequestParam("id") Integer id) { | |
| 69 | - SignInConfigDO signInConfig = signInConfigService.getSignInConfig(id); | |
| 70 | - return success(SignInConfigConvert.INSTANCE.convert(signInConfig)); | |
| 71 | - } | |
| 72 | - | |
| 73 | - @GetMapping("/list") | |
| 74 | - @Operation(summary = "获得积分签到规则列表") | |
| 75 | - @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") | |
| 76 | - @PreAuthorize("@ss.hasPermission('point:sign-in-config:query')") | |
| 77 | - public CommonResult<List<SignInConfigRespVO>> getSignInConfigList(@RequestParam("ids") Collection<Integer> ids) { | |
| 78 | - List<SignInConfigDO> list = signInConfigService.getSignInConfigList(ids); | |
| 79 | - return success(SignInConfigConvert.INSTANCE.convertList(list)); | |
| 61 | + public CommonResult<MemberSignInConfigRespVO> getSignInConfig(@RequestParam("id") Integer id) { | |
| 62 | + MemberSignInConfigDO signInConfig = memberSignInConfigService.getSignInConfig(id); | |
| 63 | + return success(MemberSignInConfigConvert.INSTANCE.convert(signInConfig)); | |
| 80 | 64 | } |
| 81 | 65 | |
| 82 | 66 | @GetMapping("/page") |
| 83 | 67 | @Operation(summary = "获得积分签到规则分页") |
| 84 | 68 | @PreAuthorize("@ss.hasPermission('point:sign-in-config:query')") |
| 85 | - public CommonResult<PageResult<SignInConfigRespVO>> getSignInConfigPage(@Valid SignInConfigPageReqVO pageVO) { | |
| 86 | - PageResult<SignInConfigDO> pageResult = signInConfigService.getSignInConfigPage(pageVO); | |
| 87 | - return success(SignInConfigConvert.INSTANCE.convertPage(pageResult)); | |
| 88 | - } | |
| 89 | - | |
| 90 | - @GetMapping("/export-excel") | |
| 91 | - @Operation(summary = "导出积分签到规则 Excel") | |
| 92 | - @PreAuthorize("@ss.hasPermission('point:sign-in-config:export')") | |
| 93 | - @OperateLog(type = EXPORT) | |
| 94 | - public void exportSignInConfigExcel(@Valid SignInConfigExportReqVO exportReqVO, | |
| 95 | - HttpServletResponse response) throws IOException { | |
| 96 | - List<SignInConfigDO> list = signInConfigService.getSignInConfigList(exportReqVO); | |
| 97 | - // 导出 Excel | |
| 98 | - List<SignInConfigExcelVO> datas = SignInConfigConvert.INSTANCE.convertList02(list); | |
| 99 | - ExcelUtils.write(response, "积分签到规则.xls", "数据", SignInConfigExcelVO.class, datas); | |
| 69 | + public CommonResult<PageResult<MemberSignInConfigRespVO>> getSignInConfigPage(@Valid MemberSignInConfigPageReqVO pageVO) { | |
| 70 | + PageResult<MemberSignInConfigDO> pageResult = memberSignInConfigService.getSignInConfigPage(pageVO); | |
| 71 | + return success(MemberSignInConfigConvert.INSTANCE.convertPage(pageResult)); | |
| 100 | 72 | } |
| 101 | 73 | |
| 102 | 74 | } | ... | ... |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/MemberSignInRecordController.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.member.controller.admin.signin; | |
| 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.member.controller.admin.signin.vo.MemberSignInRecordPageReqVO; | |
| 6 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordRespVO; | |
| 7 | +import cn.iocoder.yudao.module.member.convert.signin.MemberSignInRecordConvert; | |
| 8 | +import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO; | |
| 9 | +import cn.iocoder.yudao.module.member.service.signin.MemberSignInRecordService; | |
| 10 | +import io.swagger.v3.oas.annotations.Operation; | |
| 11 | +import io.swagger.v3.oas.annotations.Parameter; | |
| 12 | +import io.swagger.v3.oas.annotations.tags.Tag; | |
| 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 | +@Tag(name = "管理后台 - 用户签到积分") | |
| 23 | +@RestController | |
| 24 | +@RequestMapping("/point/sign-in-record") | |
| 25 | +@Validated | |
| 26 | +public class MemberSignInRecordController { | |
| 27 | + | |
| 28 | + @Resource | |
| 29 | + private MemberSignInRecordService memberSignInRecordService; | |
| 30 | + | |
| 31 | + // TODO @xiaqing:签到是不是不用删除? | |
| 32 | + @DeleteMapping("/delete") | |
| 33 | + @Operation(summary = "删除用户签到积分") | |
| 34 | + @Parameter(name = "id", description = "编号", required = true) | |
| 35 | + @PreAuthorize("@ss.hasPermission('point:sign-in-record:delete')") | |
| 36 | + public CommonResult<Boolean> deleteSignInRecord(@RequestParam("id") Long id) { | |
| 37 | + memberSignInRecordService.deleteSignInRecord(id); | |
| 38 | + return success(true); | |
| 39 | + } | |
| 40 | + | |
| 41 | + @GetMapping("/get") | |
| 42 | + @Operation(summary = "获得用户签到积分") | |
| 43 | + @Parameter(name = "id", description = "编号", required = true, example = "1024") | |
| 44 | + @PreAuthorize("@ss.hasPermission('point:sign-in-record:query')") | |
| 45 | + public CommonResult<MemberSignInRecordRespVO> getSignInRecord(@RequestParam("id") Long id) { | |
| 46 | + MemberSignInRecordDO signInRecord = memberSignInRecordService.getSignInRecord(id); | |
| 47 | + return success(MemberSignInRecordConvert.INSTANCE.convert(signInRecord)); | |
| 48 | + } | |
| 49 | + | |
| 50 | + @GetMapping("/page") | |
| 51 | + @Operation(summary = "获得用户签到积分分页") | |
| 52 | + @PreAuthorize("@ss.hasPermission('point:sign-in-record:query')") | |
| 53 | + public CommonResult<PageResult<MemberSignInRecordRespVO>> getSignInRecordPage(@Valid MemberSignInRecordPageReqVO pageVO) { | |
| 54 | + PageResult<MemberSignInRecordDO> pageResult = memberSignInRecordService.getSignInRecordPage(pageVO); | |
| 55 | + return success(MemberSignInRecordConvert.INSTANCE.convertPage(pageResult)); | |
| 56 | + } | |
| 57 | +} | ... | ... |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigBaseVO.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigBaseVO.java
| 1 | -package cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo; | |
| 1 | +package cn.iocoder.yudao.module.member.controller.admin.signin.vo; | |
| 2 | 2 | |
| 3 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | 4 | import lombok.*; |
| 5 | -import java.util.*; | |
| 6 | -import java.time.LocalDateTime; | |
| 7 | -import java.time.LocalDateTime; | |
| 8 | -import javax.validation.constraints.*; | |
| 9 | 5 | |
| 10 | 6 | /** |
| 11 | 7 | * 积分签到规则 Base VO,提供给添加、修改、详细的子 VO 使用 |
| 12 | 8 | * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
| 13 | 9 | */ |
| 14 | 10 | @Data |
| 15 | -public class SignInConfigBaseVO { | |
| 11 | +public class MemberSignInConfigBaseVO { | |
| 16 | 12 | |
| 17 | - @Schema(description = "签到第x天", example = "7") | |
| 13 | + @Schema(description = "签到第 x 天", example = "7") | |
| 18 | 14 | private Integer day; |
| 19 | 15 | |
| 20 | 16 | @Schema(description = "签到天数对应分数", example = "10") | ... | ... |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigCreateReqVO.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigCreateReqVO.java
| 1 | -package cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo; | |
| 1 | +package cn.iocoder.yudao.module.member.controller.admin.signin.vo; | |
| 2 | 2 | |
| 3 | 3 | import lombok.*; |
| 4 | -import java.util.*; | |
| 5 | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | -import javax.validation.constraints.*; | |
| 7 | 5 | |
| 8 | 6 | @Schema(description = "管理后台 - 积分签到规则创建 Request VO") |
| 9 | 7 | @Data |
| 10 | 8 | @EqualsAndHashCode(callSuper = true) |
| 11 | 9 | @ToString(callSuper = true) |
| 12 | -public class SignInConfigCreateReqVO extends SignInConfigBaseVO { | |
| 10 | +public class MemberSignInConfigCreateReqVO extends MemberSignInConfigBaseVO { | |
| 13 | 11 | |
| 14 | 12 | } | ... | ... |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigPageReqVO.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigPageReqVO.java
| 1 | -package cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo; | |
| 1 | +package cn.iocoder.yudao.module.member.controller.admin.signin.vo; | |
| 2 | 2 | |
| 3 | 3 | import lombok.*; |
| 4 | -import java.util.*; | |
| 5 | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | 5 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 7 | 6 | |
| ... | ... | @@ -9,7 +8,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 9 | 8 | @Data |
| 10 | 9 | @EqualsAndHashCode(callSuper = true) |
| 11 | 10 | @ToString(callSuper = true) |
| 12 | -public class SignInConfigPageReqVO extends PageParam { | |
| 11 | +public class MemberSignInConfigPageReqVO extends PageParam { | |
| 13 | 12 | |
| 14 | 13 | @Schema(description = "签到第x天", example = "7") |
| 15 | 14 | private Integer day; | ... | ... |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigRespVO.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigRespVO.java
| 1 | -package cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo; | |
| 1 | +package cn.iocoder.yudao.module.member.controller.admin.signin.vo; | |
| 2 | 2 | |
| 3 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | 4 | import lombok.*; |
| ... | ... | @@ -8,7 +8,7 @@ import java.time.LocalDateTime; |
| 8 | 8 | @Data |
| 9 | 9 | @EqualsAndHashCode(callSuper = true) |
| 10 | 10 | @ToString(callSuper = true) |
| 11 | -public class SignInConfigRespVO extends SignInConfigBaseVO { | |
| 11 | +public class MemberSignInConfigRespVO extends MemberSignInConfigBaseVO { | |
| 12 | 12 | |
| 13 | 13 | @Schema(description = "自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "20937") |
| 14 | 14 | private Integer id; | ... | ... |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigUpdateReqVO.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigUpdateReqVO.java
| 1 | -package cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo; | |
| 1 | +package cn.iocoder.yudao.module.member.controller.admin.signin.vo; | |
| 2 | 2 | |
| 3 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | 4 | import lombok.*; |
| 5 | -import java.util.*; | |
| 5 | + | |
| 6 | 6 | import javax.validation.constraints.*; |
| 7 | 7 | |
| 8 | 8 | @Schema(description = "管理后台 - 积分签到规则更新 Request VO") |
| 9 | 9 | @Data |
| 10 | 10 | @EqualsAndHashCode(callSuper = true) |
| 11 | 11 | @ToString(callSuper = true) |
| 12 | -public class SignInConfigUpdateReqVO extends SignInConfigBaseVO { | |
| 12 | +public class MemberSignInConfigUpdateReqVO extends MemberSignInConfigBaseVO { | |
| 13 | 13 | |
| 14 | 14 | @Schema(description = "规则自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "13653") |
| 15 | 15 | @NotNull(message = "规则自增主键不能为空") | ... | ... |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordBaseVO.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordBaseVO.java
| 1 | -package cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo; | |
| 1 | +package cn.iocoder.yudao.module.member.controller.admin.signin.vo; | |
| 2 | 2 | |
| 3 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | -import lombok.*; | |
| 5 | -import java.util.*; | |
| 6 | -import java.time.LocalDateTime; | |
| 7 | -import java.time.LocalDateTime; | |
| 8 | -import javax.validation.constraints.*; | |
| 4 | +import lombok.Data; | |
| 9 | 5 | |
| 10 | 6 | /** |
| 11 | 7 | * 用户签到积分 Base VO,提供给添加、修改、详细的子 VO 使用 |
| 12 | 8 | * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
| 13 | 9 | */ |
| 14 | 10 | @Data |
| 15 | -public class SignInRecordBaseVO { | |
| 11 | +public class MemberSignInRecordBaseVO { | |
| 16 | 12 | |
| 17 | 13 | @Schema(description = "签到用户", example = "6507") |
| 18 | 14 | private Integer userId; | ... | ... |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordCreateReqVO.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordCreateReqVO.java
| 1 | -package cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo; | |
| 1 | +package cn.iocoder.yudao.module.member.controller.admin.signin.vo; | |
| 2 | 2 | |
| 3 | -import lombok.*; | |
| 4 | -import java.util.*; | |
| 5 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | -import javax.validation.constraints.*; | |
| 4 | +import lombok.Data; | |
| 5 | +import lombok.EqualsAndHashCode; | |
| 6 | +import lombok.ToString; | |
| 7 | 7 | |
| 8 | 8 | @Schema(description = "管理后台 - 用户签到积分创建 Request VO") |
| 9 | 9 | @Data |
| 10 | 10 | @EqualsAndHashCode(callSuper = true) |
| 11 | 11 | @ToString(callSuper = true) |
| 12 | -public class SignInRecordCreateReqVO extends SignInRecordBaseVO { | |
| 12 | +public class MemberSignInRecordCreateReqVO extends MemberSignInRecordBaseVO { | |
| 13 | 13 | |
| 14 | 14 | } | ... | ... |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordPageReqVO.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordPageReqVO.java
| 1 | -package cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo; | |
| 1 | +package cn.iocoder.yudao.module.member.controller.admin.signin.vo; | |
| 2 | 2 | |
| 3 | -import lombok.*; | |
| 4 | -import java.util.*; | |
| 5 | -import io.swagger.v3.oas.annotations.media.Schema; | |
| 6 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 4 | +import io.swagger.v3.oas.annotations.media.Schema; | |
| 5 | +import lombok.Data; | |
| 6 | +import lombok.EqualsAndHashCode; | |
| 7 | +import lombok.ToString; | |
| 7 | 8 | import org.springframework.format.annotation.DateTimeFormat; |
| 9 | + | |
| 8 | 10 | import java.time.LocalDateTime; |
| 9 | 11 | |
| 10 | 12 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
| ... | ... | @@ -13,7 +15,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ |
| 13 | 15 | @Data |
| 14 | 16 | @EqualsAndHashCode(callSuper = true) |
| 15 | 17 | @ToString(callSuper = true) |
| 16 | -public class SignInRecordPageReqVO extends PageParam { | |
| 18 | +public class MemberSignInRecordPageReqVO extends PageParam { | |
| 17 | 19 | |
| 18 | 20 | @Schema(description = "签到用户", example = "6507") |
| 19 | 21 | private Integer userId; | ... | ... |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordRespVO.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordRespVO.java
| 1 | -package cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo; | |
| 1 | +package cn.iocoder.yudao.module.member.controller.admin.signin.vo; | |
| 2 | 2 | |
| 3 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | -import lombok.*; | |
| 4 | +import lombok.Data; | |
| 5 | +import lombok.EqualsAndHashCode; | |
| 6 | +import lombok.ToString; | |
| 7 | + | |
| 5 | 8 | import java.time.LocalDateTime; |
| 6 | 9 | |
| 7 | 10 | @Schema(description = "管理后台 - 用户签到积分 Response VO") |
| 8 | 11 | @Data |
| 9 | 12 | @EqualsAndHashCode(callSuper = true) |
| 10 | 13 | @ToString(callSuper = true) |
| 11 | -public class SignInRecordRespVO extends SignInRecordBaseVO { | |
| 14 | +public class MemberSignInRecordRespVO extends MemberSignInRecordBaseVO { | |
| 12 | 15 | |
| 13 | 16 | @Schema(description = "签到自增id", requiredMode = Schema.RequiredMode.REQUIRED, example = "11903") |
| 14 | 17 | private Long id; | ... | ... |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordUpdateReqVO.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordUpdateReqVO.java
| 1 | -package cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo; | |
| 1 | +package cn.iocoder.yudao.module.member.controller.admin.signin.vo; | |
| 2 | 2 | |
| 3 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | -import lombok.*; | |
| 5 | -import java.util.*; | |
| 6 | -import javax.validation.constraints.*; | |
| 4 | +import lombok.Data; | |
| 5 | +import lombok.EqualsAndHashCode; | |
| 6 | +import lombok.ToString; | |
| 7 | + | |
| 8 | +import javax.validation.constraints.NotNull; | |
| 7 | 9 | |
| 8 | 10 | @Schema(description = "管理后台 - 用户签到积分更新 Request VO") |
| 9 | 11 | @Data |
| 10 | 12 | @EqualsAndHashCode(callSuper = true) |
| 11 | 13 | @ToString(callSuper = true) |
| 12 | -public class SignInRecordUpdateReqVO extends SignInRecordBaseVO { | |
| 14 | +public class MemberSignInRecordUpdateReqVO extends MemberSignInRecordBaseVO { | |
| 13 | 15 | |
| 14 | 16 | @Schema(description = "签到自增id", requiredMode = Schema.RequiredMode.REQUIRED, example = "11903") |
| 15 | 17 | @NotNull(message = "签到自增id不能为空") | ... | ... |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/point/MemberPointConfigConvert.java
| 1 | 1 | package cn.iocoder.yudao.module.member.convert.point; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.module.member.controller.admin.point.vo.config.MemberPointConfigRespVO; |
| 4 | +import cn.iocoder.yudao.module.member.controller.admin.point.vo.config.MemberPointConfigSaveReqVO; | |
| 5 | +import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordUpdateReqVO; | |
| 4 | 6 | import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointConfigDO; |
| 7 | +import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointRecordDO; | |
| 5 | 8 | import org.mapstruct.Mapper; |
| 6 | 9 | import org.mapstruct.factory.Mappers; |
| 7 | 10 | |
| ... | ... | @@ -17,4 +20,7 @@ public interface MemberPointConfigConvert { |
| 17 | 20 | |
| 18 | 21 | MemberPointConfigRespVO convert(MemberPointConfigDO bean); |
| 19 | 22 | |
| 23 | + MemberPointConfigDO convert(MemberPointConfigSaveReqVO bean); | |
| 24 | + | |
| 25 | + | |
| 20 | 26 | } | ... | ... |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/point/MemberPointRecordConvert.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.member.convert.point; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordCreateReqVO; | |
| 5 | +import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordRespVO; | |
| 6 | +import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordUpdateReqVO; | |
| 7 | +import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointRecordDO; | |
| 8 | +import org.mapstruct.Mapper; | |
| 9 | +import org.mapstruct.factory.Mappers; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * 用户积分记录 Convert | |
| 13 | + * | |
| 14 | + * @author QingX | |
| 15 | + */ | |
| 16 | +@Mapper | |
| 17 | +public interface MemberPointRecordConvert { | |
| 18 | + | |
| 19 | + MemberPointRecordConvert INSTANCE = Mappers.getMapper(MemberPointRecordConvert.class); | |
| 20 | + | |
| 21 | + MemberPointRecordDO convert(MemberPointRecordCreateReqVO bean); | |
| 22 | + | |
| 23 | + MemberPointRecordDO convert(MemberPointRecordUpdateReqVO bean); | |
| 24 | + | |
| 25 | + MemberPointRecordRespVO convert(MemberPointRecordDO bean); | |
| 26 | + | |
| 27 | + PageResult<MemberPointRecordRespVO> convertPage(PageResult<MemberPointRecordDO> page); | |
| 28 | + | |
| 29 | +} | ... | ... |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/signin/MemberSignInConfigConvert.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.member.convert.signin; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigCreateReqVO; | |
| 5 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigRespVO; | |
| 6 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigUpdateReqVO; | |
| 7 | +import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO; | |
| 8 | +import org.mapstruct.Mapper; | |
| 9 | +import org.mapstruct.factory.Mappers; | |
| 10 | + | |
| 11 | +import java.util.List; | |
| 12 | + | |
| 13 | +/** | |
| 14 | + * 积分签到规则 Convert | |
| 15 | + * | |
| 16 | + * @author QingX | |
| 17 | + */ | |
| 18 | +@Mapper | |
| 19 | +public interface MemberSignInConfigConvert { | |
| 20 | + | |
| 21 | + MemberSignInConfigConvert INSTANCE = Mappers.getMapper(MemberSignInConfigConvert.class); | |
| 22 | + | |
| 23 | + MemberSignInConfigDO convert(MemberSignInConfigCreateReqVO bean); | |
| 24 | + | |
| 25 | + MemberSignInConfigDO convert(MemberSignInConfigUpdateReqVO bean); | |
| 26 | + | |
| 27 | + MemberSignInConfigRespVO convert(MemberSignInConfigDO bean); | |
| 28 | + | |
| 29 | + List<MemberSignInConfigRespVO> convertList(List<MemberSignInConfigDO> list); | |
| 30 | + | |
| 31 | + PageResult<MemberSignInConfigRespVO> convertPage(PageResult<MemberSignInConfigDO> page); | |
| 32 | + | |
| 33 | +} | ... | ... |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/signin/MemberSignInRecordConvert.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.member.convert.signin; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordCreateReqVO; | |
| 5 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordRespVO; | |
| 6 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordUpdateReqVO; | |
| 7 | +import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO; | |
| 8 | +import org.mapstruct.Mapper; | |
| 9 | +import org.mapstruct.factory.Mappers; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * 用户签到积分 Convert | |
| 13 | + * | |
| 14 | + * @author 芋道源码 | |
| 15 | + */ | |
| 16 | +@Mapper | |
| 17 | +public interface MemberSignInRecordConvert { | |
| 18 | + | |
| 19 | + MemberSignInRecordConvert INSTANCE = Mappers.getMapper(MemberSignInRecordConvert.class); | |
| 20 | + | |
| 21 | + MemberSignInRecordDO convert(MemberSignInRecordCreateReqVO bean); | |
| 22 | + | |
| 23 | + MemberSignInRecordDO convert(MemberSignInRecordUpdateReqVO bean); | |
| 24 | + | |
| 25 | + MemberSignInRecordRespVO convert(MemberSignInRecordDO bean); | |
| 26 | + | |
| 27 | + PageResult<MemberSignInRecordRespVO> convertPage(PageResult<MemberSignInRecordDO> page); | |
| 28 | + | |
| 29 | +} | ... | ... |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/dataobject/pointrecord/PointRecordDO.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/point/MemberPointRecordDO.java
| 1 | -package cn.iocoder.yudao.module.point.dal.dataobject.pointrecord; | |
| 1 | +package cn.iocoder.yudao.module.member.dal.dataobject.point; | |
| 2 | 2 | |
| 3 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | |
| 4 | +import com.baomidou.mybatisplus.annotation.KeySequence; | |
| 5 | +import com.baomidou.mybatisplus.annotation.TableId; | |
| 6 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 3 | 7 | import lombok.*; |
| 4 | -import java.util.*; | |
| 5 | -import java.time.LocalDateTime; | |
| 6 | -import java.time.LocalDateTime; | |
| 7 | -import java.time.LocalDateTime; | |
| 8 | + | |
| 8 | 9 | import java.time.LocalDateTime; |
| 9 | -import com.baomidou.mybatisplus.annotation.*; | |
| 10 | -import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | |
| 11 | 10 | |
| 12 | 11 | /** |
| 13 | 12 | * 用户积分记录 DO |
| ... | ... | @@ -22,7 +21,7 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| 22 | 21 | @Builder |
| 23 | 22 | @NoArgsConstructor |
| 24 | 23 | @AllArgsConstructor |
| 25 | -public class PointRecordDO extends BaseDO { | |
| 24 | +public class MemberPointRecordDO extends BaseDO { | |
| 26 | 25 | |
| 27 | 26 | /** |
| 28 | 27 | * 自增主键 |
| ... | ... | @@ -36,12 +35,13 @@ public class PointRecordDO extends BaseDO { |
| 36 | 35 | /** |
| 37 | 36 | * 业务类型 |
| 38 | 37 | * |
| 39 | - * 枚举 {@link TODO biz_type 对应的类} | |
| 38 | + * 枚举 {@link TODO biz_type 对应枚举,然后改成 int 类型哈} | |
| 40 | 39 | */ |
| 41 | 40 | private String bizType; |
| 42 | 41 | /** |
| 43 | 42 | * 1增加 0扣减 |
| 44 | 43 | */ |
| 44 | + // TODO @xiaqing:要不把 type 合并到 point 里?增加 point 是正数,减少 point 是负数? | |
| 45 | 45 | private String type; |
| 46 | 46 | /** |
| 47 | 47 | * 积分标题 |
| ... | ... | @@ -61,7 +61,6 @@ public class PointRecordDO extends BaseDO { |
| 61 | 61 | private Integer totalPoint; |
| 62 | 62 | /** |
| 63 | 63 | * 状态:1-订单创建,2-冻结期,3-完成,4-失效(订单退款) |
| 64 | - | |
| 65 | 64 | * |
| 66 | 65 | * 枚举 {@link TODO point_status 对应的类} |
| 67 | 66 | */ | ... | ... |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/dataobject/signinconfig/SignInConfigDO.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/signin/MemberSignInConfigDO.java
| 1 | -package cn.iocoder.yudao.module.point.dal.dataobject.signinconfig; | |
| 1 | +package cn.iocoder.yudao.module.member.dal.dataobject.signin; | |
| 2 | 2 | |
| 3 | -import lombok.*; | |
| 4 | -import java.util.*; | |
| 5 | -import java.time.LocalDateTime; | |
| 6 | -import java.time.LocalDateTime; | |
| 7 | -import com.baomidou.mybatisplus.annotation.*; | |
| 8 | 3 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| 4 | +import com.baomidou.mybatisplus.annotation.KeySequence; | |
| 5 | +import com.baomidou.mybatisplus.annotation.TableId; | |
| 6 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 7 | +import lombok.*; | |
| 9 | 8 | |
| 10 | 9 | /** |
| 11 | 10 | * 积分签到规则 DO |
| ... | ... | @@ -20,7 +19,7 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| 20 | 19 | @Builder |
| 21 | 20 | @NoArgsConstructor |
| 22 | 21 | @AllArgsConstructor |
| 23 | -public class SignInConfigDO extends BaseDO { | |
| 22 | +public class MemberSignInConfigDO extends BaseDO { | |
| 24 | 23 | |
| 25 | 24 | /** |
| 26 | 25 | * 规则自增主键 | ... | ... |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/dataobject/signinrecord/SignInRecordDO.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/signin/MemberSignInRecordDO.java
| 1 | -package cn.iocoder.yudao.module.point.dal.dataobject.signinrecord; | |
| 1 | +package cn.iocoder.yudao.module.member.dal.dataobject.signin; | |
| 2 | 2 | |
| 3 | -import lombok.*; | |
| 4 | -import java.util.*; | |
| 5 | -import java.time.LocalDateTime; | |
| 6 | -import java.time.LocalDateTime; | |
| 7 | -import com.baomidou.mybatisplus.annotation.*; | |
| 8 | 3 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| 4 | +import com.baomidou.mybatisplus.annotation.KeySequence; | |
| 5 | +import com.baomidou.mybatisplus.annotation.TableId; | |
| 6 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 7 | +import lombok.*; | |
| 9 | 8 | |
| 10 | 9 | /** |
| 11 | 10 | * 用户签到积分 DO |
| ... | ... | @@ -20,7 +19,7 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| 20 | 19 | @Builder |
| 21 | 20 | @NoArgsConstructor |
| 22 | 21 | @AllArgsConstructor |
| 23 | -public class SignInRecordDO extends BaseDO { | |
| 22 | +public class MemberSignInRecordDO extends BaseDO { | |
| 24 | 23 | |
| 25 | 24 | /** |
| 26 | 25 | * 签到自增id | ... | ... |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/point/MemberPointRecordMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.member.dal.mysql.point; | |
| 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.member.controller.admin.point.vo.recrod.MemberPointRecordPageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointRecordDO; | |
| 8 | +import org.apache.ibatis.annotations.Mapper; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 用户积分记录 Mapper | |
| 12 | + * | |
| 13 | + * @author QingX | |
| 14 | + */ | |
| 15 | +@Mapper | |
| 16 | +public interface MemberPointRecordMapper extends BaseMapperX<MemberPointRecordDO> { | |
| 17 | + | |
| 18 | + default PageResult<MemberPointRecordDO> selectPage(MemberPointRecordPageReqVO reqVO) { | |
| 19 | + return selectPage(reqVO, new LambdaQueryWrapperX<MemberPointRecordDO>() | |
| 20 | + .eqIfPresent(MemberPointRecordDO::getBizId, reqVO.getBizId()) | |
| 21 | + .eqIfPresent(MemberPointRecordDO::getBizType, reqVO.getBizType()) | |
| 22 | + .eqIfPresent(MemberPointRecordDO::getType, reqVO.getType()) | |
| 23 | + .eqIfPresent(MemberPointRecordDO::getTitle, reqVO.getTitle()) | |
| 24 | + .eqIfPresent(MemberPointRecordDO::getStatus, reqVO.getStatus()) | |
| 25 | + .orderByDesc(MemberPointRecordDO::getId)); | |
| 26 | + } | |
| 27 | + | |
| 28 | +} | ... | ... |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/signin/MemberSignInConfigMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.member.dal.mysql.signin; | |
| 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.member.controller.admin.signin.vo.MemberSignInConfigPageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigUpdateReqVO; | |
| 8 | +import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO; | |
| 9 | +import org.apache.ibatis.annotations.Mapper; | |
| 10 | + | |
| 11 | +/** | |
| 12 | + * 积分签到规则 Mapper | |
| 13 | + * | |
| 14 | + * @author QingX | |
| 15 | + */ | |
| 16 | +@Mapper | |
| 17 | +public interface MemberSignInConfigMapper extends BaseMapperX<MemberSignInConfigDO> { | |
| 18 | + | |
| 19 | + default PageResult<MemberSignInConfigDO> selectPage(MemberSignInConfigPageReqVO reqVO) { | |
| 20 | + return selectPage(reqVO, new LambdaQueryWrapperX<MemberSignInConfigDO>() | |
| 21 | + .eqIfPresent(MemberSignInConfigDO::getDay, reqVO.getDay()) | |
| 22 | + .orderByAsc(MemberSignInConfigDO::getDay)); | |
| 23 | + } | |
| 24 | + | |
| 25 | + // | |
| 26 | + default long selectSameDayNotSelf(MemberSignInConfigUpdateReqVO reqVO){ | |
| 27 | + return selectCount(new LambdaQueryWrapperX <MemberSignInConfigDO>() | |
| 28 | + .ne(MemberSignInConfigDO::getId, reqVO.getId()) | |
| 29 | + .eq(MemberSignInConfigDO::getDay,reqVO.getDay()) | |
| 30 | + ); | |
| 31 | + } | |
| 32 | + | |
| 33 | +} | ... | ... |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/signin/MemberSignInRecordMapper.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.member.dal.mysql.signin; | |
| 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.member.controller.admin.signin.vo.MemberSignInRecordPageReqVO; | |
| 7 | +import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO; | |
| 8 | +import org.apache.ibatis.annotations.Mapper; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 用户签到积分 Mapper | |
| 12 | + * | |
| 13 | + * @author 芋道源码 | |
| 14 | + */ | |
| 15 | +@Mapper | |
| 16 | +public interface MemberSignInRecordMapper extends BaseMapperX<MemberSignInRecordDO> { | |
| 17 | + | |
| 18 | + default PageResult<MemberSignInRecordDO> selectPage(MemberSignInRecordPageReqVO reqVO) { | |
| 19 | + return selectPage(reqVO, new LambdaQueryWrapperX<MemberSignInRecordDO>() | |
| 20 | + .eqIfPresent(MemberSignInRecordDO::getUserId, reqVO.getUserId()) | |
| 21 | + .eqIfPresent(MemberSignInRecordDO::getDay, reqVO.getDay()) | |
| 22 | + .betweenIfPresent(MemberSignInRecordDO::getCreateTime, reqVO.getCreateTime()) | |
| 23 | + .orderByDesc(MemberSignInRecordDO::getId)); | |
| 24 | + } | |
| 25 | + | |
| 26 | +} | ... | ... |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointConfigServiceImpl.java
| 1 | 1 | package cn.iocoder.yudao.module.member.service.point; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.module.member.controller.admin.point.vo.config.MemberPointConfigSaveReqVO; |
| 4 | +import cn.iocoder.yudao.module.member.convert.point.MemberPointConfigConvert; | |
| 4 | 5 | import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointConfigDO; |
| 5 | 6 | import cn.iocoder.yudao.module.member.dal.mysql.point.MemberPointConfigMapper; |
| 6 | 7 | import org.springframework.stereotype.Service; |
| 7 | 8 | import org.springframework.validation.annotation.Validated; |
| 8 | 9 | |
| 9 | 10 | import javax.annotation.Resource; |
| 11 | +import java.util.List; | |
| 10 | 12 | |
| 11 | 13 | /** |
| 12 | 14 | * 会员积分配置 Service 实现类 |
| ... | ... | @@ -18,16 +20,26 @@ import javax.annotation.Resource; |
| 18 | 20 | public class MemberPointConfigServiceImpl implements MemberPointConfigService { |
| 19 | 21 | |
| 20 | 22 | @Resource |
| 21 | - private MemberPointConfigMapper memberPointConfigMapper; | |
| 23 | + private MemberPointConfigMapper pointConfigMapper; | |
| 22 | 24 | |
| 23 | 25 | @Override |
| 24 | 26 | public void saveConfig(MemberPointConfigSaveReqVO saveReqVO) { |
| 25 | - // TODO qingx:配置存在,则 update;不存在则 insert | |
| 27 | + // TODO @xiaqing:直接 getConfig() 查询,如果不存在,则插入;存在,则进行更新; | |
| 28 | + long total = pointConfigMapper.selectCount(); | |
| 29 | + MemberPointConfigDO pointConfigDO = MemberPointConfigConvert.INSTANCE.convert(saveReqVO); | |
| 30 | + //大于0存在记录,则更新,否则插入 | |
| 31 | + if (total > 0) { | |
| 32 | + pointConfigMapper.updateById(pointConfigDO); | |
| 33 | + } else { | |
| 34 | + pointConfigMapper.insert(pointConfigDO); | |
| 35 | + } | |
| 26 | 36 | } |
| 27 | 37 | |
| 28 | 38 | @Override |
| 29 | 39 | public MemberPointConfigDO getConfig() { |
| 30 | - // TODO qingx:直接查询到一条; | |
| 31 | - return null; | |
| 40 | + List <MemberPointConfigDO> list = pointConfigMapper.selectList(); | |
| 41 | + // TODO @xiaqing:可以使用 CollUtil.getFirst() | |
| 42 | + return list == null ? null : list.get(0); | |
| 32 | 43 | } |
| 44 | + | |
| 33 | 45 | } | ... | ... |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointRecordService.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.member.service.point; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordPageReqVO; | |
| 5 | +import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordUpdateReqVO; | |
| 6 | +import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointRecordDO; | |
| 7 | + | |
| 8 | +import javax.validation.Valid; | |
| 9 | + | |
| 10 | +/** | |
| 11 | + * 用户积分记录 Service 接口 | |
| 12 | + * | |
| 13 | + * @author QingX | |
| 14 | + */ | |
| 15 | +public interface MemberPointRecordService { | |
| 16 | + // TODO @xiaqing:方法和方法之间,是空一行哈; | |
| 17 | + | |
| 18 | + /** | |
| 19 | + * 更新用户积分记录 | |
| 20 | + * | |
| 21 | + * @param updateReqVO 更新信息 | |
| 22 | + */ | |
| 23 | + void updateRecord(@Valid MemberPointRecordUpdateReqVO updateReqVO); | |
| 24 | + | |
| 25 | + | |
| 26 | + /** | |
| 27 | + * 获得用户积分记录 | |
| 28 | + * | |
| 29 | + * @param id 编号 | |
| 30 | + * @return 用户积分记录 | |
| 31 | + */ | |
| 32 | + MemberPointRecordDO getRecord(Long id); | |
| 33 | + | |
| 34 | + /** | |
| 35 | + * 获得用户积分记录分页 | |
| 36 | + * | |
| 37 | + * @param pageReqVO 分页查询 | |
| 38 | + * @return 用户积分记录分页 | |
| 39 | + */ | |
| 40 | + PageResult<MemberPointRecordDO> getRecordPage(MemberPointRecordPageReqVO pageReqVO); | |
| 41 | + | |
| 42 | +} | ... | ... |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/pointrecord/PointRecordServiceImpl.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointRecordServiceImpl.java
| 1 | -package cn.iocoder.yudao.module.point.service.pointrecord; | |
| 1 | +package cn.iocoder.yudao.module.member.service.point; | |
| 2 | 2 | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordPageReqVO; | |
| 5 | +import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordUpdateReqVO; | |
| 6 | +import cn.iocoder.yudao.module.member.convert.point.MemberPointRecordConvert; | |
| 7 | +import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointRecordDO; | |
| 8 | +import cn.iocoder.yudao.module.member.dal.mysql.point.MemberPointRecordMapper; | |
| 9 | +import cn.iocoder.yudao.module.member.enums.ErrorCodeConstants; | |
| 3 | 10 | import org.springframework.stereotype.Service; |
| 4 | -import javax.annotation.Resource; | |
| 5 | 11 | import org.springframework.validation.annotation.Validated; |
| 6 | 12 | |
| 7 | -import java.util.*; | |
| 8 | -import cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo.*; | |
| 9 | -import cn.iocoder.yudao.module.point.dal.dataobject.pointrecord.PointRecordDO; | |
| 10 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 11 | - | |
| 12 | -import cn.iocoder.yudao.module.point.convert.pointrecord.PointRecordConvert; | |
| 13 | -import cn.iocoder.yudao.module.point.dal.mysql.pointrecord.PointRecordMapper; | |
| 13 | +import javax.annotation.Resource; | |
| 14 | +import java.util.Collection; | |
| 15 | +import java.util.List; | |
| 14 | 16 | |
| 15 | 17 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 16 | -import static cn.iocoder.yudao.module.point.enums.ErrorCodeConstants.*; | |
| 18 | + | |
| 17 | 19 | |
| 18 | 20 | /** |
| 19 | 21 | * 用户积分记录 Service 实现类 |
| ... | ... | @@ -22,61 +24,34 @@ import static cn.iocoder.yudao.module.point.enums.ErrorCodeConstants.*; |
| 22 | 24 | */ |
| 23 | 25 | @Service |
| 24 | 26 | @Validated |
| 25 | -public class PointRecordServiceImpl implements PointRecordService { | |
| 27 | +public class MemberPointRecordServiceImpl implements MemberPointRecordService { | |
| 26 | 28 | |
| 27 | 29 | @Resource |
| 28 | - private PointRecordMapper recordMapper; | |
| 30 | + private MemberPointRecordMapper recordMapper; | |
| 29 | 31 | |
| 30 | 32 | @Override |
| 31 | - public Long createRecord(PointRecordCreateReqVO createReqVO) { | |
| 32 | - // 插入 | |
| 33 | - PointRecordDO record = PointRecordConvert.INSTANCE.convert(createReqVO); | |
| 34 | - recordMapper.insert(record); | |
| 35 | - // 返回 | |
| 36 | - return record.getId(); | |
| 37 | - } | |
| 38 | - | |
| 39 | - @Override | |
| 40 | - public void updateRecord(PointRecordUpdateReqVO updateReqVO) { | |
| 33 | + public void updateRecord(MemberPointRecordUpdateReqVO updateReqVO) { | |
| 41 | 34 | // 校验存在 |
| 42 | 35 | validateRecordExists(updateReqVO.getId()); |
| 43 | 36 | // 更新 |
| 44 | - PointRecordDO updateObj = PointRecordConvert.INSTANCE.convert(updateReqVO); | |
| 37 | + MemberPointRecordDO updateObj = MemberPointRecordConvert.INSTANCE.convert(updateReqVO); | |
| 45 | 38 | recordMapper.updateById(updateObj); |
| 46 | 39 | } |
| 47 | 40 | |
| 48 | - @Override | |
| 49 | - public void deleteRecord(Long id) { | |
| 50 | - // 校验存在 | |
| 51 | - validateRecordExists(id); | |
| 52 | - // 删除 | |
| 53 | - recordMapper.deleteById(id); | |
| 54 | - } | |
| 55 | - | |
| 56 | 41 | private void validateRecordExists(Long id) { |
| 57 | 42 | if (recordMapper.selectById(id) == null) { |
| 58 | - throw exception(RECORD_NOT_EXISTS); | |
| 43 | + throw exception(ErrorCodeConstants.RECORD_NOT_EXISTS); | |
| 59 | 44 | } |
| 60 | 45 | } |
| 61 | 46 | |
| 62 | 47 | @Override |
| 63 | - public PointRecordDO getRecord(Long id) { | |
| 48 | + public MemberPointRecordDO getRecord(Long id) { | |
| 64 | 49 | return recordMapper.selectById(id); |
| 65 | 50 | } |
| 66 | 51 | |
| 67 | 52 | @Override |
| 68 | - public List<PointRecordDO> getRecordList(Collection<Long> ids) { | |
| 69 | - return recordMapper.selectBatchIds(ids); | |
| 70 | - } | |
| 71 | - | |
| 72 | - @Override | |
| 73 | - public PageResult<PointRecordDO> getRecordPage(PointRecordPageReqVO pageReqVO) { | |
| 53 | + public PageResult<MemberPointRecordDO> getRecordPage(MemberPointRecordPageReqVO pageReqVO) { | |
| 74 | 54 | return recordMapper.selectPage(pageReqVO); |
| 75 | 55 | } |
| 76 | 56 | |
| 77 | - @Override | |
| 78 | - public List<PointRecordDO> getRecordList(PointRecordExportReqVO exportReqVO) { | |
| 79 | - return recordMapper.selectList(exportReqVO); | |
| 80 | - } | |
| 81 | - | |
| 82 | 57 | } | ... | ... |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/signinconfig/SignInConfigService.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInConfigService.java
| 1 | -package cn.iocoder.yudao.module.point.service.signinconfig; | |
| 1 | +package cn.iocoder.yudao.module.member.service.signin; | |
| 2 | 2 | |
| 3 | -import java.util.*; | |
| 4 | -import javax.validation.*; | |
| 5 | -import cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo.*; | |
| 6 | -import cn.iocoder.yudao.module.point.dal.dataobject.signinconfig.SignInConfigDO; | |
| 7 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigCreateReqVO; | |
| 5 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigPageReqVO; | |
| 6 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigUpdateReqVO; | |
| 7 | +import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO; | |
| 8 | + | |
| 9 | +import javax.validation.Valid; | |
| 8 | 10 | |
| 9 | 11 | /** |
| 10 | 12 | * 积分签到规则 Service 接口 |
| 11 | 13 | * |
| 12 | 14 | * @author QingX |
| 13 | 15 | */ |
| 14 | -public interface SignInConfigService { | |
| 16 | +public interface MemberSignInConfigService { | |
| 15 | 17 | |
| 16 | 18 | /** |
| 17 | 19 | * 创建积分签到规则 |
| ... | ... | @@ -19,14 +21,14 @@ public interface SignInConfigService { |
| 19 | 21 | * @param createReqVO 创建信息 |
| 20 | 22 | * @return 编号 |
| 21 | 23 | */ |
| 22 | - Integer createSignInConfig(@Valid SignInConfigCreateReqVO createReqVO); | |
| 24 | + Integer createSignInConfig(@Valid MemberSignInConfigCreateReqVO createReqVO); | |
| 23 | 25 | |
| 24 | 26 | /** |
| 25 | 27 | * 更新积分签到规则 |
| 26 | 28 | * |
| 27 | 29 | * @param updateReqVO 更新信息 |
| 28 | 30 | */ |
| 29 | - void updateSignInConfig(@Valid SignInConfigUpdateReqVO updateReqVO); | |
| 31 | + void updateSignInConfig(@Valid MemberSignInConfigUpdateReqVO updateReqVO); | |
| 30 | 32 | |
| 31 | 33 | /** |
| 32 | 34 | * 删除积分签到规则 |
| ... | ... | @@ -41,15 +43,7 @@ public interface SignInConfigService { |
| 41 | 43 | * @param id 编号 |
| 42 | 44 | * @return 积分签到规则 |
| 43 | 45 | */ |
| 44 | - SignInConfigDO getSignInConfig(Integer id); | |
| 45 | - | |
| 46 | - /** | |
| 47 | - * 获得积分签到规则列表 | |
| 48 | - * | |
| 49 | - * @param ids 编号 | |
| 50 | - * @return 积分签到规则列表 | |
| 51 | - */ | |
| 52 | - List<SignInConfigDO> getSignInConfigList(Collection<Integer> ids); | |
| 46 | + MemberSignInConfigDO getSignInConfig(Integer id); | |
| 53 | 47 | |
| 54 | 48 | /** |
| 55 | 49 | * 获得积分签到规则分页 |
| ... | ... | @@ -57,14 +51,6 @@ public interface SignInConfigService { |
| 57 | 51 | * @param pageReqVO 分页查询 |
| 58 | 52 | * @return 积分签到规则分页 |
| 59 | 53 | */ |
| 60 | - PageResult<SignInConfigDO> getSignInConfigPage(SignInConfigPageReqVO pageReqVO); | |
| 61 | - | |
| 62 | - /** | |
| 63 | - * 获得积分签到规则列表, 用于 Excel 导出 | |
| 64 | - * | |
| 65 | - * @param exportReqVO 查询条件 | |
| 66 | - * @return 积分签到规则列表 | |
| 67 | - */ | |
| 68 | - List<SignInConfigDO> getSignInConfigList(SignInConfigExportReqVO exportReqVO); | |
| 54 | + PageResult<MemberSignInConfigDO> getSignInConfigPage(MemberSignInConfigPageReqVO pageReqVO); | |
| 69 | 55 | |
| 70 | 56 | } | ... | ... |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/signinconfig/SignInConfigServiceImpl.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInConfigServiceImpl.java
| 1 | -package cn.iocoder.yudao.module.point.service.signinconfig; | |
| 1 | +package cn.iocoder.yudao.module.member.service.signin; | |
| 2 | 2 | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigCreateReqVO; | |
| 5 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigPageReqVO; | |
| 6 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigUpdateReqVO; | |
| 7 | +import cn.iocoder.yudao.module.member.convert.signin.MemberSignInConfigConvert; | |
| 8 | +import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO; | |
| 9 | +import cn.iocoder.yudao.module.member.dal.mysql.signin.MemberSignInConfigMapper; | |
| 3 | 10 | import org.springframework.stereotype.Service; |
| 4 | -import javax.annotation.Resource; | |
| 5 | 11 | import org.springframework.validation.annotation.Validated; |
| 6 | 12 | |
| 7 | -import java.util.*; | |
| 8 | -import cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo.*; | |
| 9 | -import cn.iocoder.yudao.module.point.dal.dataobject.signinconfig.SignInConfigDO; | |
| 10 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 11 | - | |
| 12 | -import cn.iocoder.yudao.module.point.convert.signinconfig.SignInConfigConvert; | |
| 13 | -import cn.iocoder.yudao.module.point.dal.mysql.signinconfig.SignInConfigMapper; | |
| 13 | +import javax.annotation.Resource; | |
| 14 | 14 | |
| 15 | 15 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 16 | -import static cn.iocoder.yudao.module.point.enums.ErrorCodeConstants.*; | |
| 16 | +import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.SIGN_IN_CONFIG_EXISTS; | |
| 17 | +import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.SIGN_IN_CONFIG_NOT_EXISTS; | |
| 17 | 18 | |
| 18 | 19 | /** |
| 19 | 20 | * 积分签到规则 Service 实现类 |
| ... | ... | @@ -22,33 +23,35 @@ import static cn.iocoder.yudao.module.point.enums.ErrorCodeConstants.*; |
| 22 | 23 | */ |
| 23 | 24 | @Service |
| 24 | 25 | @Validated |
| 25 | -public class SignInConfigServiceImpl implements SignInConfigService { | |
| 26 | +public class MemberSignInConfigServiceImpl implements MemberSignInConfigService { | |
| 26 | 27 | |
| 27 | 28 | @Resource |
| 28 | - private SignInConfigMapper signInConfigMapper; | |
| 29 | + private MemberSignInConfigMapper memberSignInConfigMapper; | |
| 29 | 30 | |
| 31 | + // TODO @xiaqing:这种写的逻辑,最好按照 校验 - 更新这样的顺序写;类似这里,37 要放到 34 前面;updateSignInConfig 也是一样的思路 | |
| 30 | 32 | @Override |
| 31 | - public Integer createSignInConfig(SignInConfigCreateReqVO createReqVO) { | |
| 33 | + public Integer createSignInConfig(MemberSignInConfigCreateReqVO createReqVO) { | |
| 32 | 34 | // 插入 |
| 33 | - SignInConfigDO signInConfig = SignInConfigConvert.INSTANCE.convert(createReqVO); | |
| 34 | - //判断是否重复插入签到天数 | |
| 35 | + MemberSignInConfigDO signInConfig = MemberSignInConfigConvert.INSTANCE.convert(createReqVO); | |
| 36 | + // 判断是否重复插入签到天数 | |
| 35 | 37 | validateSignInConfigExistsDay(signInConfig.getDay()); |
| 36 | - signInConfigMapper.insert(signInConfig); | |
| 38 | + memberSignInConfigMapper.insert(signInConfig); | |
| 37 | 39 | // 返回 |
| 38 | 40 | return signInConfig.getId(); |
| 39 | 41 | } |
| 40 | 42 | |
| 43 | + // TODO @xiaqing:这个逻辑的空行要注意;52 到 53 是没必要的空行;而 49 和 50 之间有个空行会好点,可以区分出是 校验 - 更新这样的逻辑间隔 | |
| 41 | 44 | @Override |
| 42 | - public void updateSignInConfig(SignInConfigUpdateReqVO updateReqVO) { | |
| 45 | + public void updateSignInConfig(MemberSignInConfigUpdateReqVO updateReqVO) { | |
| 43 | 46 | // 校验存在 |
| 44 | 47 | validateSignInConfigExists(updateReqVO.getId()); |
| 45 | 48 | //判断是否重复插入签到天数 |
| 46 | 49 | validateSignInConfigSameDayNotSelf(updateReqVO); |
| 47 | 50 | // 判断更新的 |
| 48 | - SignInConfigDO updateObj = SignInConfigConvert.INSTANCE.convert(updateReqVO); | |
| 51 | + MemberSignInConfigDO updateObj = MemberSignInConfigConvert.INSTANCE.convert(updateReqVO); | |
| 49 | 52 | |
| 50 | 53 | |
| 51 | - signInConfigMapper.updateById(updateObj); | |
| 54 | + memberSignInConfigMapper.updateById(updateObj); | |
| 52 | 55 | } |
| 53 | 56 | |
| 54 | 57 | @Override |
| ... | ... | @@ -56,47 +59,39 @@ public class SignInConfigServiceImpl implements SignInConfigService { |
| 56 | 59 | // 校验存在 |
| 57 | 60 | validateSignInConfigExists(id); |
| 58 | 61 | // 删除 |
| 59 | - signInConfigMapper.deleteById(id); | |
| 62 | + memberSignInConfigMapper.deleteById(id); | |
| 60 | 63 | } |
| 61 | 64 | |
| 62 | 65 | private void validateSignInConfigExists(Integer id) { |
| 63 | - if (signInConfigMapper.selectById(id) == null) { | |
| 66 | + if (memberSignInConfigMapper.selectById(id) == null) { | |
| 64 | 67 | throw exception(SIGN_IN_CONFIG_NOT_EXISTS); |
| 65 | 68 | } |
| 66 | 69 | } |
| 70 | + | |
| 71 | + // TODO @xiaqing:这个唯一判断,也可以参考下别的模块哈; | |
| 67 | 72 | //根据签到天数判断是否存在一个相同的天数 |
| 68 | 73 | private void validateSignInConfigExistsDay(Integer day) { |
| 69 | - if (signInConfigMapper.selectCount(SignInConfigDO::getDay,day)>0) { | |
| 74 | + if (memberSignInConfigMapper.selectCount(MemberSignInConfigDO::getDay,day)>0) { | |
| 70 | 75 | throw exception(SIGN_IN_CONFIG_EXISTS); |
| 71 | 76 | } |
| 72 | 77 | } |
| 73 | 78 | |
| 74 | - //更新天数时判断是否有重复的天数,需要去除自己 | |
| 75 | - private void validateSignInConfigSameDayNotSelf(SignInConfigUpdateReqVO reqVO) { | |
| 76 | - if (signInConfigMapper.selectSameDayNotSelf(reqVO)>0) { | |
| 79 | + // TODO @xiaqing:参考下别的模块,判断唯一,排除自己怎么写的哈; | |
| 80 | + // 更新天数时判断是否有重复的天数,需要去除自己 | |
| 81 | + private void validateSignInConfigSameDayNotSelf(MemberSignInConfigUpdateReqVO reqVO) { | |
| 82 | + if (memberSignInConfigMapper.selectSameDayNotSelf(reqVO)>0) { | |
| 77 | 83 | throw exception(SIGN_IN_CONFIG_EXISTS); |
| 78 | 84 | } |
| 79 | 85 | } |
| 80 | 86 | |
| 81 | - | |
| 82 | - @Override | |
| 83 | - public SignInConfigDO getSignInConfig(Integer id) { | |
| 84 | - return signInConfigMapper.selectById(id); | |
| 85 | - } | |
| 86 | - | |
| 87 | - @Override | |
| 88 | - public List<SignInConfigDO> getSignInConfigList(Collection<Integer> ids) { | |
| 89 | - return signInConfigMapper.selectBatchIds(ids); | |
| 90 | - } | |
| 91 | - | |
| 92 | 87 | @Override |
| 93 | - public PageResult<SignInConfigDO> getSignInConfigPage(SignInConfigPageReqVO pageReqVO) { | |
| 94 | - return signInConfigMapper.selectPage(pageReqVO); | |
| 88 | + public MemberSignInConfigDO getSignInConfig(Integer id) { | |
| 89 | + return memberSignInConfigMapper.selectById(id); | |
| 95 | 90 | } |
| 96 | 91 | |
| 97 | 92 | @Override |
| 98 | - public List<SignInConfigDO> getSignInConfigList(SignInConfigExportReqVO exportReqVO) { | |
| 99 | - return signInConfigMapper.selectList(exportReqVO); | |
| 93 | + public PageResult<MemberSignInConfigDO> getSignInConfigPage(MemberSignInConfigPageReqVO pageReqVO) { | |
| 94 | + return memberSignInConfigMapper.selectPage(pageReqVO); | |
| 100 | 95 | } |
| 101 | 96 | |
| 102 | 97 | } | ... | ... |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/signinrecord/SignInRecordService.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordService.java
| 1 | -package cn.iocoder.yudao.module.point.service.signinrecord; | |
| 1 | +package cn.iocoder.yudao.module.member.service.signin; | |
| 2 | 2 | |
| 3 | -import java.util.*; | |
| 4 | -import javax.validation.*; | |
| 5 | -import cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo.*; | |
| 6 | -import cn.iocoder.yudao.module.point.dal.dataobject.signinrecord.SignInRecordDO; | |
| 7 | 3 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 4 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordPageReqVO; | |
| 5 | +import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO; | |
| 8 | 6 | |
| 9 | 7 | /** |
| 10 | 8 | * 用户签到积分 Service 接口 |
| 11 | 9 | * |
| 12 | 10 | * @author 芋道源码 |
| 13 | 11 | */ |
| 14 | -public interface SignInRecordService { | |
| 15 | - | |
| 16 | - /** | |
| 17 | - * 创建用户签到积分 | |
| 18 | - * | |
| 19 | - * @param createReqVO 创建信息 | |
| 20 | - * @return 编号 | |
| 21 | - */ | |
| 22 | - Long createSignInRecord(@Valid SignInRecordCreateReqVO createReqVO); | |
| 23 | - | |
| 24 | - /** | |
| 25 | - * 更新用户签到积分 | |
| 26 | - * | |
| 27 | - * @param updateReqVO 更新信息 | |
| 28 | - */ | |
| 29 | - void updateSignInRecord(@Valid SignInRecordUpdateReqVO updateReqVO); | |
| 12 | +public interface MemberSignInRecordService { | |
| 30 | 13 | |
| 31 | 14 | /** |
| 32 | 15 | * 删除用户签到积分 |
| ... | ... | @@ -41,15 +24,7 @@ public interface SignInRecordService { |
| 41 | 24 | * @param id 编号 |
| 42 | 25 | * @return 用户签到积分 |
| 43 | 26 | */ |
| 44 | - SignInRecordDO getSignInRecord(Long id); | |
| 45 | - | |
| 46 | - /** | |
| 47 | - * 获得用户签到积分列表 | |
| 48 | - * | |
| 49 | - * @param ids 编号 | |
| 50 | - * @return 用户签到积分列表 | |
| 51 | - */ | |
| 52 | - List<SignInRecordDO> getSignInRecordList(Collection<Long> ids); | |
| 27 | + MemberSignInRecordDO getSignInRecord(Long id); | |
| 53 | 28 | |
| 54 | 29 | /** |
| 55 | 30 | * 获得用户签到积分分页 |
| ... | ... | @@ -57,14 +32,6 @@ public interface SignInRecordService { |
| 57 | 32 | * @param pageReqVO 分页查询 |
| 58 | 33 | * @return 用户签到积分分页 |
| 59 | 34 | */ |
| 60 | - PageResult<SignInRecordDO> getSignInRecordPage(SignInRecordPageReqVO pageReqVO); | |
| 61 | - | |
| 62 | - /** | |
| 63 | - * 获得用户签到积分列表, 用于 Excel 导出 | |
| 64 | - * | |
| 65 | - * @param exportReqVO 查询条件 | |
| 66 | - * @return 用户签到积分列表 | |
| 67 | - */ | |
| 68 | - List<SignInRecordDO> getSignInRecordList(SignInRecordExportReqVO exportReqVO); | |
| 35 | + PageResult<MemberSignInRecordDO> getSignInRecordPage(MemberSignInRecordPageReqVO pageReqVO); | |
| 69 | 36 | |
| 70 | 37 | } | ... | ... |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordServiceImpl.java
0 → 100644
| 1 | +package cn.iocoder.yudao.module.member.service.signin; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 4 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordPageReqVO; | |
| 5 | +import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO; | |
| 6 | +import cn.iocoder.yudao.module.member.dal.mysql.signin.MemberSignInRecordMapper; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | +import org.springframework.validation.annotation.Validated; | |
| 9 | + | |
| 10 | +import javax.annotation.Resource; | |
| 11 | + | |
| 12 | +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 13 | +import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.SIGN_IN_RECORD_NOT_EXISTS; | |
| 14 | + | |
| 15 | +/** | |
| 16 | + * 用户签到积分 Service 实现类 | |
| 17 | + * | |
| 18 | + * @author 芋道源码 | |
| 19 | + */ | |
| 20 | +@Service | |
| 21 | +@Validated | |
| 22 | +public class MemberSignInRecordServiceImpl implements MemberSignInRecordService { | |
| 23 | + | |
| 24 | + @Resource | |
| 25 | + private MemberSignInRecordMapper memberSignInRecordMapper; | |
| 26 | + | |
| 27 | + @Override | |
| 28 | + public void deleteSignInRecord(Long id) { | |
| 29 | + // 校验存在 | |
| 30 | + validateSignInRecordExists(id); | |
| 31 | + // 删除 | |
| 32 | + memberSignInRecordMapper.deleteById(id); | |
| 33 | + } | |
| 34 | + | |
| 35 | + private void validateSignInRecordExists(Long id) { | |
| 36 | + if (memberSignInRecordMapper.selectById(id) == null) { | |
| 37 | + throw exception(SIGN_IN_RECORD_NOT_EXISTS); | |
| 38 | + } | |
| 39 | + } | |
| 40 | + | |
| 41 | + @Override | |
| 42 | + public MemberSignInRecordDO getSignInRecord(Long id) { | |
| 43 | + return memberSignInRecordMapper.selectById(id); | |
| 44 | + } | |
| 45 | + | |
| 46 | + @Override | |
| 47 | + public PageResult<MemberSignInRecordDO> getSignInRecordPage(MemberSignInRecordPageReqVO pageReqVO) { | |
| 48 | + return memberSignInRecordMapper.selectPage(pageReqVO); | |
| 49 | + } | |
| 50 | + | |
| 51 | +} | ... | ... |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/controller/admin/tag/MpTagController.java
| ... | ... | @@ -52,6 +52,14 @@ public class MpTagController { |
| 52 | 52 | return success(true); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | + @GetMapping("/get") | |
| 56 | + @Operation(summary = "获取公众号标签详情") | |
| 57 | + @PreAuthorize("@ss.hasPermission('mp:tag:query')") | |
| 58 | + public CommonResult<MpTagRespVO> get(@RequestParam("id") Long id) { | |
| 59 | + MpTagDO mpTagDO = mpTagService.get(id); | |
| 60 | + return success(MpTagConvert.INSTANCE.convert(mpTagDO)); | |
| 61 | + } | |
| 62 | + | |
| 55 | 63 | @GetMapping("/page") |
| 56 | 64 | @Operation(summary = "获取公众号标签分页") |
| 57 | 65 | @PreAuthorize("@ss.hasPermission('mp:tag:query')") | ... | ... |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/convert/tag/MpTagConvert.java
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/MpTagService.java
| ... | ... | @@ -46,6 +46,13 @@ public interface MpTagService { |
| 46 | 46 | */ |
| 47 | 47 | PageResult<MpTagDO> getTagPage(MpTagPageReqVO pageReqVO); |
| 48 | 48 | |
| 49 | + /** | |
| 50 | + * 获得公众号标签详情 | |
| 51 | + * @param id id查询 | |
| 52 | + * @return 公众号标签详情 | |
| 53 | + */ | |
| 54 | + MpTagDO get(Long id); | |
| 55 | + | |
| 49 | 56 | List<MpTagDO> getTagList(); |
| 50 | 57 | |
| 51 | 58 | /** | ... | ... |
yudao-module-mp/yudao-module-mp-biz/src/main/java/cn/iocoder/yudao/module/mp/service/tag/MpTagServiceImpl.java
| ... | ... | @@ -117,6 +117,11 @@ public class MpTagServiceImpl implements MpTagService { |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | @Override |
| 120 | + public MpTagDO get(Long id) { | |
| 121 | + return mpTagMapper.selectById(id); | |
| 122 | + } | |
| 123 | + | |
| 124 | + @Override | |
| 120 | 125 | public List<MpTagDO> getTagList() { |
| 121 | 126 | return mpTagMapper.selectList(); |
| 122 | 127 | } | ... | ... |
yudao-module-pay/yudao-module-pay-api/src/main/java/cn/iocoder/yudao/module/pay/enums/DictTypeConstants.java
| ... | ... | @@ -7,6 +7,8 @@ package cn.iocoder.yudao.module.pay.enums; |
| 7 | 7 | */ |
| 8 | 8 | public interface DictTypeConstants { |
| 9 | 9 | |
| 10 | + String CHANNEL_CODE_TYPE = "pay_channel_code_type"; // 支付-渠道名 | |
| 11 | + | |
| 10 | 12 | String ORDER_STATUS = "pay_order_status"; // 支付-订单-订单状态 |
| 11 | 13 | String ORDER_NOTIFY_STATUS = "pay_order_notify_status"; // 支付-订单-订单回调商户状态 |
| 12 | 14 | ... | ... |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/notify/PayNotifyController.java
| ... | ... | @@ -6,8 +6,6 @@ import cn.iocoder.yudao.framework.pay.core.client.PayClientFactory; |
| 6 | 6 | import cn.iocoder.yudao.framework.pay.core.client.dto.notify.PayNotifyReqDTO; |
| 7 | 7 | import cn.iocoder.yudao.framework.pay.core.client.dto.notify.PayOrderNotifyRespDTO; |
| 8 | 8 | import cn.iocoder.yudao.framework.pay.core.client.dto.notify.PayRefundNotifyRespDTO; |
| 9 | -import cn.iocoder.yudao.module.pay.dal.dataobject.merchant.PayChannelDO; | |
| 10 | -import cn.iocoder.yudao.module.pay.service.merchant.PayChannelService; | |
| 11 | 9 | import cn.iocoder.yudao.module.pay.service.order.PayOrderService; |
| 12 | 10 | import cn.iocoder.yudao.module.pay.service.refund.PayRefundService; |
| 13 | 11 | import io.swagger.v3.oas.annotations.Operation; |
| ... | ... | @@ -40,23 +38,6 @@ public class PayNotifyController { |
| 40 | 38 | private PayClientFactory payClientFactory; |
| 41 | 39 | |
| 42 | 40 | /** |
| 43 | - * 统一的跳转页面,支付宝跳转参数说明 | |
| 44 | - * | |
| 45 | - * <a href="https://opendocs.alipay.com/open/203/105285#前台回跳参数说明">支付宝 - 前台回跳参数说明</a> | |
| 46 | - * | |
| 47 | - * @param channelId 渠道编号 | |
| 48 | - * @return 返回跳转页面 | |
| 49 | - */ | |
| 50 | - @GetMapping(value = "/return/{channelId}") | |
| 51 | - @Operation(summary = "渠道统一的支付成功返回地址") | |
| 52 | - @Deprecated // TODO yunai:如果是 way 的情况,应该是跳转回前端地址 | |
| 53 | - public String returnCallback(@PathVariable("channelId") Long channelId, | |
| 54 | - @RequestParam Map<String, String> params) { | |
| 55 | - log.info("[returnCallback][app_id({}) 跳转]", params.get("app_id")); | |
| 56 | - return String.format("渠道[%s]支付成功", channelId); | |
| 57 | - } | |
| 58 | - | |
| 59 | - /** | |
| 60 | 41 | * 统一的渠道支付回调,支付宝的退款回调 |
| 61 | 42 | * |
| 62 | 43 | * @param channelId 渠道编号 | ... | ... |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/order/vo/PayOrderSubmitReqVO.java
| ... | ... | @@ -2,11 +2,10 @@ package cn.iocoder.yudao.module.pay.controller.admin.order.vo; |
| 2 | 2 | |
| 3 | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | 4 | import lombok.Data; |
| 5 | -import lombok.experimental.Accessors; | |
| 5 | +import org.hibernate.validator.constraints.URL; | |
| 6 | 6 | |
| 7 | 7 | import javax.validation.constraints.NotEmpty; |
| 8 | 8 | import javax.validation.constraints.NotNull; |
| 9 | -import java.awt.*; | |
| 10 | 9 | import java.util.Map; |
| 11 | 10 | |
| 12 | 11 | @Schema(description = "管理后台 - 支付订单提交 Request VO") |
| ... | ... | @@ -26,4 +25,9 @@ public class PayOrderSubmitReqVO { |
| 26 | 25 | |
| 27 | 26 | @Schema(description = "展示模式", example = "url") // 参见 {@link PayDisplayModeEnum} 枚举。如果不传递,则每个支付渠道使用默认的方式 |
| 28 | 27 | private String displayMode; |
| 28 | + | |
| 29 | + @Schema(description = "回跳地址") | |
| 30 | + @URL(message = "回跳地址的格式必须是 URL") | |
| 31 | + private String returnUrl; | |
| 32 | + | |
| 29 | 33 | } | ... | ... |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/app/order/AppPayOrderController.http
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/member/MemberWalletDO.java
| ... | ... | @@ -6,8 +6,9 @@ import com.baomidou.mybatisplus.annotation.TableId; |
| 6 | 6 | import com.baomidou.mybatisplus.annotation.TableName; |
| 7 | 7 | import lombok.Data; |
| 8 | 8 | |
| 9 | +// TODO @jason:修改 MemberWalletDO 为 PayWalletDO | |
| 9 | 10 | /** |
| 10 | - * 支付-会员钱包 DO | |
| 11 | + * 支付 - 会员钱包 DO | |
| 11 | 12 | * |
| 12 | 13 | * @author jason |
| 13 | 14 | */ |
| ... | ... | @@ -22,10 +23,12 @@ public class MemberWalletDO extends BaseDO { |
| 22 | 23 | @TableId |
| 23 | 24 | private Long id; |
| 24 | 25 | |
| 26 | + // TODO @jaosn:增加 userType 字段; | |
| 25 | 27 | /** |
| 26 | 28 | * 用户 id |
| 27 | 29 | * |
| 28 | 30 | * 关联 MemberUserDO 的 id 编号 |
| 31 | + * 关联 AdminUserDO 的 id 编号 | |
| 29 | 32 | */ |
| 30 | 33 | private Long userId; |
| 31 | 34 | |
| ... | ... | @@ -43,4 +46,4 @@ public class MemberWalletDO extends BaseDO { |
| 43 | 46 | * 累计充值, 单位分 |
| 44 | 47 | */ |
| 45 | 48 | private Integer totalTopUp; |
| 46 | -} | |
| 47 | 49 | \ No newline at end of file |
| 50 | +} | ... | ... |
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/order/PayOrderServiceImpl.java
| ... | ... | @@ -4,7 +4,6 @@ import cn.hutool.core.date.DateUtil; |
| 4 | 4 | import cn.hutool.core.util.ObjectUtil; |
| 5 | 5 | import cn.hutool.core.util.RandomUtil; |
| 6 | 6 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 7 | -import cn.iocoder.yudao.framework.common.util.json.JsonUtils; | |
| 8 | 7 | import cn.iocoder.yudao.framework.pay.config.PayProperties; |
| 9 | 8 | import cn.iocoder.yudao.framework.pay.core.client.PayClient; |
| 10 | 9 | import cn.iocoder.yudao.framework.pay.core.client.PayClientFactory; |
| ... | ... | @@ -44,7 +43,7 @@ import java.util.Collection; |
| 44 | 43 | import java.util.List; |
| 45 | 44 | |
| 46 | 45 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 47 | -import static cn.iocoder.yudao.framework.common.util.json.JsonUtils.*; | |
| 46 | +import static cn.iocoder.yudao.framework.common.util.json.JsonUtils.toJsonString; | |
| 48 | 47 | |
| 49 | 48 | /** |
| 50 | 49 | * 支付订单 Service 实现类 |
| ... | ... | @@ -147,7 +146,7 @@ public class PayOrderServiceImpl implements PayOrderService { |
| 147 | 146 | .setMerchantOrderId(orderExtension.getNo()) // 注意,此处使用的是 PayOrderExtensionDO.no 属性! |
| 148 | 147 | .setSubject(order.getSubject()).setBody(order.getBody()) |
| 149 | 148 | .setNotifyUrl(genChannelPayNotifyUrl(channel)) |
| 150 | - .setReturnUrl(genChannelReturnUrl(channel)) | |
| 149 | + .setReturnUrl(reqVO.getReturnUrl()) | |
| 151 | 150 | // 订单相关字段 |
| 152 | 151 | .setAmount(order.getAmount()).setExpireTime(order.getExpireTime()); |
| 153 | 152 | PayOrderUnifiedRespDTO unifiedOrderRespDTO = client.unifiedOrder(unifiedOrderReqDTO); |
| ... | ... | @@ -184,15 +183,6 @@ public class PayOrderServiceImpl implements PayOrderService { |
| 184 | 183 | } |
| 185 | 184 | |
| 186 | 185 | /** |
| 187 | - * 根据支付渠道的编码,生成支付渠道的返回地址 | |
| 188 | - * @param channel 支付渠道 | |
| 189 | - * @return 支付成功返回的地址。 配置地址 + "/" + channel id | |
| 190 | - */ | |
| 191 | - private String genChannelReturnUrl(PayChannelDO channel) { | |
| 192 | - return payProperties.getReturnUrl() + "/" + channel.getId(); | |
| 193 | - } | |
| 194 | - | |
| 195 | - /** | |
| 196 | 186 | * 根据支付渠道的编码,生成支付渠道的回调地址 |
| 197 | 187 | * |
| 198 | 188 | * @param channel 支付渠道 | ... | ... |
yudao-module-point/pom.xml deleted
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | -<project xmlns="http://maven.apache.org/POM/4.0.0" | |
| 3 | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| 4 | - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
| 5 | - <modelVersion>4.0.0</modelVersion> | |
| 6 | - <parent> | |
| 7 | - <groupId>cn.iocoder.boot</groupId> | |
| 8 | - <artifactId>yudao</artifactId> | |
| 9 | - <version>${revision}</version> | |
| 10 | - </parent> | |
| 11 | - | |
| 12 | - <artifactId>yudao-module-point</artifactId> | |
| 13 | - <packaging>pom</packaging> | |
| 14 | - <modules> | |
| 15 | - <module>yudao-module-point-api</module> | |
| 16 | - </modules> | |
| 17 | - | |
| 18 | - | |
| 19 | -</project> | |
| 20 | 0 | \ No newline at end of file |
yudao-module-point/yudao-module-point-api/pom.xml deleted
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | -<project xmlns="http://maven.apache.org/POM/4.0.0" | |
| 3 | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| 4 | - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
| 5 | - <modelVersion>4.0.0</modelVersion> | |
| 6 | - <parent> | |
| 7 | - <groupId>cn.iocoder.boot</groupId> | |
| 8 | - <artifactId>yudao-module-point</artifactId> | |
| 9 | - <version>${revision}</version> | |
| 10 | - </parent> | |
| 11 | - | |
| 12 | - <artifactId>yudao-module-point-api</artifactId> | |
| 13 | - <packaging>jar</packaging> | |
| 14 | - | |
| 15 | - <dependencies> | |
| 16 | - <dependency> | |
| 17 | - <groupId>cn.iocoder.boot</groupId> | |
| 18 | - <artifactId>yudao-common</artifactId> | |
| 19 | - </dependency> | |
| 20 | - | |
| 21 | - <!-- 参数校验 --> | |
| 22 | - <dependency> | |
| 23 | - <groupId>org.springframework.boot</groupId> | |
| 24 | - <artifactId>spring-boot-starter-validation</artifactId> | |
| 25 | - <optional>true</optional> | |
| 26 | - </dependency> | |
| 27 | - </dependencies> | |
| 28 | -</project> | |
| 29 | 0 | \ No newline at end of file |
yudao-module-point/yudao-module-point-api/src/main/java/cn/iocoder/yudao/module/point/enums/ErrorCodeConstants.java deleted
| 1 | -package cn.iocoder.yudao.module.point.enums; | |
| 2 | - | |
| 3 | - | |
| 4 | -import cn.iocoder.yudao.framework.common.exception.ErrorCode; | |
| 5 | - | |
| 6 | -/** | |
| 7 | - * Pay 错误码 Core 枚举类 | |
| 8 | - * | |
| 9 | - * pay 系统,使用 1-007-000-000 段 | |
| 10 | - */ | |
| 11 | -public interface ErrorCodeConstants { | |
| 12 | - | |
| 13 | - ErrorCode CONFIG_NOT_EXISTS = new ErrorCode(499, "积分设置不存在"); | |
| 14 | - | |
| 15 | - ErrorCode CONFIG_EXISTS = new ErrorCode(499, "积分设置已存在,只允配置一条记录"); | |
| 16 | - | |
| 17 | - | |
| 18 | - ErrorCode SIGN_IN_CONFIG_NOT_EXISTS = new ErrorCode(499, "签到天数规则不存在"); | |
| 19 | - ErrorCode SIGN_IN_CONFIG_EXISTS = new ErrorCode(499, "签到天数规则已存在"); | |
| 20 | - | |
| 21 | - ErrorCode RECORD_NOT_EXISTS = new ErrorCode( 499, "用户积分记录不存在"); | |
| 22 | - | |
| 23 | - ErrorCode SIGN_IN_RECORD_NOT_EXISTS = new ErrorCode(499, "用户签到积分不存在"); | |
| 24 | - | |
| 25 | - | |
| 26 | - | |
| 27 | -} |
yudao-module-point/yudao-module-point-biz/pom.xml deleted
| 1 | -<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | -<project xmlns="http://maven.apache.org/POM/4.0.0" | |
| 3 | - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| 4 | - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
| 5 | - <modelVersion>4.0.0</modelVersion> | |
| 6 | - <parent> | |
| 7 | - <groupId>cn.iocoder.boot</groupId> | |
| 8 | - <artifactId>yudao-module-point</artifactId> | |
| 9 | - <version>${revision}</version> | |
| 10 | - </parent> | |
| 11 | - | |
| 12 | - <artifactId>yudao-module-point-biz</artifactId> | |
| 13 | - <packaging>jar</packaging> | |
| 14 | - | |
| 15 | - <dependencies> | |
| 16 | - <dependency> | |
| 17 | - <groupId>cn.iocoder.boot</groupId> | |
| 18 | - <artifactId>yudao-module-point-api</artifactId> | |
| 19 | - <version>${revision}</version> | |
| 20 | - </dependency> | |
| 21 | - | |
| 22 | - <!-- 业务组件 --> | |
| 23 | - <dependency> | |
| 24 | - <groupId>cn.iocoder.boot</groupId> | |
| 25 | - <artifactId>yudao-spring-boot-starter-biz-operatelog</artifactId> | |
| 26 | - </dependency> | |
| 27 | - | |
| 28 | - <!-- Web 相关 --> | |
| 29 | - <dependency> | |
| 30 | - <groupId>cn.iocoder.boot</groupId> | |
| 31 | - <artifactId>yudao-spring-boot-starter-web</artifactId> | |
| 32 | - </dependency> | |
| 33 | - | |
| 34 | - <dependency> | |
| 35 | - <groupId>cn.iocoder.boot</groupId> | |
| 36 | - <artifactId>yudao-spring-boot-starter-security</artifactId> | |
| 37 | - </dependency> | |
| 38 | - | |
| 39 | - <!-- DB 相关 --> | |
| 40 | - <dependency> | |
| 41 | - <groupId>cn.iocoder.boot</groupId> | |
| 42 | - <artifactId>yudao-spring-boot-starter-mybatis</artifactId> | |
| 43 | - </dependency> | |
| 44 | - | |
| 45 | - <!-- Test 测试相关 --> | |
| 46 | - <dependency> | |
| 47 | - <groupId>cn.iocoder.boot</groupId> | |
| 48 | - <artifactId>yudao-spring-boot-starter-test</artifactId> | |
| 49 | - </dependency> | |
| 50 | - | |
| 51 | - <!-- 工具类相关 --> | |
| 52 | - <dependency> | |
| 53 | - <groupId>cn.iocoder.boot</groupId> | |
| 54 | - <artifactId>yudao-spring-boot-starter-excel</artifactId> | |
| 55 | - </dependency> | |
| 56 | - </dependencies> | |
| 57 | -</project> | |
| 58 | 0 | \ No newline at end of file |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/PointRecordController.java deleted
| 1 | -package cn.iocoder.yudao.module.point.controller.admin.pointrecord; | |
| 2 | - | |
| 3 | -import org.springframework.web.bind.annotation.*; | |
| 4 | -import javax.annotation.Resource; | |
| 5 | -import org.springframework.validation.annotation.Validated; | |
| 6 | -import org.springframework.security.access.prepost.PreAuthorize; | |
| 7 | -import io.swagger.v3.oas.annotations.tags.Tag; | |
| 8 | -import io.swagger.v3.oas.annotations.Parameter; | |
| 9 | -import io.swagger.v3.oas.annotations.Operation; | |
| 10 | - | |
| 11 | -import javax.validation.constraints.*; | |
| 12 | -import javax.validation.*; | |
| 13 | -import javax.servlet.http.*; | |
| 14 | -import java.util.*; | |
| 15 | -import java.io.IOException; | |
| 16 | - | |
| 17 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 18 | -import cn.iocoder.yudao.framework.common.pojo.CommonResult; | |
| 19 | -import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | |
| 20 | - | |
| 21 | -import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | |
| 22 | - | |
| 23 | -import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | |
| 24 | -import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*; | |
| 25 | - | |
| 26 | -import cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo.*; | |
| 27 | -import cn.iocoder.yudao.module.point.dal.dataobject.pointrecord.PointRecordDO; | |
| 28 | -import cn.iocoder.yudao.module.point.convert.pointrecord.PointRecordConvert; | |
| 29 | -import cn.iocoder.yudao.module.point.service.pointrecord.PointRecordService; | |
| 30 | - | |
| 31 | -@Tag(name = "管理后台 - 用户积分记录") | |
| 32 | -@RestController | |
| 33 | -@RequestMapping("/point/record") | |
| 34 | -@Validated | |
| 35 | -public class PointRecordController { | |
| 36 | - | |
| 37 | - @Resource | |
| 38 | - private PointRecordService recordService; | |
| 39 | - | |
| 40 | - @PostMapping("/create") | |
| 41 | - @Operation(summary = "创建用户积分记录") | |
| 42 | - @PreAuthorize("@ss.hasPermission('point:record:create')") | |
| 43 | - public CommonResult<Long> createRecord(@Valid @RequestBody PointRecordCreateReqVO createReqVO) { | |
| 44 | - return success(recordService.createRecord(createReqVO)); | |
| 45 | - } | |
| 46 | - | |
| 47 | - @PutMapping("/update") | |
| 48 | - @Operation(summary = "更新用户积分记录") | |
| 49 | - @PreAuthorize("@ss.hasPermission('point:record:update')") | |
| 50 | - public CommonResult<Boolean> updateRecord(@Valid @RequestBody PointRecordUpdateReqVO updateReqVO) { | |
| 51 | - recordService.updateRecord(updateReqVO); | |
| 52 | - return success(true); | |
| 53 | - } | |
| 54 | - | |
| 55 | - @DeleteMapping("/delete") | |
| 56 | - @Operation(summary = "删除用户积分记录") | |
| 57 | - @Parameter(name = "id", description = "编号", required = true) | |
| 58 | - @PreAuthorize("@ss.hasPermission('point:record:delete')") | |
| 59 | - public CommonResult<Boolean> deleteRecord(@RequestParam("id") Long id) { | |
| 60 | - recordService.deleteRecord(id); | |
| 61 | - return success(true); | |
| 62 | - } | |
| 63 | - | |
| 64 | - @GetMapping("/get") | |
| 65 | - @Operation(summary = "获得用户积分记录") | |
| 66 | - @Parameter(name = "id", description = "编号", required = true, example = "1024") | |
| 67 | - @PreAuthorize("@ss.hasPermission('point:record:query')") | |
| 68 | - public CommonResult<PointRecordRespVO> getRecord(@RequestParam("id") Long id) { | |
| 69 | - PointRecordDO record = recordService.getRecord(id); | |
| 70 | - return success(PointRecordConvert.INSTANCE.convert(record)); | |
| 71 | - } | |
| 72 | - | |
| 73 | - @GetMapping("/list") | |
| 74 | - @Operation(summary = "获得用户积分记录列表") | |
| 75 | - @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") | |
| 76 | - @PreAuthorize("@ss.hasPermission('point:record:query')") | |
| 77 | - public CommonResult<List<PointRecordRespVO>> getRecordList(@RequestParam("ids") Collection<Long> ids) { | |
| 78 | - List<PointRecordDO> list = recordService.getRecordList(ids); | |
| 79 | - return success(PointRecordConvert.INSTANCE.convertList(list)); | |
| 80 | - } | |
| 81 | - | |
| 82 | - @GetMapping("/page") | |
| 83 | - @Operation(summary = "获得用户积分记录分页") | |
| 84 | - @PreAuthorize("@ss.hasPermission('point:record:query')") | |
| 85 | - public CommonResult<PageResult<PointRecordRespVO>> getRecordPage(@Valid PointRecordPageReqVO pageVO) { | |
| 86 | - PageResult<PointRecordDO> pageResult = recordService.getRecordPage(pageVO); | |
| 87 | - return success(PointRecordConvert.INSTANCE.convertPage(pageResult)); | |
| 88 | - } | |
| 89 | - | |
| 90 | - @GetMapping("/export-excel") | |
| 91 | - @Operation(summary = "导出用户积分记录 Excel") | |
| 92 | - @PreAuthorize("@ss.hasPermission('point:record:export')") | |
| 93 | - @OperateLog(type = EXPORT) | |
| 94 | - public void exportRecordExcel(@Valid PointRecordExportReqVO exportReqVO, | |
| 95 | - HttpServletResponse response) throws IOException { | |
| 96 | - List<PointRecordDO> list = recordService.getRecordList(exportReqVO); | |
| 97 | - // 导出 Excel | |
| 98 | - List<PointRecordExcelVO> datas = PointRecordConvert.INSTANCE.convertList02(list); | |
| 99 | - ExcelUtils.write(response, "用户积分记录.xls", "数据", PointRecordExcelVO.class, datas); | |
| 100 | - } | |
| 101 | - | |
| 102 | -} |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/vo/PointRecordExcelVO.java deleted
| 1 | -package cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo; | |
| 2 | - | |
| 3 | -import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | -import lombok.*; | |
| 5 | -import java.util.*; | |
| 6 | -import java.time.LocalDateTime; | |
| 7 | -import java.time.LocalDateTime; | |
| 8 | -import java.time.LocalDateTime; | |
| 9 | -import java.time.LocalDateTime; | |
| 10 | - | |
| 11 | -import com.alibaba.excel.annotation.ExcelProperty; | |
| 12 | -import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat; | |
| 13 | -import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | |
| 14 | - | |
| 15 | - | |
| 16 | -/** | |
| 17 | - * 用户积分记录 Excel VO | |
| 18 | - * | |
| 19 | - * @author QingX | |
| 20 | - */ | |
| 21 | -@Data | |
| 22 | -public class PointRecordExcelVO { | |
| 23 | - | |
| 24 | - @ExcelProperty("自增主键") | |
| 25 | - private Long id; | |
| 26 | - | |
| 27 | - @ExcelProperty("业务编码") | |
| 28 | - private String bizId; | |
| 29 | - | |
| 30 | - @ExcelProperty(value = "业务类型", converter = DictConvert.class) | |
| 31 | - @DictFormat("biz_type") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 | |
| 32 | - private String bizType; | |
| 33 | - | |
| 34 | - @ExcelProperty("1增加 0扣减") | |
| 35 | - private String type; | |
| 36 | - | |
| 37 | - @ExcelProperty("积分标题") | |
| 38 | - private String title; | |
| 39 | - | |
| 40 | - @ExcelProperty("积分描述") | |
| 41 | - private String description; | |
| 42 | - | |
| 43 | - @ExcelProperty("积分") | |
| 44 | - private Integer point; | |
| 45 | - | |
| 46 | - @ExcelProperty("变动后的积分") | |
| 47 | - private Integer totalPoint; | |
| 48 | - | |
| 49 | - @ExcelProperty(value = "状态:1-订单创建,2-冻结期,3-完成,4-失效(订单退款) ", converter = DictConvert.class) | |
| 50 | - @DictFormat("point_status") // TODO 代码优化:建议设置到对应的 XXXDictTypeConstants 枚举类中 | |
| 51 | - private Integer status; | |
| 52 | - | |
| 53 | - @ExcelProperty("用户id") | |
| 54 | - private Integer userId; | |
| 55 | - | |
| 56 | - @ExcelProperty("冻结时间") | |
| 57 | - private LocalDateTime freezingTime; | |
| 58 | - | |
| 59 | - @ExcelProperty("解冻时间") | |
| 60 | - private LocalDateTime thawingTime; | |
| 61 | - | |
| 62 | - @ExcelProperty("发生时间") | |
| 63 | - private LocalDateTime createTime; | |
| 64 | - | |
| 65 | -} |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigExcelVO.java deleted
| 1 | -package cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo; | |
| 2 | - | |
| 3 | -import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | -import lombok.*; | |
| 5 | -import java.util.*; | |
| 6 | -import java.time.LocalDateTime; | |
| 7 | -import java.time.LocalDateTime; | |
| 8 | - | |
| 9 | -import com.alibaba.excel.annotation.ExcelProperty; | |
| 10 | - | |
| 11 | -/** | |
| 12 | - * 积分签到规则 Excel VO | |
| 13 | - * | |
| 14 | - * @author QingX | |
| 15 | - */ | |
| 16 | -@Data | |
| 17 | -public class SignInConfigExcelVO { | |
| 18 | - | |
| 19 | - @ExcelProperty("签到第x天") | |
| 20 | - private Integer day; | |
| 21 | - | |
| 22 | - @ExcelProperty("签到天数对应分数") | |
| 23 | - private Integer point; | |
| 24 | - | |
| 25 | - @ExcelProperty("创建时间") | |
| 26 | - private LocalDateTime createTime; | |
| 27 | - | |
| 28 | -} |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigExportReqVO.java deleted
| 1 | -package cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo; | |
| 2 | - | |
| 3 | -import lombok.*; | |
| 4 | -import java.util.*; | |
| 5 | -import io.swagger.v3.oas.annotations.media.Schema; | |
| 6 | -import cn.iocoder.yudao.framework.common.pojo.PageParam; | |
| 7 | - | |
| 8 | -@Schema(description = "管理后台 - 积分签到规则 Excel 导出 Request VO,参数和 SignInConfigPageReqVO 是一致的") | |
| 9 | -@Data | |
| 10 | -public class SignInConfigExportReqVO { | |
| 11 | - | |
| 12 | - @Schema(description = "签到第x天", example = "7") | |
| 13 | - private Integer day; | |
| 14 | - | |
| 15 | -} |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/SignInRecordController.java deleted
| 1 | -package cn.iocoder.yudao.module.point.controller.admin.signinrecord; | |
| 2 | - | |
| 3 | -import org.springframework.web.bind.annotation.*; | |
| 4 | -import javax.annotation.Resource; | |
| 5 | -import org.springframework.validation.annotation.Validated; | |
| 6 | -import org.springframework.security.access.prepost.PreAuthorize; | |
| 7 | -import io.swagger.v3.oas.annotations.tags.Tag; | |
| 8 | -import io.swagger.v3.oas.annotations.Parameter; | |
| 9 | -import io.swagger.v3.oas.annotations.Operation; | |
| 10 | - | |
| 11 | -import javax.validation.constraints.*; | |
| 12 | -import javax.validation.*; | |
| 13 | -import javax.servlet.http.*; | |
| 14 | -import java.util.*; | |
| 15 | -import java.io.IOException; | |
| 16 | - | |
| 17 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 18 | -import cn.iocoder.yudao.framework.common.pojo.CommonResult; | |
| 19 | -import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | |
| 20 | - | |
| 21 | -import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | |
| 22 | - | |
| 23 | -import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | |
| 24 | -import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*; | |
| 25 | - | |
| 26 | -import cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo.*; | |
| 27 | -import cn.iocoder.yudao.module.point.dal.dataobject.signinrecord.SignInRecordDO; | |
| 28 | -import cn.iocoder.yudao.module.point.convert.signinrecord.SignInRecordConvert; | |
| 29 | -import cn.iocoder.yudao.module.point.service.signinrecord.SignInRecordService; | |
| 30 | - | |
| 31 | -@Tag(name = "管理后台 - 用户签到积分") | |
| 32 | -@RestController | |
| 33 | -@RequestMapping("/point/sign-in-record") | |
| 34 | -@Validated | |
| 35 | -public class SignInRecordController { | |
| 36 | - | |
| 37 | - @Resource | |
| 38 | - private SignInRecordService signInRecordService; | |
| 39 | - | |
| 40 | - @PostMapping("/create") | |
| 41 | - @Operation(summary = "创建用户签到积分") | |
| 42 | - @PreAuthorize("@ss.hasPermission('point:sign-in-record:create')") | |
| 43 | - public CommonResult<Long> createSignInRecord(@Valid @RequestBody SignInRecordCreateReqVO createReqVO) { | |
| 44 | - return success(signInRecordService.createSignInRecord(createReqVO)); | |
| 45 | - } | |
| 46 | - | |
| 47 | - @PutMapping("/update") | |
| 48 | - @Operation(summary = "更新用户签到积分") | |
| 49 | - @PreAuthorize("@ss.hasPermission('point:sign-in-record:update')") | |
| 50 | - public CommonResult<Boolean> updateSignInRecord(@Valid @RequestBody SignInRecordUpdateReqVO updateReqVO) { | |
| 51 | - signInRecordService.updateSignInRecord(updateReqVO); | |
| 52 | - return success(true); | |
| 53 | - } | |
| 54 | - | |
| 55 | - @DeleteMapping("/delete") | |
| 56 | - @Operation(summary = "删除用户签到积分") | |
| 57 | - @Parameter(name = "id", description = "编号", required = true) | |
| 58 | - @PreAuthorize("@ss.hasPermission('point:sign-in-record:delete')") | |
| 59 | - public CommonResult<Boolean> deleteSignInRecord(@RequestParam("id") Long id) { | |
| 60 | - signInRecordService.deleteSignInRecord(id); | |
| 61 | - return success(true); | |
| 62 | - } | |
| 63 | - | |
| 64 | - @GetMapping("/get") | |
| 65 | - @Operation(summary = "获得用户签到积分") | |
| 66 | - @Parameter(name = "id", description = "编号", required = true, example = "1024") | |
| 67 | - @PreAuthorize("@ss.hasPermission('point:sign-in-record:query')") | |
| 68 | - public CommonResult<SignInRecordRespVO> getSignInRecord(@RequestParam("id") Long id) { | |
| 69 | - SignInRecordDO signInRecord = signInRecordService.getSignInRecord(id); | |
| 70 | - return success(SignInRecordConvert.INSTANCE.convert(signInRecord)); | |
| 71 | - } | |
| 72 | - | |
| 73 | - @GetMapping("/list") | |
| 74 | - @Operation(summary = "获得用户签到积分列表") | |
| 75 | - @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") | |
| 76 | - @PreAuthorize("@ss.hasPermission('point:sign-in-record:query')") | |
| 77 | - public CommonResult<List<SignInRecordRespVO>> getSignInRecordList(@RequestParam("ids") Collection<Long> ids) { | |
| 78 | - List<SignInRecordDO> list = signInRecordService.getSignInRecordList(ids); | |
| 79 | - return success(SignInRecordConvert.INSTANCE.convertList(list)); | |
| 80 | - } | |
| 81 | - | |
| 82 | - @GetMapping("/page") | |
| 83 | - @Operation(summary = "获得用户签到积分分页") | |
| 84 | - @PreAuthorize("@ss.hasPermission('point:sign-in-record:query')") | |
| 85 | - public CommonResult<PageResult<SignInRecordRespVO>> getSignInRecordPage(@Valid SignInRecordPageReqVO pageVO) { | |
| 86 | - PageResult<SignInRecordDO> pageResult = signInRecordService.getSignInRecordPage(pageVO); | |
| 87 | - return success(SignInRecordConvert.INSTANCE.convertPage(pageResult)); | |
| 88 | - } | |
| 89 | - | |
| 90 | - @GetMapping("/export-excel") | |
| 91 | - @Operation(summary = "导出用户签到积分 Excel") | |
| 92 | - @PreAuthorize("@ss.hasPermission('point:sign-in-record:export')") | |
| 93 | - @OperateLog(type = EXPORT) | |
| 94 | - public void exportSignInRecordExcel(@Valid SignInRecordExportReqVO exportReqVO, | |
| 95 | - HttpServletResponse response) throws IOException { | |
| 96 | - List<SignInRecordDO> list = signInRecordService.getSignInRecordList(exportReqVO); | |
| 97 | - // 导出 Excel | |
| 98 | - List<SignInRecordExcelVO> datas = SignInRecordConvert.INSTANCE.convertList02(list); | |
| 99 | - ExcelUtils.write(response, "用户签到积分.xls", "数据", SignInRecordExcelVO.class, datas); | |
| 100 | - } | |
| 101 | - | |
| 102 | -} |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordExcelVO.java deleted
| 1 | -package cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo; | |
| 2 | - | |
| 3 | -import io.swagger.v3.oas.annotations.media.Schema; | |
| 4 | -import lombok.*; | |
| 5 | -import java.util.*; | |
| 6 | -import java.time.LocalDateTime; | |
| 7 | -import java.time.LocalDateTime; | |
| 8 | - | |
| 9 | -import com.alibaba.excel.annotation.ExcelProperty; | |
| 10 | - | |
| 11 | -/** | |
| 12 | - * 用户签到积分 Excel VO | |
| 13 | - * | |
| 14 | - * @author 芋道源码 | |
| 15 | - */ | |
| 16 | -@Data | |
| 17 | -public class SignInRecordExcelVO { | |
| 18 | - | |
| 19 | - @ExcelProperty("签到自增id") | |
| 20 | - private Long id; | |
| 21 | - | |
| 22 | - @ExcelProperty("签到用户") | |
| 23 | - private Integer userId; | |
| 24 | - | |
| 25 | - @ExcelProperty("第几天签到") | |
| 26 | - private Integer day; | |
| 27 | - | |
| 28 | - @ExcelProperty("签到的分数") | |
| 29 | - private Integer point; | |
| 30 | - | |
| 31 | - @ExcelProperty("签到时间") | |
| 32 | - private LocalDateTime createTime; | |
| 33 | - | |
| 34 | -} |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordExportReqVO.java deleted
| 1 | -package cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo; | |
| 2 | - | |
| 3 | -import lombok.*; | |
| 4 | -import java.util.*; | |
| 5 | -import io.swagger.v3.oas.annotations.media.Schema; | |
| 6 | -import cn.iocoder.yudao.framework.common.pojo.PageParam; | |
| 7 | -import java.time.LocalDateTime; | |
| 8 | -import org.springframework.format.annotation.DateTimeFormat; | |
| 9 | - | |
| 10 | -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | |
| 11 | - | |
| 12 | -@Schema(description = "管理后台 - 用户签到积分 Excel 导出 Request VO,参数和 SignInRecordPageReqVO 是一致的") | |
| 13 | -@Data | |
| 14 | -public class SignInRecordExportReqVO { | |
| 15 | - | |
| 16 | - @Schema(description = "签到用户", example = "6507") | |
| 17 | - private Integer userId; | |
| 18 | - | |
| 19 | - @Schema(description = "第几天签到") | |
| 20 | - private Integer day; | |
| 21 | - | |
| 22 | - @Schema(description = "签到时间") | |
| 23 | - @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) | |
| 24 | - private LocalDateTime[] createTime; | |
| 25 | - | |
| 26 | -} |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/convert/pointrecord/PointRecordConvert.java deleted
| 1 | -package cn.iocoder.yudao.module.point.convert.pointrecord; | |
| 2 | - | |
| 3 | -import java.util.*; | |
| 4 | - | |
| 5 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | - | |
| 7 | -import org.mapstruct.Mapper; | |
| 8 | -import org.mapstruct.factory.Mappers; | |
| 9 | -import cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo.*; | |
| 10 | -import cn.iocoder.yudao.module.point.dal.dataobject.pointrecord.PointRecordDO; | |
| 11 | - | |
| 12 | -/** | |
| 13 | - * 用户积分记录 Convert | |
| 14 | - * | |
| 15 | - * @author QingX | |
| 16 | - */ | |
| 17 | -@Mapper | |
| 18 | -public interface PointRecordConvert { | |
| 19 | - | |
| 20 | - PointRecordConvert INSTANCE = Mappers.getMapper(PointRecordConvert.class); | |
| 21 | - | |
| 22 | - PointRecordDO convert(PointRecordCreateReqVO bean); | |
| 23 | - | |
| 24 | - PointRecordDO convert(PointRecordUpdateReqVO bean); | |
| 25 | - | |
| 26 | - PointRecordRespVO convert(PointRecordDO bean); | |
| 27 | - | |
| 28 | - List<PointRecordRespVO> convertList(List<PointRecordDO> list); | |
| 29 | - | |
| 30 | - PageResult<PointRecordRespVO> convertPage(PageResult<PointRecordDO> page); | |
| 31 | - | |
| 32 | - List<PointRecordExcelVO> convertList02(List<PointRecordDO> list); | |
| 33 | - | |
| 34 | -} |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/convert/signinconfig/SignInConfigConvert.java deleted
| 1 | -package cn.iocoder.yudao.module.point.convert.signinconfig; | |
| 2 | - | |
| 3 | -import java.util.*; | |
| 4 | - | |
| 5 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | - | |
| 7 | -import org.mapstruct.Mapper; | |
| 8 | -import org.mapstruct.factory.Mappers; | |
| 9 | -import cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo.*; | |
| 10 | -import cn.iocoder.yudao.module.point.dal.dataobject.signinconfig.SignInConfigDO; | |
| 11 | - | |
| 12 | -/** | |
| 13 | - * 积分签到规则 Convert | |
| 14 | - * | |
| 15 | - * @author QingX | |
| 16 | - */ | |
| 17 | -@Mapper | |
| 18 | -public interface SignInConfigConvert { | |
| 19 | - | |
| 20 | - SignInConfigConvert INSTANCE = Mappers.getMapper(SignInConfigConvert.class); | |
| 21 | - | |
| 22 | - SignInConfigDO convert(SignInConfigCreateReqVO bean); | |
| 23 | - | |
| 24 | - SignInConfigDO convert(SignInConfigUpdateReqVO bean); | |
| 25 | - | |
| 26 | - SignInConfigRespVO convert(SignInConfigDO bean); | |
| 27 | - | |
| 28 | - List<SignInConfigRespVO> convertList(List<SignInConfigDO> list); | |
| 29 | - | |
| 30 | - PageResult<SignInConfigRespVO> convertPage(PageResult<SignInConfigDO> page); | |
| 31 | - | |
| 32 | - List<SignInConfigExcelVO> convertList02(List<SignInConfigDO> list); | |
| 33 | - | |
| 34 | -} |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/convert/signinrecord/SignInRecordConvert.java deleted
| 1 | -package cn.iocoder.yudao.module.point.convert.signinrecord; | |
| 2 | - | |
| 3 | -import java.util.*; | |
| 4 | - | |
| 5 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | - | |
| 7 | -import org.mapstruct.Mapper; | |
| 8 | -import org.mapstruct.factory.Mappers; | |
| 9 | -import cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo.*; | |
| 10 | -import cn.iocoder.yudao.module.point.dal.dataobject.signinrecord.SignInRecordDO; | |
| 11 | - | |
| 12 | -/** | |
| 13 | - * 用户签到积分 Convert | |
| 14 | - * | |
| 15 | - * @author 芋道源码 | |
| 16 | - */ | |
| 17 | -@Mapper | |
| 18 | -public interface SignInRecordConvert { | |
| 19 | - | |
| 20 | - SignInRecordConvert INSTANCE = Mappers.getMapper(SignInRecordConvert.class); | |
| 21 | - | |
| 22 | - SignInRecordDO convert(SignInRecordCreateReqVO bean); | |
| 23 | - | |
| 24 | - SignInRecordDO convert(SignInRecordUpdateReqVO bean); | |
| 25 | - | |
| 26 | - SignInRecordRespVO convert(SignInRecordDO bean); | |
| 27 | - | |
| 28 | - List<SignInRecordRespVO> convertList(List<SignInRecordDO> list); | |
| 29 | - | |
| 30 | - PageResult<SignInRecordRespVO> convertPage(PageResult<SignInRecordDO> page); | |
| 31 | - | |
| 32 | - List<SignInRecordExcelVO> convertList02(List<SignInRecordDO> list); | |
| 33 | - | |
| 34 | -} |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/mysql/pointrecord/PointRecordMapper.java deleted
| 1 | -package cn.iocoder.yudao.module.point.dal.mysql.pointrecord; | |
| 2 | - | |
| 3 | -import java.util.*; | |
| 4 | - | |
| 5 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | -import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 7 | -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 8 | -import cn.iocoder.yudao.module.point.dal.dataobject.pointrecord.PointRecordDO; | |
| 9 | -import org.apache.ibatis.annotations.Mapper; | |
| 10 | -import cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo.*; | |
| 11 | - | |
| 12 | -/** | |
| 13 | - * 用户积分记录 Mapper | |
| 14 | - * | |
| 15 | - * @author QingX | |
| 16 | - */ | |
| 17 | -@Mapper | |
| 18 | -public interface PointRecordMapper extends BaseMapperX<PointRecordDO> { | |
| 19 | - | |
| 20 | - default PageResult<PointRecordDO> selectPage(PointRecordPageReqVO reqVO) { | |
| 21 | - return selectPage(reqVO, new LambdaQueryWrapperX<PointRecordDO>() | |
| 22 | - .eqIfPresent(PointRecordDO::getBizId, reqVO.getBizId()) | |
| 23 | - .eqIfPresent(PointRecordDO::getBizType, reqVO.getBizType()) | |
| 24 | - .eqIfPresent(PointRecordDO::getType, reqVO.getType()) | |
| 25 | - .eqIfPresent(PointRecordDO::getTitle, reqVO.getTitle()) | |
| 26 | - .eqIfPresent(PointRecordDO::getStatus, reqVO.getStatus()) | |
| 27 | - .orderByDesc(PointRecordDO::getId)); | |
| 28 | - } | |
| 29 | - | |
| 30 | - default List<PointRecordDO> selectList(PointRecordExportReqVO reqVO) { | |
| 31 | - return selectList(new LambdaQueryWrapperX<PointRecordDO>() | |
| 32 | - .eqIfPresent(PointRecordDO::getBizId, reqVO.getBizId()) | |
| 33 | - .eqIfPresent(PointRecordDO::getBizType, reqVO.getBizType()) | |
| 34 | - .eqIfPresent(PointRecordDO::getType, reqVO.getType()) | |
| 35 | - .eqIfPresent(PointRecordDO::getTitle, reqVO.getTitle()) | |
| 36 | - .eqIfPresent(PointRecordDO::getStatus, reqVO.getStatus()) | |
| 37 | - .orderByDesc(PointRecordDO::getId)); | |
| 38 | - } | |
| 39 | - | |
| 40 | -} |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/mysql/signinconfig/SignInConfigMapper.java deleted
| 1 | -package cn.iocoder.yudao.module.point.dal.mysql.signinconfig; | |
| 2 | - | |
| 3 | -import java.util.*; | |
| 4 | - | |
| 5 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | -import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 7 | -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 8 | -import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; | |
| 9 | -import cn.iocoder.yudao.module.point.dal.dataobject.signinconfig.SignInConfigDO; | |
| 10 | -import org.apache.ibatis.annotations.Mapper; | |
| 11 | -import cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo.*; | |
| 12 | - | |
| 13 | -/** | |
| 14 | - * 积分签到规则 Mapper | |
| 15 | - * | |
| 16 | - * @author QingX | |
| 17 | - */ | |
| 18 | -@Mapper | |
| 19 | -public interface SignInConfigMapper extends BaseMapperX<SignInConfigDO> { | |
| 20 | - | |
| 21 | - default PageResult<SignInConfigDO> selectPage(SignInConfigPageReqVO reqVO) { | |
| 22 | - return selectPage(reqVO, new LambdaQueryWrapperX<SignInConfigDO>() | |
| 23 | - .eqIfPresent(SignInConfigDO::getDay, reqVO.getDay()) | |
| 24 | - .orderByAsc(SignInConfigDO::getDay)); | |
| 25 | - } | |
| 26 | - | |
| 27 | - default List<SignInConfigDO> selectList(SignInConfigExportReqVO reqVO) { | |
| 28 | - return selectList(new LambdaQueryWrapperX<SignInConfigDO>() | |
| 29 | - .eqIfPresent(SignInConfigDO::getDay, reqVO.getDay()) | |
| 30 | - .orderByDesc(SignInConfigDO::getId)); | |
| 31 | - } | |
| 32 | - | |
| 33 | - // | |
| 34 | - default long selectSameDayNotSelf(SignInConfigUpdateReqVO reqVO){ | |
| 35 | - return selectCount(new LambdaQueryWrapperX <SignInConfigDO>() | |
| 36 | - .ne(SignInConfigDO::getId, reqVO.getId()) | |
| 37 | - .eq(SignInConfigDO::getDay,reqVO.getDay()) | |
| 38 | - ); | |
| 39 | - } | |
| 40 | - | |
| 41 | -} |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/dal/mysql/signinrecord/SignInRecordMapper.java deleted
| 1 | -package cn.iocoder.yudao.module.point.dal.mysql.signinrecord; | |
| 2 | - | |
| 3 | -import java.util.*; | |
| 4 | - | |
| 5 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 6 | -import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; | |
| 7 | -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | |
| 8 | -import cn.iocoder.yudao.module.point.dal.dataobject.signinrecord.SignInRecordDO; | |
| 9 | -import org.apache.ibatis.annotations.Mapper; | |
| 10 | -import cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo.*; | |
| 11 | - | |
| 12 | -/** | |
| 13 | - * 用户签到积分 Mapper | |
| 14 | - * | |
| 15 | - * @author 芋道源码 | |
| 16 | - */ | |
| 17 | -@Mapper | |
| 18 | -public interface SignInRecordMapper extends BaseMapperX<SignInRecordDO> { | |
| 19 | - | |
| 20 | - default PageResult<SignInRecordDO> selectPage(SignInRecordPageReqVO reqVO) { | |
| 21 | - return selectPage(reqVO, new LambdaQueryWrapperX<SignInRecordDO>() | |
| 22 | - .eqIfPresent(SignInRecordDO::getUserId, reqVO.getUserId()) | |
| 23 | - .eqIfPresent(SignInRecordDO::getDay, reqVO.getDay()) | |
| 24 | - .betweenIfPresent(SignInRecordDO::getCreateTime, reqVO.getCreateTime()) | |
| 25 | - .orderByDesc(SignInRecordDO::getId)); | |
| 26 | - } | |
| 27 | - | |
| 28 | - default List<SignInRecordDO> selectList(SignInRecordExportReqVO reqVO) { | |
| 29 | - return selectList(new LambdaQueryWrapperX<SignInRecordDO>() | |
| 30 | - .eqIfPresent(SignInRecordDO::getUserId, reqVO.getUserId()) | |
| 31 | - .eqIfPresent(SignInRecordDO::getDay, reqVO.getDay()) | |
| 32 | - .betweenIfPresent(SignInRecordDO::getCreateTime, reqVO.getCreateTime()) | |
| 33 | - .orderByDesc(SignInRecordDO::getId)); | |
| 34 | - } | |
| 35 | - | |
| 36 | -} |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/pointrecord/PointRecordService.java deleted
| 1 | -package cn.iocoder.yudao.module.point.service.pointrecord; | |
| 2 | - | |
| 3 | -import java.util.*; | |
| 4 | -import javax.validation.*; | |
| 5 | -import cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo.*; | |
| 6 | -import cn.iocoder.yudao.module.point.dal.dataobject.pointrecord.PointRecordDO; | |
| 7 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 8 | - | |
| 9 | -/** | |
| 10 | - * 用户积分记录 Service 接口 | |
| 11 | - * | |
| 12 | - * @author QingX | |
| 13 | - */ | |
| 14 | -public interface PointRecordService { | |
| 15 | - | |
| 16 | - /** | |
| 17 | - * 创建用户积分记录 | |
| 18 | - * | |
| 19 | - * @param createReqVO 创建信息 | |
| 20 | - * @return 编号 | |
| 21 | - */ | |
| 22 | - Long createRecord(@Valid PointRecordCreateReqVO createReqVO); | |
| 23 | - | |
| 24 | - /** | |
| 25 | - * 更新用户积分记录 | |
| 26 | - * | |
| 27 | - * @param updateReqVO 更新信息 | |
| 28 | - */ | |
| 29 | - void updateRecord(@Valid PointRecordUpdateReqVO updateReqVO); | |
| 30 | - | |
| 31 | - /** | |
| 32 | - * 删除用户积分记录 | |
| 33 | - * | |
| 34 | - * @param id 编号 | |
| 35 | - */ | |
| 36 | - void deleteRecord(Long id); | |
| 37 | - | |
| 38 | - /** | |
| 39 | - * 获得用户积分记录 | |
| 40 | - * | |
| 41 | - * @param id 编号 | |
| 42 | - * @return 用户积分记录 | |
| 43 | - */ | |
| 44 | - PointRecordDO getRecord(Long id); | |
| 45 | - | |
| 46 | - /** | |
| 47 | - * 获得用户积分记录列表 | |
| 48 | - * | |
| 49 | - * @param ids 编号 | |
| 50 | - * @return 用户积分记录列表 | |
| 51 | - */ | |
| 52 | - List<PointRecordDO> getRecordList(Collection<Long> ids); | |
| 53 | - | |
| 54 | - /** | |
| 55 | - * 获得用户积分记录分页 | |
| 56 | - * | |
| 57 | - * @param pageReqVO 分页查询 | |
| 58 | - * @return 用户积分记录分页 | |
| 59 | - */ | |
| 60 | - PageResult<PointRecordDO> getRecordPage(PointRecordPageReqVO pageReqVO); | |
| 61 | - | |
| 62 | - /** | |
| 63 | - * 获得用户积分记录列表, 用于 Excel 导出 | |
| 64 | - * | |
| 65 | - * @param exportReqVO 查询条件 | |
| 66 | - * @return 用户积分记录列表 | |
| 67 | - */ | |
| 68 | - List<PointRecordDO> getRecordList(PointRecordExportReqVO exportReqVO); | |
| 69 | - | |
| 70 | -} |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/signinrecord/SignInRecordServiceImpl.java deleted
| 1 | -package cn.iocoder.yudao.module.point.service.signinrecord; | |
| 2 | - | |
| 3 | -import org.springframework.stereotype.Service; | |
| 4 | -import javax.annotation.Resource; | |
| 5 | -import org.springframework.validation.annotation.Validated; | |
| 6 | - | |
| 7 | -import java.util.*; | |
| 8 | -import cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo.*; | |
| 9 | -import cn.iocoder.yudao.module.point.dal.dataobject.signinrecord.SignInRecordDO; | |
| 10 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 11 | - | |
| 12 | -import cn.iocoder.yudao.module.point.convert.signinrecord.SignInRecordConvert; | |
| 13 | -import cn.iocoder.yudao.module.point.dal.mysql.signinrecord.SignInRecordMapper; | |
| 14 | - | |
| 15 | -import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | |
| 16 | -import static cn.iocoder.yudao.module.point.enums.ErrorCodeConstants.*; | |
| 17 | - | |
| 18 | -/** | |
| 19 | - * 用户签到积分 Service 实现类 | |
| 20 | - * | |
| 21 | - * @author 芋道源码 | |
| 22 | - */ | |
| 23 | -@Service | |
| 24 | -@Validated | |
| 25 | -public class SignInRecordServiceImpl implements SignInRecordService { | |
| 26 | - | |
| 27 | - @Resource | |
| 28 | - private SignInRecordMapper signInRecordMapper; | |
| 29 | - | |
| 30 | - @Override | |
| 31 | - public Long createSignInRecord(SignInRecordCreateReqVO createReqVO) { | |
| 32 | - // 插入 | |
| 33 | - SignInRecordDO signInRecord = SignInRecordConvert.INSTANCE.convert(createReqVO); | |
| 34 | - signInRecordMapper.insert(signInRecord); | |
| 35 | - // 返回 | |
| 36 | - return signInRecord.getId(); | |
| 37 | - } | |
| 38 | - | |
| 39 | - @Override | |
| 40 | - public void updateSignInRecord(SignInRecordUpdateReqVO updateReqVO) { | |
| 41 | - // 校验存在 | |
| 42 | - validateSignInRecordExists(updateReqVO.getId()); | |
| 43 | - // 更新 | |
| 44 | - SignInRecordDO updateObj = SignInRecordConvert.INSTANCE.convert(updateReqVO); | |
| 45 | - signInRecordMapper.updateById(updateObj); | |
| 46 | - } | |
| 47 | - | |
| 48 | - @Override | |
| 49 | - public void deleteSignInRecord(Long id) { | |
| 50 | - // 校验存在 | |
| 51 | - validateSignInRecordExists(id); | |
| 52 | - // 删除 | |
| 53 | - signInRecordMapper.deleteById(id); | |
| 54 | - } | |
| 55 | - | |
| 56 | - private void validateSignInRecordExists(Long id) { | |
| 57 | - if (signInRecordMapper.selectById(id) == null) { | |
| 58 | - throw exception(SIGN_IN_RECORD_NOT_EXISTS); | |
| 59 | - } | |
| 60 | - } | |
| 61 | - | |
| 62 | - @Override | |
| 63 | - public SignInRecordDO getSignInRecord(Long id) { | |
| 64 | - return signInRecordMapper.selectById(id); | |
| 65 | - } | |
| 66 | - | |
| 67 | - @Override | |
| 68 | - public List<SignInRecordDO> getSignInRecordList(Collection<Long> ids) { | |
| 69 | - return signInRecordMapper.selectBatchIds(ids); | |
| 70 | - } | |
| 71 | - | |
| 72 | - @Override | |
| 73 | - public PageResult<SignInRecordDO> getSignInRecordPage(SignInRecordPageReqVO pageReqVO) { | |
| 74 | - return signInRecordMapper.selectPage(pageReqVO); | |
| 75 | - } | |
| 76 | - | |
| 77 | - @Override | |
| 78 | - public List<SignInRecordDO> getSignInRecordList(SignInRecordExportReqVO exportReqVO) { | |
| 79 | - return signInRecordMapper.selectList(exportReqVO); | |
| 80 | - } | |
| 81 | - | |
| 82 | -} |
yudao-module-point/yudao-module-point-biz/src/test/java/cn/iocoder/yudao/module/point/service/pointconfig/PointConfigServiceImplTest.java deleted
| 1 | -package cn.iocoder.yudao.module.point.service.pointconfig; | |
| 2 | - | |
| 3 | -import cn.iocoder.yudao.framework.test.core.util.RandomUtils; | |
| 4 | -import org.junit.jupiter.api.Disabled; | |
| 5 | -import org.junit.jupiter.api.Test; | |
| 6 | -import org.springframework.boot.test.mock.mockito.MockBean; | |
| 7 | - | |
| 8 | -import javax.annotation.Resource; | |
| 9 | - | |
| 10 | -import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; | |
| 11 | - | |
| 12 | -import cn.iocoder.yudao.module.point.controller.admin.pointconfig.vo.*; | |
| 13 | -import cn.iocoder.yudao.module.point.dal.dataobject.pointconfig.PointConfigDO; | |
| 14 | -import cn.iocoder.yudao.module.point.dal.mysql.pointconfig.PointConfigMapper; | |
| 15 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 16 | - | |
| 17 | -import javax.annotation.Resource; | |
| 18 | -import org.springframework.context.annotation.Import; | |
| 19 | -import java.util.*; | |
| 20 | -import java.time.LocalDateTime; | |
| 21 | - | |
| 22 | -import static cn.hutool.core.util.RandomUtil.*; | |
| 23 | -import static cn.iocoder.yudao.module.point.enums.ErrorCodeConstants.*; | |
| 24 | -import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.*; | |
| 25 | -import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; | |
| 26 | -import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.*; | |
| 27 | -import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.*; | |
| 28 | -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.*; | |
| 29 | -import static org.junit.jupiter.api.Assertions.*; | |
| 30 | -import static org.mockito.Mockito.*; | |
| 31 | - | |
| 32 | -/** | |
| 33 | - * {@link PointConfigServiceImpl} 的单元测试类 | |
| 34 | - * | |
| 35 | - * @author QingX | |
| 36 | - */ | |
| 37 | -@Import(PointConfigServiceImpl.class) | |
| 38 | -public class PointConfigServiceImplTest extends BaseDbUnitTest { | |
| 39 | - | |
| 40 | - @Resource | |
| 41 | - private PointConfigServiceImpl configService; | |
| 42 | - | |
| 43 | - @Resource | |
| 44 | - private PointConfigMapper configMapper; | |
| 45 | - | |
| 46 | - @Test | |
| 47 | - public void testCreateConfig_success() { | |
| 48 | - // 准备参数 | |
| 49 | - PointConfigCreateReqVO reqVO = randomPojo(PointConfigCreateReqVO.class); | |
| 50 | - | |
| 51 | - // 调用 | |
| 52 | - Integer configId = configService.createConfig(reqVO); | |
| 53 | - // 断言 | |
| 54 | - assertNotNull(configId); | |
| 55 | - // 校验记录的属性是否正确 | |
| 56 | - PointConfigDO config = configMapper.selectById(configId); | |
| 57 | - assertPojoEquals(reqVO, config); | |
| 58 | - } | |
| 59 | - | |
| 60 | - @Test | |
| 61 | - public void testUpdateConfig_success() { | |
| 62 | - // mock 数据 | |
| 63 | - PointConfigDO dbConfig = randomPojo(PointConfigDO.class); | |
| 64 | - configMapper.insert(dbConfig);// @Sql: 先插入出一条存在的数据 | |
| 65 | - // 准备参数 | |
| 66 | - PointConfigUpdateReqVO reqVO = randomPojo(PointConfigUpdateReqVO.class, o -> { | |
| 67 | - o.setId(dbConfig.getId()); // 设置更新的 ID | |
| 68 | - }); | |
| 69 | - | |
| 70 | - // 调用 | |
| 71 | - configService.updateConfig(reqVO); | |
| 72 | - // 校验是否更新正确 | |
| 73 | - PointConfigDO config = configMapper.selectById(reqVO.getId()); // 获取最新的 | |
| 74 | - assertPojoEquals(reqVO, config); | |
| 75 | - } | |
| 76 | - | |
| 77 | - @Test | |
| 78 | - public void testUpdateConfig_notExists() { | |
| 79 | - // 准备参数 | |
| 80 | - PointConfigUpdateReqVO reqVO = randomPojo(PointConfigUpdateReqVO.class); | |
| 81 | - | |
| 82 | - // 调用, 并断言异常 | |
| 83 | - assertServiceException(() -> configService.updateConfig(reqVO), CONFIG_NOT_EXISTS); | |
| 84 | - } | |
| 85 | - | |
| 86 | - @Test | |
| 87 | - public void testDeleteConfig_success() { | |
| 88 | - // mock 数据 | |
| 89 | - PointConfigDO dbConfig = randomPojo(PointConfigDO.class); | |
| 90 | - configMapper.insert(dbConfig);// @Sql: 先插入出一条存在的数据 | |
| 91 | - // 准备参数 | |
| 92 | - Integer id = dbConfig.getId(); | |
| 93 | - | |
| 94 | - // 调用 | |
| 95 | - configService.deleteConfig(id); | |
| 96 | - // 校验数据不存在了 | |
| 97 | - assertNull(configMapper.selectById(id)); | |
| 98 | - } | |
| 99 | - | |
| 100 | - @Test | |
| 101 | - public void testDeleteConfig_notExists() { | |
| 102 | - // 准备参数 | |
| 103 | - Integer id = RandomUtils.randomInteger(); | |
| 104 | - | |
| 105 | - // 调用, 并断言异常 | |
| 106 | - assertServiceException(() -> configService.deleteConfig(id), CONFIG_NOT_EXISTS); | |
| 107 | - } | |
| 108 | - | |
| 109 | - @Test | |
| 110 | - @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 111 | - public void testGetConfigPage() { | |
| 112 | - // mock 数据 | |
| 113 | - PointConfigDO dbConfig = randomPojo(PointConfigDO.class, o -> { // 等会查询到 | |
| 114 | - o.setTradeDeductEnable(null); | |
| 115 | - }); | |
| 116 | - configMapper.insert(dbConfig); | |
| 117 | - // 测试 tradeDeductEnable 不匹配 | |
| 118 | - configMapper.insert(cloneIgnoreId(dbConfig, o -> o.setTradeDeductEnable(null))); | |
| 119 | - // 准备参数 | |
| 120 | - PointConfigPageReqVO reqVO = new PointConfigPageReqVO(); | |
| 121 | - reqVO.setTradeDeductEnable(null); | |
| 122 | - | |
| 123 | - // 调用 | |
| 124 | - PageResult<PointConfigDO> pageResult = configService.getConfigPage(reqVO); | |
| 125 | - // 断言 | |
| 126 | - assertEquals(1, pageResult.getTotal()); | |
| 127 | - assertEquals(1, pageResult.getList().size()); | |
| 128 | - assertPojoEquals(dbConfig, pageResult.getList().get(0)); | |
| 129 | - } | |
| 130 | - | |
| 131 | - @Test | |
| 132 | - @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 133 | - public void testGetConfigList() { | |
| 134 | - // mock 数据 | |
| 135 | - PointConfigDO dbConfig = randomPojo(PointConfigDO.class, o -> { // 等会查询到 | |
| 136 | - o.setTradeDeductEnable(null); | |
| 137 | - }); | |
| 138 | - configMapper.insert(dbConfig); | |
| 139 | - // 测试 tradeDeductEnable 不匹配 | |
| 140 | - configMapper.insert(cloneIgnoreId(dbConfig, o -> o.setTradeDeductEnable(null))); | |
| 141 | - // 准备参数 | |
| 142 | - PointConfigExportReqVO reqVO = new PointConfigExportReqVO(); | |
| 143 | - reqVO.setTradeDeductEnable(null); | |
| 144 | - | |
| 145 | - // 调用 | |
| 146 | - List<PointConfigDO> list = configService.getConfigList(reqVO); | |
| 147 | - // 断言 | |
| 148 | - assertEquals(1, list.size()); | |
| 149 | - assertPojoEquals(dbConfig, list.get(0)); | |
| 150 | - } | |
| 151 | - | |
| 152 | -} |
yudao-module-point/yudao-module-point-biz/src/test/java/cn/iocoder/yudao/module/point/service/pointrecord/PointRecordServiceImplTest.java deleted
| 1 | -package cn.iocoder.yudao.module.point.service.pointrecord; | |
| 2 | - | |
| 3 | -import org.junit.jupiter.api.Disabled; | |
| 4 | -import org.junit.jupiter.api.Test; | |
| 5 | -import org.springframework.boot.test.mock.mockito.MockBean; | |
| 6 | - | |
| 7 | -import javax.annotation.Resource; | |
| 8 | - | |
| 9 | -import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; | |
| 10 | - | |
| 11 | -import cn.iocoder.yudao.module.point.controller.admin.pointrecord.vo.*; | |
| 12 | -import cn.iocoder.yudao.module.point.dal.dataobject.pointrecord.PointRecordDO; | |
| 13 | -import cn.iocoder.yudao.module.point.dal.mysql.pointrecord.PointRecordMapper; | |
| 14 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 15 | - | |
| 16 | -import javax.annotation.Resource; | |
| 17 | -import org.springframework.context.annotation.Import; | |
| 18 | -import java.util.*; | |
| 19 | -import java.time.LocalDateTime; | |
| 20 | - | |
| 21 | -import static cn.hutool.core.util.RandomUtil.*; | |
| 22 | -import static cn.iocoder.yudao.module.point.enums.ErrorCodeConstants.*; | |
| 23 | -import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.*; | |
| 24 | -import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; | |
| 25 | -import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.*; | |
| 26 | -import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.*; | |
| 27 | -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.*; | |
| 28 | -import static org.junit.jupiter.api.Assertions.*; | |
| 29 | -import static org.mockito.Mockito.*; | |
| 30 | - | |
| 31 | -/** | |
| 32 | - * {@link PointRecordServiceImpl} 的单元测试类 | |
| 33 | - * | |
| 34 | - * @author QingX | |
| 35 | - */ | |
| 36 | -@Import(PointRecordServiceImpl.class) | |
| 37 | -public class PointRecordServiceImplTest extends BaseDbUnitTest { | |
| 38 | - | |
| 39 | - @Resource | |
| 40 | - private PointRecordServiceImpl recordService; | |
| 41 | - | |
| 42 | - @Resource | |
| 43 | - private PointRecordMapper recordMapper; | |
| 44 | - | |
| 45 | - @Test | |
| 46 | - public void testCreateRecord_success() { | |
| 47 | - // 准备参数 | |
| 48 | - PointRecordCreateReqVO reqVO = randomPojo(PointRecordCreateReqVO.class); | |
| 49 | - | |
| 50 | - // 调用 | |
| 51 | - Long recordId = recordService.createRecord(reqVO); | |
| 52 | - // 断言 | |
| 53 | - assertNotNull(recordId); | |
| 54 | - // 校验记录的属性是否正确 | |
| 55 | - PointRecordDO record = recordMapper.selectById(recordId); | |
| 56 | - assertPojoEquals(reqVO, record); | |
| 57 | - } | |
| 58 | - | |
| 59 | - @Test | |
| 60 | - public void testUpdateRecord_success() { | |
| 61 | - // mock 数据 | |
| 62 | - PointRecordDO dbRecord = randomPojo(PointRecordDO.class); | |
| 63 | - recordMapper.insert(dbRecord);// @Sql: 先插入出一条存在的数据 | |
| 64 | - // 准备参数 | |
| 65 | - PointRecordUpdateReqVO reqVO = randomPojo(PointRecordUpdateReqVO.class, o -> { | |
| 66 | - o.setId(dbRecord.getId()); // 设置更新的 ID | |
| 67 | - }); | |
| 68 | - | |
| 69 | - // 调用 | |
| 70 | - recordService.updateRecord(reqVO); | |
| 71 | - // 校验是否更新正确 | |
| 72 | - PointRecordDO record = recordMapper.selectById(reqVO.getId()); // 获取最新的 | |
| 73 | - assertPojoEquals(reqVO, record); | |
| 74 | - } | |
| 75 | - | |
| 76 | - @Test | |
| 77 | - public void testUpdateRecord_notExists() { | |
| 78 | - // 准备参数 | |
| 79 | - PointRecordUpdateReqVO reqVO = randomPojo(PointRecordUpdateReqVO.class); | |
| 80 | - | |
| 81 | - // 调用, 并断言异常 | |
| 82 | - assertServiceException(() -> recordService.updateRecord(reqVO), RECORD_NOT_EXISTS); | |
| 83 | - } | |
| 84 | - | |
| 85 | - @Test | |
| 86 | - public void testDeleteRecord_success() { | |
| 87 | - // mock 数据 | |
| 88 | - PointRecordDO dbRecord = randomPojo(PointRecordDO.class); | |
| 89 | - recordMapper.insert(dbRecord);// @Sql: 先插入出一条存在的数据 | |
| 90 | - // 准备参数 | |
| 91 | - Long id = dbRecord.getId(); | |
| 92 | - | |
| 93 | - // 调用 | |
| 94 | - recordService.deleteRecord(id); | |
| 95 | - // 校验数据不存在了 | |
| 96 | - assertNull(recordMapper.selectById(id)); | |
| 97 | - } | |
| 98 | - | |
| 99 | - @Test | |
| 100 | - public void testDeleteRecord_notExists() { | |
| 101 | - // 准备参数 | |
| 102 | - Long id = randomLongId(); | |
| 103 | - | |
| 104 | - // 调用, 并断言异常 | |
| 105 | - assertServiceException(() -> recordService.deleteRecord(id), RECORD_NOT_EXISTS); | |
| 106 | - } | |
| 107 | - | |
| 108 | - @Test | |
| 109 | - @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 110 | - public void testGetRecordPage() { | |
| 111 | - // mock 数据 | |
| 112 | - PointRecordDO dbRecord = randomPojo(PointRecordDO.class, o -> { // 等会查询到 | |
| 113 | - o.setBizId(null); | |
| 114 | - o.setBizType(null); | |
| 115 | - o.setType(null); | |
| 116 | - o.setTitle(null); | |
| 117 | - o.setStatus(null); | |
| 118 | - }); | |
| 119 | - recordMapper.insert(dbRecord); | |
| 120 | - // 测试 bizId 不匹配 | |
| 121 | - recordMapper.insert(cloneIgnoreId(dbRecord, o -> o.setBizId(null))); | |
| 122 | - // 测试 bizType 不匹配 | |
| 123 | - recordMapper.insert(cloneIgnoreId(dbRecord, o -> o.setBizType(null))); | |
| 124 | - // 测试 type 不匹配 | |
| 125 | - recordMapper.insert(cloneIgnoreId(dbRecord, o -> o.setType(null))); | |
| 126 | - // 测试 title 不匹配 | |
| 127 | - recordMapper.insert(cloneIgnoreId(dbRecord, o -> o.setTitle(null))); | |
| 128 | - // 测试 status 不匹配 | |
| 129 | - recordMapper.insert(cloneIgnoreId(dbRecord, o -> o.setStatus(null))); | |
| 130 | - // 准备参数 | |
| 131 | - PointRecordPageReqVO reqVO = new PointRecordPageReqVO(); | |
| 132 | - reqVO.setBizId(null); | |
| 133 | - reqVO.setBizType(null); | |
| 134 | - reqVO.setType(null); | |
| 135 | - reqVO.setTitle(null); | |
| 136 | - reqVO.setStatus(null); | |
| 137 | - | |
| 138 | - // 调用 | |
| 139 | - PageResult<PointRecordDO> pageResult = recordService.getRecordPage(reqVO); | |
| 140 | - // 断言 | |
| 141 | - assertEquals(1, pageResult.getTotal()); | |
| 142 | - assertEquals(1, pageResult.getList().size()); | |
| 143 | - assertPojoEquals(dbRecord, pageResult.getList().get(0)); | |
| 144 | - } | |
| 145 | - | |
| 146 | - @Test | |
| 147 | - @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 148 | - public void testGetRecordList() { | |
| 149 | - // mock 数据 | |
| 150 | - PointRecordDO dbRecord = randomPojo(PointRecordDO.class, o -> { // 等会查询到 | |
| 151 | - o.setBizId(null); | |
| 152 | - o.setBizType(null); | |
| 153 | - o.setType(null); | |
| 154 | - o.setTitle(null); | |
| 155 | - o.setStatus(null); | |
| 156 | - }); | |
| 157 | - recordMapper.insert(dbRecord); | |
| 158 | - // 测试 bizId 不匹配 | |
| 159 | - recordMapper.insert(cloneIgnoreId(dbRecord, o -> o.setBizId(null))); | |
| 160 | - // 测试 bizType 不匹配 | |
| 161 | - recordMapper.insert(cloneIgnoreId(dbRecord, o -> o.setBizType(null))); | |
| 162 | - // 测试 type 不匹配 | |
| 163 | - recordMapper.insert(cloneIgnoreId(dbRecord, o -> o.setType(null))); | |
| 164 | - // 测试 title 不匹配 | |
| 165 | - recordMapper.insert(cloneIgnoreId(dbRecord, o -> o.setTitle(null))); | |
| 166 | - // 测试 status 不匹配 | |
| 167 | - recordMapper.insert(cloneIgnoreId(dbRecord, o -> o.setStatus(null))); | |
| 168 | - // 准备参数 | |
| 169 | - PointRecordExportReqVO reqVO = new PointRecordExportReqVO(); | |
| 170 | - reqVO.setBizId(null); | |
| 171 | - reqVO.setBizType(null); | |
| 172 | - reqVO.setType(null); | |
| 173 | - reqVO.setTitle(null); | |
| 174 | - reqVO.setStatus(null); | |
| 175 | - | |
| 176 | - // 调用 | |
| 177 | - List<PointRecordDO> list = recordService.getRecordList(reqVO); | |
| 178 | - // 断言 | |
| 179 | - assertEquals(1, list.size()); | |
| 180 | - assertPojoEquals(dbRecord, list.get(0)); | |
| 181 | - } | |
| 182 | - | |
| 183 | -} |
yudao-module-point/yudao-module-point-biz/src/test/java/cn/iocoder/yudao/module/point/service/signinconfig/SignInConfigServiceImplTest.java deleted
| 1 | -package cn.iocoder.yudao.module.point.service.signinconfig; | |
| 2 | - | |
| 3 | -import cn.iocoder.yudao.framework.test.core.util.RandomUtils; | |
| 4 | -import org.junit.jupiter.api.Disabled; | |
| 5 | -import org.junit.jupiter.api.Test; | |
| 6 | -import org.springframework.boot.test.mock.mockito.MockBean; | |
| 7 | - | |
| 8 | -import javax.annotation.Resource; | |
| 9 | - | |
| 10 | -import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; | |
| 11 | - | |
| 12 | -import cn.iocoder.yudao.module.point.controller.admin.signinconfig.vo.*; | |
| 13 | -import cn.iocoder.yudao.module.point.dal.dataobject.signinconfig.SignInConfigDO; | |
| 14 | -import cn.iocoder.yudao.module.point.dal.mysql.signinconfig.SignInConfigMapper; | |
| 15 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 16 | - | |
| 17 | -import javax.annotation.Resource; | |
| 18 | -import org.springframework.context.annotation.Import; | |
| 19 | -import java.util.*; | |
| 20 | -import java.time.LocalDateTime; | |
| 21 | - | |
| 22 | -import static cn.hutool.core.util.RandomUtil.*; | |
| 23 | -import static cn.iocoder.yudao.module.point.enums.ErrorCodeConstants.*; | |
| 24 | -import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.*; | |
| 25 | -import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; | |
| 26 | -import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.*; | |
| 27 | -import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.*; | |
| 28 | -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.*; | |
| 29 | -import static org.junit.jupiter.api.Assertions.*; | |
| 30 | -import static org.mockito.Mockito.*; | |
| 31 | - | |
| 32 | -/** | |
| 33 | - * {@link SignInConfigServiceImpl} 的单元测试类 | |
| 34 | - * | |
| 35 | - * @author QingX | |
| 36 | - */ | |
| 37 | -@Import(SignInConfigServiceImpl.class) | |
| 38 | -public class SignInConfigServiceImplTest extends BaseDbUnitTest { | |
| 39 | - | |
| 40 | - @Resource | |
| 41 | - private SignInConfigServiceImpl signInConfigService; | |
| 42 | - | |
| 43 | - @Resource | |
| 44 | - private SignInConfigMapper signInConfigMapper; | |
| 45 | - | |
| 46 | - @Test | |
| 47 | - public void testCreateSignInConfig_success() { | |
| 48 | - // 准备参数 | |
| 49 | - SignInConfigCreateReqVO reqVO = randomPojo(SignInConfigCreateReqVO.class); | |
| 50 | - | |
| 51 | - // 调用 | |
| 52 | - Integer signInConfigId = signInConfigService.createSignInConfig(reqVO); | |
| 53 | - // 断言 | |
| 54 | - assertNotNull(signInConfigId); | |
| 55 | - // 校验记录的属性是否正确 | |
| 56 | - SignInConfigDO signInConfig = signInConfigMapper.selectById(signInConfigId); | |
| 57 | - assertPojoEquals(reqVO, signInConfig); | |
| 58 | - } | |
| 59 | - | |
| 60 | - @Test | |
| 61 | - public void testUpdateSignInConfig_success() { | |
| 62 | - // mock 数据 | |
| 63 | - SignInConfigDO dbSignInConfig = randomPojo(SignInConfigDO.class); | |
| 64 | - signInConfigMapper.insert(dbSignInConfig);// @Sql: 先插入出一条存在的数据 | |
| 65 | - // 准备参数 | |
| 66 | - SignInConfigUpdateReqVO reqVO = randomPojo(SignInConfigUpdateReqVO.class, o -> { | |
| 67 | - o.setId(dbSignInConfig.getId()); // 设置更新的 ID | |
| 68 | - }); | |
| 69 | - | |
| 70 | - // 调用 | |
| 71 | - signInConfigService.updateSignInConfig(reqVO); | |
| 72 | - // 校验是否更新正确 | |
| 73 | - SignInConfigDO signInConfig = signInConfigMapper.selectById(reqVO.getId()); // 获取最新的 | |
| 74 | - assertPojoEquals(reqVO, signInConfig); | |
| 75 | - } | |
| 76 | - | |
| 77 | - @Test | |
| 78 | - public void testUpdateSignInConfig_notExists() { | |
| 79 | - // 准备参数 | |
| 80 | - SignInConfigUpdateReqVO reqVO = randomPojo(SignInConfigUpdateReqVO.class); | |
| 81 | - | |
| 82 | - // 调用, 并断言异常 | |
| 83 | - assertServiceException(() -> signInConfigService.updateSignInConfig(reqVO), SIGN_IN_CONFIG_NOT_EXISTS); | |
| 84 | - } | |
| 85 | - | |
| 86 | - @Test | |
| 87 | - public void testDeleteSignInConfig_success() { | |
| 88 | - // mock 数据 | |
| 89 | - SignInConfigDO dbSignInConfig = randomPojo(SignInConfigDO.class); | |
| 90 | - signInConfigMapper.insert(dbSignInConfig);// @Sql: 先插入出一条存在的数据 | |
| 91 | - // 准备参数 | |
| 92 | - Integer id = dbSignInConfig.getId(); | |
| 93 | - | |
| 94 | - // 调用 | |
| 95 | - signInConfigService.deleteSignInConfig(id); | |
| 96 | - // 校验数据不存在了 | |
| 97 | - assertNull(signInConfigMapper.selectById(id)); | |
| 98 | - } | |
| 99 | - | |
| 100 | - @Test | |
| 101 | - public void testDeleteSignInConfig_notExists() { | |
| 102 | - // 准备参数 | |
| 103 | - Integer id = RandomUtils.randomInteger(); | |
| 104 | - | |
| 105 | - // 调用, 并断言异常 | |
| 106 | - assertServiceException(() -> signInConfigService.deleteSignInConfig(id), SIGN_IN_CONFIG_NOT_EXISTS); | |
| 107 | - } | |
| 108 | - | |
| 109 | - @Test | |
| 110 | - @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 111 | - public void testGetSignInConfigPage() { | |
| 112 | - // mock 数据 | |
| 113 | - SignInConfigDO dbSignInConfig = randomPojo(SignInConfigDO.class, o -> { // 等会查询到 | |
| 114 | - o.setDay(null); | |
| 115 | - }); | |
| 116 | - signInConfigMapper.insert(dbSignInConfig); | |
| 117 | - // 测试 day 不匹配 | |
| 118 | - signInConfigMapper.insert(cloneIgnoreId(dbSignInConfig, o -> o.setDay(null))); | |
| 119 | - // 准备参数 | |
| 120 | - SignInConfigPageReqVO reqVO = new SignInConfigPageReqVO(); | |
| 121 | - reqVO.setDay(null); | |
| 122 | - | |
| 123 | - // 调用 | |
| 124 | - PageResult<SignInConfigDO> pageResult = signInConfigService.getSignInConfigPage(reqVO); | |
| 125 | - // 断言 | |
| 126 | - assertEquals(1, pageResult.getTotal()); | |
| 127 | - assertEquals(1, pageResult.getList().size()); | |
| 128 | - assertPojoEquals(dbSignInConfig, pageResult.getList().get(0)); | |
| 129 | - } | |
| 130 | - | |
| 131 | - @Test | |
| 132 | - @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 133 | - public void testGetSignInConfigList() { | |
| 134 | - // mock 数据 | |
| 135 | - SignInConfigDO dbSignInConfig = randomPojo(SignInConfigDO.class, o -> { // 等会查询到 | |
| 136 | - o.setDay(null); | |
| 137 | - }); | |
| 138 | - signInConfigMapper.insert(dbSignInConfig); | |
| 139 | - // 测试 day 不匹配 | |
| 140 | - signInConfigMapper.insert(cloneIgnoreId(dbSignInConfig, o -> o.setDay(null))); | |
| 141 | - // 准备参数 | |
| 142 | - SignInConfigExportReqVO reqVO = new SignInConfigExportReqVO(); | |
| 143 | - reqVO.setDay(null); | |
| 144 | - | |
| 145 | - // 调用 | |
| 146 | - List<SignInConfigDO> list = signInConfigService.getSignInConfigList(reqVO); | |
| 147 | - // 断言 | |
| 148 | - assertEquals(1, list.size()); | |
| 149 | - assertPojoEquals(dbSignInConfig, list.get(0)); | |
| 150 | - } | |
| 151 | - | |
| 152 | -} |
yudao-module-point/yudao-module-point-biz/src/test/java/cn/iocoder/yudao/module/point/service/signinrecord/SignInRecordServiceImplTest.java deleted
| 1 | -package cn.iocoder.yudao.module.point.service.signinrecord; | |
| 2 | - | |
| 3 | -import org.junit.jupiter.api.Disabled; | |
| 4 | -import org.junit.jupiter.api.Test; | |
| 5 | -import org.springframework.boot.test.mock.mockito.MockBean; | |
| 6 | - | |
| 7 | -import javax.annotation.Resource; | |
| 8 | - | |
| 9 | -import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; | |
| 10 | - | |
| 11 | -import cn.iocoder.yudao.module.point.controller.admin.signinrecord.vo.*; | |
| 12 | -import cn.iocoder.yudao.module.point.dal.dataobject.signinrecord.SignInRecordDO; | |
| 13 | -import cn.iocoder.yudao.module.point.dal.mysql.signinrecord.SignInRecordMapper; | |
| 14 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | |
| 15 | - | |
| 16 | -import javax.annotation.Resource; | |
| 17 | -import org.springframework.context.annotation.Import; | |
| 18 | -import java.util.*; | |
| 19 | -import java.time.LocalDateTime; | |
| 20 | - | |
| 21 | -import static cn.hutool.core.util.RandomUtil.*; | |
| 22 | -import static cn.iocoder.yudao.module.point.enums.ErrorCodeConstants.*; | |
| 23 | -import static cn.iocoder.yudao.framework.test.core.util.AssertUtils.*; | |
| 24 | -import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*; | |
| 25 | -import static cn.iocoder.yudao.framework.common.util.date.LocalDateTimeUtils.*; | |
| 26 | -import static cn.iocoder.yudao.framework.common.util.object.ObjectUtils.*; | |
| 27 | -import static cn.iocoder.yudao.framework.common.util.date.DateUtils.*; | |
| 28 | -import static org.junit.jupiter.api.Assertions.*; | |
| 29 | -import static org.mockito.Mockito.*; | |
| 30 | - | |
| 31 | -/** | |
| 32 | - * {@link SignInRecordServiceImpl} 的单元测试类 | |
| 33 | - * | |
| 34 | - * @author 芋道源码 | |
| 35 | - */ | |
| 36 | -@Import(SignInRecordServiceImpl.class) | |
| 37 | -public class SignInRecordServiceImplTest extends BaseDbUnitTest { | |
| 38 | - | |
| 39 | - @Resource | |
| 40 | - private SignInRecordServiceImpl signInRecordService; | |
| 41 | - | |
| 42 | - @Resource | |
| 43 | - private SignInRecordMapper signInRecordMapper; | |
| 44 | - | |
| 45 | - @Test | |
| 46 | - public void testCreateSignInRecord_success() { | |
| 47 | - // 准备参数 | |
| 48 | - SignInRecordCreateReqVO reqVO = randomPojo(SignInRecordCreateReqVO.class); | |
| 49 | - | |
| 50 | - // 调用 | |
| 51 | - Long signInRecordId = signInRecordService.createSignInRecord(reqVO); | |
| 52 | - // 断言 | |
| 53 | - assertNotNull(signInRecordId); | |
| 54 | - // 校验记录的属性是否正确 | |
| 55 | - SignInRecordDO signInRecord = signInRecordMapper.selectById(signInRecordId); | |
| 56 | - assertPojoEquals(reqVO, signInRecord); | |
| 57 | - } | |
| 58 | - | |
| 59 | - @Test | |
| 60 | - public void testUpdateSignInRecord_success() { | |
| 61 | - // mock 数据 | |
| 62 | - SignInRecordDO dbSignInRecord = randomPojo(SignInRecordDO.class); | |
| 63 | - signInRecordMapper.insert(dbSignInRecord);// @Sql: 先插入出一条存在的数据 | |
| 64 | - // 准备参数 | |
| 65 | - SignInRecordUpdateReqVO reqVO = randomPojo(SignInRecordUpdateReqVO.class, o -> { | |
| 66 | - o.setId(dbSignInRecord.getId()); // 设置更新的 ID | |
| 67 | - }); | |
| 68 | - | |
| 69 | - // 调用 | |
| 70 | - signInRecordService.updateSignInRecord(reqVO); | |
| 71 | - // 校验是否更新正确 | |
| 72 | - SignInRecordDO signInRecord = signInRecordMapper.selectById(reqVO.getId()); // 获取最新的 | |
| 73 | - assertPojoEquals(reqVO, signInRecord); | |
| 74 | - } | |
| 75 | - | |
| 76 | - @Test | |
| 77 | - public void testUpdateSignInRecord_notExists() { | |
| 78 | - // 准备参数 | |
| 79 | - SignInRecordUpdateReqVO reqVO = randomPojo(SignInRecordUpdateReqVO.class); | |
| 80 | - | |
| 81 | - // 调用, 并断言异常 | |
| 82 | - assertServiceException(() -> signInRecordService.updateSignInRecord(reqVO), SIGN_IN_RECORD_NOT_EXISTS); | |
| 83 | - } | |
| 84 | - | |
| 85 | - @Test | |
| 86 | - public void testDeleteSignInRecord_success() { | |
| 87 | - // mock 数据 | |
| 88 | - SignInRecordDO dbSignInRecord = randomPojo(SignInRecordDO.class); | |
| 89 | - signInRecordMapper.insert(dbSignInRecord);// @Sql: 先插入出一条存在的数据 | |
| 90 | - // 准备参数 | |
| 91 | - Long id = dbSignInRecord.getId(); | |
| 92 | - | |
| 93 | - // 调用 | |
| 94 | - signInRecordService.deleteSignInRecord(id); | |
| 95 | - // 校验数据不存在了 | |
| 96 | - assertNull(signInRecordMapper.selectById(id)); | |
| 97 | - } | |
| 98 | - | |
| 99 | - @Test | |
| 100 | - public void testDeleteSignInRecord_notExists() { | |
| 101 | - // 准备参数 | |
| 102 | - Long id = randomLongId(); | |
| 103 | - | |
| 104 | - // 调用, 并断言异常 | |
| 105 | - assertServiceException(() -> signInRecordService.deleteSignInRecord(id), SIGN_IN_RECORD_NOT_EXISTS); | |
| 106 | - } | |
| 107 | - | |
| 108 | - @Test | |
| 109 | - @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 110 | - public void testGetSignInRecordPage() { | |
| 111 | - // mock 数据 | |
| 112 | - SignInRecordDO dbSignInRecord = randomPojo(SignInRecordDO.class, o -> { // 等会查询到 | |
| 113 | - o.setUserId(null); | |
| 114 | - o.setDay(null); | |
| 115 | - o.setCreateTime(null); | |
| 116 | - }); | |
| 117 | - signInRecordMapper.insert(dbSignInRecord); | |
| 118 | - // 测试 userId 不匹配 | |
| 119 | - signInRecordMapper.insert(cloneIgnoreId(dbSignInRecord, o -> o.setUserId(null))); | |
| 120 | - // 测试 day 不匹配 | |
| 121 | - signInRecordMapper.insert(cloneIgnoreId(dbSignInRecord, o -> o.setDay(null))); | |
| 122 | - // 测试 createTime 不匹配 | |
| 123 | - signInRecordMapper.insert(cloneIgnoreId(dbSignInRecord, o -> o.setCreateTime(null))); | |
| 124 | - // 准备参数 | |
| 125 | - SignInRecordPageReqVO reqVO = new SignInRecordPageReqVO(); | |
| 126 | - reqVO.setUserId(null); | |
| 127 | - reqVO.setDay(null); | |
| 128 | - reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 129 | - | |
| 130 | - // 调用 | |
| 131 | - PageResult<SignInRecordDO> pageResult = signInRecordService.getSignInRecordPage(reqVO); | |
| 132 | - // 断言 | |
| 133 | - assertEquals(1, pageResult.getTotal()); | |
| 134 | - assertEquals(1, pageResult.getList().size()); | |
| 135 | - assertPojoEquals(dbSignInRecord, pageResult.getList().get(0)); | |
| 136 | - } | |
| 137 | - | |
| 138 | - @Test | |
| 139 | - @Disabled // TODO 请修改 null 为需要的值,然后删除 @Disabled 注解 | |
| 140 | - public void testGetSignInRecordList() { | |
| 141 | - // mock 数据 | |
| 142 | - SignInRecordDO dbSignInRecord = randomPojo(SignInRecordDO.class, o -> { // 等会查询到 | |
| 143 | - o.setUserId(null); | |
| 144 | - o.setDay(null); | |
| 145 | - o.setCreateTime(null); | |
| 146 | - }); | |
| 147 | - signInRecordMapper.insert(dbSignInRecord); | |
| 148 | - // 测试 userId 不匹配 | |
| 149 | - signInRecordMapper.insert(cloneIgnoreId(dbSignInRecord, o -> o.setUserId(null))); | |
| 150 | - // 测试 day 不匹配 | |
| 151 | - signInRecordMapper.insert(cloneIgnoreId(dbSignInRecord, o -> o.setDay(null))); | |
| 152 | - // 测试 createTime 不匹配 | |
| 153 | - signInRecordMapper.insert(cloneIgnoreId(dbSignInRecord, o -> o.setCreateTime(null))); | |
| 154 | - // 准备参数 | |
| 155 | - SignInRecordExportReqVO reqVO = new SignInRecordExportReqVO(); | |
| 156 | - reqVO.setUserId(null); | |
| 157 | - reqVO.setDay(null); | |
| 158 | - reqVO.setCreateTime(buildBetweenTime(2023, 2, 1, 2023, 2, 28)); | |
| 159 | - | |
| 160 | - // 调用 | |
| 161 | - List<SignInRecordDO> list = signInRecordService.getSignInRecordList(reqVO); | |
| 162 | - // 断言 | |
| 163 | - assertEquals(1, list.size()); | |
| 164 | - assertPojoEquals(dbSignInRecord, list.get(0)); | |
| 165 | - } | |
| 166 | - | |
| 167 | -} |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailTemplateController.java
| ... | ... | @@ -18,6 +18,7 @@ import javax.validation.Valid; |
| 18 | 18 | import java.util.List; |
| 19 | 19 | |
| 20 | 20 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 21 | +import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; | |
| 21 | 22 | |
| 22 | 23 | @Tag(name = "管理后台 - 邮件模版") |
| 23 | 24 | @RestController |
| ... | ... | @@ -81,7 +82,7 @@ public class MailTemplateController { |
| 81 | 82 | @Operation(summary = "发送短信") |
| 82 | 83 | @PreAuthorize("@ss.hasPermission('system:mail-template:send-mail')") |
| 83 | 84 | public CommonResult<Long> sendMail(@Valid @RequestBody MailTemplateSendReqVO sendReqVO) { |
| 84 | - return success(mailSendService.sendSingleMailToAdmin(sendReqVO.getMail(), null, | |
| 85 | + return success(mailSendService.sendSingleMailToAdmin(sendReqVO.getMail(), getLoginUserId(), | |
| 85 | 86 | sendReqVO.getTemplateCode(), sendReqVO.getTemplateParams())); |
| 86 | 87 | } |
| 87 | 88 | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/dal/redis/oauth2/OAuth2AccessTokenRedisDAO.java
| ... | ... | @@ -37,7 +37,9 @@ public class OAuth2AccessTokenRedisDAO { |
| 37 | 37 | // 清理多余字段,避免缓存 |
| 38 | 38 | accessTokenDO.setUpdater(null).setUpdateTime(null).setCreateTime(null).setCreator(null).setDeleted(null); |
| 39 | 39 | long time = LocalDateTimeUtil.between(LocalDateTime.now(), accessTokenDO.getExpiresTime(), ChronoUnit.SECONDS); |
| 40 | - stringRedisTemplate.opsForValue().set(redisKey, JsonUtils.toJsonString(accessTokenDO), time, TimeUnit.SECONDS); | |
| 40 | + if (time > 0) { | |
| 41 | + stringRedisTemplate.opsForValue().set(redisKey, JsonUtils.toJsonString(accessTokenDO), time, TimeUnit.SECONDS); | |
| 42 | + } | |
| 41 | 43 | } |
| 42 | 44 | |
| 43 | 45 | public void delete(String accessToken) { | ... | ... |
yudao-server/pom.xml
| ... | ... | @@ -111,7 +111,7 @@ |
| 111 | 111 | <plugin> |
| 112 | 112 | <groupId>org.springframework.boot</groupId> |
| 113 | 113 | <artifactId>spring-boot-maven-plugin</artifactId> |
| 114 | - <version>2.7.11</version> <!-- 如果 spring.boot.version 版本修改,则这里也要跟着修改 --> | |
| 114 | + <version>2.7.12</version> <!-- 如果 spring.boot.version 版本修改,则这里也要跟着修改 --> | |
| 115 | 115 | <configuration> |
| 116 | 116 | <fork>true</fork> |
| 117 | 117 | </configuration> | ... | ... |
yudao-server/src/main/resources/application-dev.yaml
| ... | ... | @@ -168,7 +168,6 @@ yudao: |
| 168 | 168 | - ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求 |
| 169 | 169 | pay: |
| 170 | 170 | callback-url: http://yunai.natapp1.cc/admin-api/pay/notify/callback |
| 171 | - return-url: http://yunai.natapp1.cc/admin-api/pay/notify/return | |
| 172 | 171 | demo: true # 开启演示模式 |
| 173 | 172 | |
| 174 | 173 | justauth: | ... | ... |
yudao-server/src/main/resources/application-local.yaml
| ... | ... | @@ -195,7 +195,6 @@ yudao: |
| 195 | 195 | - ${management.endpoints.web.base-path}/** # 不处理 Actuator 的请求 |
| 196 | 196 | pay: |
| 197 | 197 | callback-url: http://yunai.natapp1.cc/admin-api/pay/notify/callback |
| 198 | - return-url: http://yunai.natapp1.cc/admin-api/pay/notify/return | |
| 199 | 198 | access-log: # 访问日志的配置项 |
| 200 | 199 | enable: false |
| 201 | 200 | error-code: # 错误码相关配置项 | ... | ... |