Commit c7ced55a6cda1e780f6d32bf31954c914ece30f2
1 parent
e5c556f1
会员中心代码、sql脚本提交
1.合并积分模块只member module 2.初始化sql放入mysql/member_point.sql 3.添加会员中/会员积分、会员签到/xxx层级目录 4.删除无用的接口代码
Showing
61 changed files
with
675 additions
and
1503 deletions
sql/mysql/point.sql renamed to sql/mysql/optional/member_point.sql
| @@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
| 11 | Target Server Version : 80030 | 11 | Target Server Version : 80030 |
| 12 | File Encoding : 65001 | 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 | SET NAMES utf8mb4; | 17 | SET NAMES utf8mb4; |
| @@ -22,27 +22,27 @@ SET FOREIGN_KEY_CHECKS = 0; | @@ -22,27 +22,27 @@ SET FOREIGN_KEY_CHECKS = 0; | ||
| 22 | -- ---------------------------- | 22 | -- ---------------------------- |
| 23 | DROP TABLE IF EXISTS `member_point_config`; | 23 | DROP TABLE IF EXISTS `member_point_config`; |
| 24 | CREATE TABLE `member_point_config` ( | 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 | -- Records of member_point_config | 40 | -- Records of member_point_config |
| 41 | -- ---------------------------- | 41 | -- ---------------------------- |
| 42 | BEGIN; | 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 | COMMIT; | 46 | COMMIT; |
| 47 | 47 | ||
| 48 | -- ---------------------------- | 48 | -- ---------------------------- |
| @@ -50,27 +50,27 @@ COMMIT; | @@ -50,27 +50,27 @@ COMMIT; | ||
| 50 | -- ---------------------------- | 50 | -- ---------------------------- |
| 51 | DROP TABLE IF EXISTS `member_point_record`; | 51 | DROP TABLE IF EXISTS `member_point_record`; |
| 52 | CREATE TABLE `member_point_record` ( | 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 | ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户积分记录'; | 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,16 +87,16 @@ COMMIT; | ||
| 87 | -- ---------------------------- | 87 | -- ---------------------------- |
| 88 | DROP TABLE IF EXISTS `member_sign_in_config`; | 88 | DROP TABLE IF EXISTS `member_sign_in_config`; |
| 89 | CREATE TABLE `member_sign_in_config` ( | 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 | ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='积分签到规则'; | 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,17 +115,17 @@ COMMIT; | ||
| 115 | -- ---------------------------- | 115 | -- ---------------------------- |
| 116 | DROP TABLE IF EXISTS `member_sign_in_record`; | 116 | DROP TABLE IF EXISTS `member_sign_in_record`; |
| 117 | CREATE TABLE `member_sign_in_record` ( | 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 | ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户签到积分'; | 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,15 +138,37 @@ INSERT INTO `member_sign_in_record` (`id`, `user_id`, `day`, `point`, `create_ti | ||
| 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'); | 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 | COMMIT; | 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; |
yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/enums/ErrorCodeConstants.java
| @@ -23,4 +23,17 @@ public interface ErrorCodeConstants { | @@ -23,4 +23,17 @@ public interface ErrorCodeConstants { | ||
| 23 | // ========== 用户收件地址 1004004000 ========== | 23 | // ========== 用户收件地址 1004004000 ========== |
| 24 | ErrorCode ADDRESS_NOT_EXISTS = new ErrorCode(1004004000, "用户收件地址不存在"); | 24 | ErrorCode ADDRESS_NOT_EXISTS = new ErrorCode(1004004000, "用户收件地址不存在"); |
| 25 | 25 | ||
| 26 | + //========== 用户积分 1004005000 ========== | ||
| 27 | + ErrorCode CONFIG_NOT_EXISTS = new ErrorCode(1004005001, "积分设置不存在"); | ||
| 28 | + | ||
| 29 | + ErrorCode CONFIG_EXISTS = new ErrorCode(1004005002, "积分设置已存在,只允配置一条记录"); | ||
| 30 | + | ||
| 31 | + | ||
| 32 | + ErrorCode SIGN_IN_CONFIG_NOT_EXISTS = new ErrorCode(1004005003, "签到天数规则不存在"); | ||
| 33 | + ErrorCode SIGN_IN_CONFIG_EXISTS = new ErrorCode(1004005004, "签到天数规则已存在"); | ||
| 34 | + | ||
| 35 | + ErrorCode RECORD_NOT_EXISTS = new ErrorCode( 1004005005, "用户积分记录不存在"); | ||
| 36 | + | ||
| 37 | + ErrorCode SIGN_IN_RECORD_NOT_EXISTS = new ErrorCode(1004005006, "用户签到积分不存在"); | ||
| 38 | + | ||
| 26 | } | 39 | } |
yudao-module-member/yudao-module-member-biz/pom.xml
| @@ -84,6 +84,11 @@ | @@ -84,6 +84,11 @@ | ||
| 84 | </dependency> | 84 | </dependency> |
| 85 | 85 | ||
| 86 | <!-- 工具类相关 --> | 86 | <!-- 工具类相关 --> |
| 87 | + <dependency> | ||
| 88 | + <groupId>cn.iocoder.boot</groupId> | ||
| 89 | + <artifactId>yudao-spring-boot-starter-excel</artifactId> | ||
| 90 | + </dependency> | ||
| 91 | + | ||
| 87 | </dependencies> | 92 | </dependencies> |
| 88 | 93 | ||
| 89 | </project> | 94 | </project> |
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,9 +26,9 @@ public class MemberPointConfigController { | ||
| 26 | @Resource | 26 | @Resource |
| 27 | private MemberPointConfigService memberPointConfigService; | 27 | private MemberPointConfigService memberPointConfigService; |
| 28 | 28 | ||
| 29 | - @PutMapping("/update") | 29 | + @PutMapping("/save") |
| 30 | @Operation(summary = "保存会员积分配置") | 30 | @Operation(summary = "保存会员积分配置") |
| 31 | - @PreAuthorize("@ss.hasPermission('member:point-config:save')") | 31 | + @PreAuthorize("@ss.hasPermission('point:config:save')") |
| 32 | public CommonResult<Boolean> updateConfig(@Valid @RequestBody MemberPointConfigSaveReqVO saveReqVO) { | 32 | public CommonResult<Boolean> updateConfig(@Valid @RequestBody MemberPointConfigSaveReqVO saveReqVO) { |
| 33 | memberPointConfigService.saveConfig(saveReqVO); | 33 | memberPointConfigService.saveConfig(saveReqVO); |
| 34 | return success(true); | 34 | return success(true); |
| @@ -36,7 +36,7 @@ public class MemberPointConfigController { | @@ -36,7 +36,7 @@ public class MemberPointConfigController { | ||
| 36 | 36 | ||
| 37 | @GetMapping("/get") | 37 | @GetMapping("/get") |
| 38 | @Operation(summary = "获得会员积分配置") | 38 | @Operation(summary = "获得会员积分配置") |
| 39 | - @PreAuthorize("@ss.hasPermission('member:point-config:query')") | 39 | + @PreAuthorize("@ss.hasPermission('point:config:query')") |
| 40 | public CommonResult<MemberPointConfigRespVO> getConfig() { | 40 | public CommonResult<MemberPointConfigRespVO> getConfig() { |
| 41 | MemberPointConfigDO config = memberPointConfigService.getConfig(); | 41 | MemberPointConfigDO config = memberPointConfigService.getConfig(); |
| 42 | return success(MemberPointConfigConvert.INSTANCE.convert(config)); | 42 | return success(MemberPointConfigConvert.INSTANCE.convert(config)); |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/pointrecord/PointRecordController.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/MemberPointRecordController.java
| 1 | -package cn.iocoder.yudao.module.point.controller.admin.pointrecord; | 1 | +package cn.iocoder.yudao.module.member.controller.admin.point; |
| 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.framework.excel.core.util.ExcelUtils; | ||
| 6 | +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | ||
| 7 | +import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.*; | ||
| 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; | ||
| 9 | import io.swagger.v3.oas.annotations.Operation; | 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.*; | ||
| 10 | 17 | ||
| 11 | -import javax.validation.constraints.*; | ||
| 12 | -import javax.validation.*; | ||
| 13 | -import javax.servlet.http.*; | ||
| 14 | -import java.util.*; | 18 | +import javax.annotation.Resource; |
| 19 | +import javax.servlet.http.HttpServletResponse; | ||
| 20 | +import javax.validation.Valid; | ||
| 15 | import java.io.IOException; | 21 | import java.io.IOException; |
| 22 | +import java.util.Collection; | ||
| 23 | +import java.util.List; | ||
| 16 | 24 | ||
| 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; | 25 | 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; | 26 | +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; |
| 30 | 27 | ||
| 31 | @Tag(name = "管理后台 - 用户积分记录") | 28 | @Tag(name = "管理后台 - 用户积分记录") |
| 32 | @RestController | 29 | @RestController |
| 33 | @RequestMapping("/point/record") | 30 | @RequestMapping("/point/record") |
| 34 | @Validated | 31 | @Validated |
| 35 | -public class PointRecordController { | 32 | +public class MemberPointRecordController { |
| 36 | 33 | ||
| 37 | @Resource | 34 | @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 | - } | 35 | + private MemberPointRecordService recordService; |
| 46 | 36 | ||
| 47 | @PutMapping("/update") | 37 | @PutMapping("/update") |
| 48 | @Operation(summary = "更新用户积分记录") | 38 | @Operation(summary = "更新用户积分记录") |
| 49 | @PreAuthorize("@ss.hasPermission('point:record:update')") | 39 | @PreAuthorize("@ss.hasPermission('point:record:update')") |
| 50 | - public CommonResult<Boolean> updateRecord(@Valid @RequestBody PointRecordUpdateReqVO updateReqVO) { | 40 | + public CommonResult<Boolean> updateRecord(@Valid @RequestBody MemberPointRecordUpdateReqVO updateReqVO) { |
| 51 | recordService.updateRecord(updateReqVO); | 41 | recordService.updateRecord(updateReqVO); |
| 52 | return success(true); | 42 | return success(true); |
| 53 | } | 43 | } |
| 54 | 44 | ||
| 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") | 45 | @GetMapping("/get") |
| 65 | @Operation(summary = "获得用户积分记录") | 46 | @Operation(summary = "获得用户积分记录") |
| 66 | @Parameter(name = "id", description = "编号", required = true, example = "1024") | 47 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 67 | @PreAuthorize("@ss.hasPermission('point:record:query')") | 48 | @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)); | 49 | + public CommonResult<MemberPointRecordRespVO> getRecord(@RequestParam("id") Long id) { |
| 50 | + MemberPointRecordDO record = recordService.getRecord(id); | ||
| 51 | + return success(MemberPointRecordConvert.INSTANCE.convert(record)); | ||
| 71 | } | 52 | } |
| 72 | 53 | ||
| 73 | @GetMapping("/list") | 54 | @GetMapping("/list") |
| 74 | @Operation(summary = "获得用户积分记录列表") | 55 | @Operation(summary = "获得用户积分记录列表") |
| 75 | @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") | 56 | @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
| 76 | @PreAuthorize("@ss.hasPermission('point:record:query')") | 57 | @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)); | 58 | + public CommonResult<List<MemberPointRecordRespVO>> getRecordList(@RequestParam("ids") Collection<Long> ids) { |
| 59 | + List<MemberPointRecordDO> list = recordService.getRecordList(ids); | ||
| 60 | + return success(MemberPointRecordConvert.INSTANCE.convertList(list)); | ||
| 80 | } | 61 | } |
| 81 | 62 | ||
| 82 | @GetMapping("/page") | 63 | @GetMapping("/page") |
| 83 | @Operation(summary = "获得用户积分记录分页") | 64 | @Operation(summary = "获得用户积分记录分页") |
| 84 | @PreAuthorize("@ss.hasPermission('point:record:query')") | 65 | @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)); | 66 | + public CommonResult<PageResult<MemberPointRecordRespVO>> getRecordPage(@Valid MemberPointRecordPageReqVO pageVO) { |
| 67 | + PageResult<MemberPointRecordDO> pageResult = recordService.getRecordPage(pageVO); | ||
| 68 | + return success(MemberPointRecordConvert.INSTANCE.convertPage(pageResult)); | ||
| 88 | } | 69 | } |
| 89 | 70 | ||
| 90 | @GetMapping("/export-excel") | 71 | @GetMapping("/export-excel") |
| 91 | @Operation(summary = "导出用户积分记录 Excel") | 72 | @Operation(summary = "导出用户积分记录 Excel") |
| 92 | @PreAuthorize("@ss.hasPermission('point:record:export')") | 73 | @PreAuthorize("@ss.hasPermission('point:record:export')") |
| 93 | @OperateLog(type = EXPORT) | 74 | @OperateLog(type = EXPORT) |
| 94 | - public void exportRecordExcel(@Valid PointRecordExportReqVO exportReqVO, | 75 | + public void exportRecordExcel(@Valid MemberPointRecordExportReqVO exportReqVO, |
| 95 | HttpServletResponse response) throws IOException { | 76 | HttpServletResponse response) throws IOException { |
| 96 | - List<PointRecordDO> list = recordService.getRecordList(exportReqVO); | 77 | + List<MemberPointRecordDO> list = recordService.getRecordList(exportReqVO); |
| 97 | // 导出 Excel | 78 | // 导出 Excel |
| 98 | - List<PointRecordExcelVO> datas = PointRecordConvert.INSTANCE.convertList02(list); | ||
| 99 | - ExcelUtils.write(response, "用户积分记录.xls", "数据", PointRecordExcelVO.class, datas); | 79 | + List<MemberPointRecordExcelVO> datas = MemberPointRecordConvert.INSTANCE.convertList02(list); |
| 80 | + ExcelUtils.write(response, "用户积分记录.xls", "数据", MemberPointRecordExcelVO.class, datas); | ||
| 100 | } | 81 | } |
| 101 | 82 | ||
| 102 | } | 83 | } |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/config/MemberPointConfigBaseVO.java
| @@ -12,6 +12,8 @@ import java.math.BigDecimal; | @@ -12,6 +12,8 @@ import java.math.BigDecimal; | ||
| 12 | @Data | 12 | @Data |
| 13 | public class MemberPointConfigBaseVO { | 13 | public class MemberPointConfigBaseVO { |
| 14 | 14 | ||
| 15 | + private Long id; | ||
| 16 | + | ||
| 15 | @Schema(description = "积分抵扣开关", required = true, example = "true") | 17 | @Schema(description = "积分抵扣开关", required = true, example = "true") |
| 16 | private Boolean tradeDeductEnable; | 18 | private Boolean tradeDeductEnable; |
| 17 | 19 |
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 | import io.swagger.v3.oas.annotations.media.Schema; | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | import lombok.*; | 4 | import lombok.*; |
| 5 | -import java.util.*; | ||
| 6 | -import java.time.LocalDateTime; | ||
| 7 | -import java.time.LocalDateTime; | ||
| 8 | -import java.time.LocalDateTime; | 5 | + |
| 9 | import java.time.LocalDateTime; | 6 | import java.time.LocalDateTime; |
| 10 | import javax.validation.constraints.*; | 7 | import javax.validation.constraints.*; |
| 11 | import org.springframework.format.annotation.DateTimeFormat; | 8 | import org.springframework.format.annotation.DateTimeFormat; |
| @@ -17,7 +14,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ | @@ -17,7 +14,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ | ||
| 17 | * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | 14 | * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
| 18 | */ | 15 | */ |
| 19 | @Data | 16 | @Data |
| 20 | -public class PointRecordBaseVO { | 17 | +public class MemberPointRecordBaseVO { |
| 21 | 18 | ||
| 22 | @Schema(description = "业务编码", example = "22706") | 19 | @Schema(description = "业务编码", example = "22706") |
| 23 | @NotNull(message = "业务编码不能为空") | 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 | import lombok.*; | 3 | import lombok.*; |
| 4 | -import java.util.*; | ||
| 5 | import io.swagger.v3.oas.annotations.media.Schema; | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | -import javax.validation.constraints.*; | ||
| 7 | 5 | ||
| 8 | @Schema(description = "管理后台 - 用户积分记录创建 Request VO") | 6 | @Schema(description = "管理后台 - 用户积分记录创建 Request VO") |
| 9 | @Data | 7 | @Data |
| 10 | @EqualsAndHashCode(callSuper = true) | 8 | @EqualsAndHashCode(callSuper = true) |
| 11 | @ToString(callSuper = true) | 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/PointRecordExcelVO.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/point/vo/recrod/MemberPointRecordExcelVO.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 | -import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | import lombok.*; | 3 | import lombok.*; |
| 5 | -import java.util.*; | ||
| 6 | -import java.time.LocalDateTime; | ||
| 7 | -import java.time.LocalDateTime; | ||
| 8 | -import java.time.LocalDateTime; | 4 | + |
| 9 | import java.time.LocalDateTime; | 5 | import java.time.LocalDateTime; |
| 10 | 6 | ||
| 11 | import com.alibaba.excel.annotation.ExcelProperty; | 7 | import com.alibaba.excel.annotation.ExcelProperty; |
| @@ -19,7 +15,7 @@ import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | @@ -19,7 +15,7 @@ import cn.iocoder.yudao.framework.excel.core.convert.DictConvert; | ||
| 19 | * @author QingX | 15 | * @author QingX |
| 20 | */ | 16 | */ |
| 21 | @Data | 17 | @Data |
| 22 | -public class PointRecordExcelVO { | 18 | +public class MemberPointRecordExcelVO { |
| 23 | 19 | ||
| 24 | @ExcelProperty("自增主键") | 20 | @ExcelProperty("自增主键") |
| 25 | private Long id; | 21 | private Long id; |
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 | import lombok.*; | 3 | import lombok.*; |
| 4 | -import java.util.*; | ||
| 5 | import io.swagger.v3.oas.annotations.media.Schema; | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | -import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||
| 7 | 5 | ||
| 8 | @Schema(description = "管理后台 - 用户积分记录 Excel 导出 Request VO,参数和 PointRecordPageReqVO 是一致的") | 6 | @Schema(description = "管理后台 - 用户积分记录 Excel 导出 Request VO,参数和 PointRecordPageReqVO 是一致的") |
| 9 | @Data | 7 | @Data |
| 10 | -public class PointRecordExportReqVO { | 8 | +public class MemberPointRecordExportReqVO { |
| 11 | 9 | ||
| 12 | @Schema(description = "业务编码", example = "22706") | 10 | @Schema(description = "业务编码", example = "22706") |
| 13 | private String bizId; | 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 | import lombok.*; | 3 | import lombok.*; |
| 4 | -import java.util.*; | ||
| 5 | import io.swagger.v3.oas.annotations.media.Schema; | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | import cn.iocoder.yudao.framework.common.pojo.PageParam; | 5 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 7 | 6 | ||
| @@ -9,7 +8,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam; | @@ -9,7 +8,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||
| 9 | @Data | 8 | @Data |
| 10 | @EqualsAndHashCode(callSuper = true) | 9 | @EqualsAndHashCode(callSuper = true) |
| 11 | @ToString(callSuper = true) | 10 | @ToString(callSuper = true) |
| 12 | -public class PointRecordPageReqVO extends PageParam { | 11 | +public class MemberPointRecordPageReqVO extends PageParam { |
| 13 | 12 | ||
| 14 | @Schema(description = "业务编码", example = "22706") | 13 | @Schema(description = "业务编码", example = "22706") |
| 15 | private String bizId; | 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 | import io.swagger.v3.oas.annotations.media.Schema; | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | import lombok.*; | 4 | import lombok.*; |
| @@ -8,7 +8,7 @@ import java.time.LocalDateTime; | @@ -8,7 +8,7 @@ import java.time.LocalDateTime; | ||
| 8 | @Data | 8 | @Data |
| 9 | @EqualsAndHashCode(callSuper = true) | 9 | @EqualsAndHashCode(callSuper = true) |
| 10 | @ToString(callSuper = true) | 10 | @ToString(callSuper = true) |
| 11 | -public class PointRecordRespVO extends PointRecordBaseVO { | 11 | +public class MemberPointRecordRespVO extends MemberPointRecordBaseVO { |
| 12 | 12 | ||
| 13 | @Schema(description = "自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31457") | 13 | @Schema(description = "自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31457") |
| 14 | private Long id; | 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 | import io.swagger.v3.oas.annotations.media.Schema; | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | import lombok.*; | 4 | import lombok.*; |
| 5 | -import java.util.*; | 5 | + |
| 6 | import javax.validation.constraints.*; | 6 | import javax.validation.constraints.*; |
| 7 | 7 | ||
| 8 | @Schema(description = "管理后台 - 用户积分记录更新 Request VO") | 8 | @Schema(description = "管理后台 - 用户积分记录更新 Request VO") |
| 9 | @Data | 9 | @Data |
| 10 | @EqualsAndHashCode(callSuper = true) | 10 | @EqualsAndHashCode(callSuper = true) |
| 11 | @ToString(callSuper = true) | 11 | @ToString(callSuper = true) |
| 12 | -public class PointRecordUpdateReqVO extends PointRecordBaseVO { | 12 | +public class MemberPointRecordUpdateReqVO extends MemberPointRecordBaseVO { |
| 13 | 13 | ||
| 14 | @Schema(description = "自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31457") | 14 | @Schema(description = "自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31457") |
| 15 | @NotNull(message = "自增主键不能为空") | 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.framework.excel.core.util.ExcelUtils; | ||
| 6 | +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | ||
| 7 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.*; | ||
| 8 | +import cn.iocoder.yudao.module.member.convert.signin.MemberSignInConfigConvert; | ||
| 9 | +import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO; | ||
| 10 | +import cn.iocoder.yudao.module.member.service.signin.MemberSignInConfigService; | ||
| 9 | import io.swagger.v3.oas.annotations.Operation; | 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.*; | ||
| 10 | 17 | ||
| 11 | -import javax.validation.constraints.*; | ||
| 12 | -import javax.validation.*; | ||
| 13 | -import javax.servlet.http.*; | ||
| 14 | -import java.util.*; | 18 | +import javax.annotation.Resource; |
| 19 | +import javax.servlet.http.HttpServletResponse; | ||
| 20 | +import javax.validation.Valid; | ||
| 15 | import java.io.IOException; | 21 | import java.io.IOException; |
| 22 | +import java.util.Collection; | ||
| 23 | +import java.util.List; | ||
| 16 | 24 | ||
| 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; | 25 | 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.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; | 26 | +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; |
| 30 | 27 | ||
| 31 | @Tag(name = "管理后台 - 积分签到规则") | 28 | @Tag(name = "管理后台 - 积分签到规则") |
| 32 | @RestController | 29 | @RestController |
| 33 | @RequestMapping("/point/sign-in-config") | 30 | @RequestMapping("/point/sign-in-config") |
| 34 | @Validated | 31 | @Validated |
| 35 | -public class SignInConfigController { | 32 | +public class MemberSignInConfigController { |
| 36 | 33 | ||
| 37 | @Resource | 34 | @Resource |
| 38 | - private SignInConfigService signInConfigService; | 35 | + private MemberSignInConfigService memberSignInConfigService; |
| 39 | 36 | ||
| 40 | @PostMapping("/create") | 37 | @PostMapping("/create") |
| 41 | @Operation(summary = "创建积分签到规则") | 38 | @Operation(summary = "创建积分签到规则") |
| 42 | @PreAuthorize("@ss.hasPermission('point:sign-in-config:create')") | 39 | @PreAuthorize("@ss.hasPermission('point:sign-in-config:create')") |
| 43 | - public CommonResult<Integer> createSignInConfig(@Valid @RequestBody SignInConfigCreateReqVO createReqVO) { | ||
| 44 | - return success(signInConfigService.createSignInConfig(createReqVO)); | 40 | + public CommonResult<Integer> createSignInConfig(@Valid @RequestBody MemberSignInConfigCreateReqVO createReqVO) { |
| 41 | + return success(memberSignInConfigService.createSignInConfig(createReqVO)); | ||
| 45 | } | 42 | } |
| 46 | 43 | ||
| 47 | @PutMapping("/update") | 44 | @PutMapping("/update") |
| 48 | @Operation(summary = "更新积分签到规则") | 45 | @Operation(summary = "更新积分签到规则") |
| 49 | @PreAuthorize("@ss.hasPermission('point:sign-in-config:update')") | 46 | @PreAuthorize("@ss.hasPermission('point:sign-in-config:update')") |
| 50 | - public CommonResult<Boolean> updateSignInConfig(@Valid @RequestBody SignInConfigUpdateReqVO updateReqVO) { | ||
| 51 | - signInConfigService.updateSignInConfig(updateReqVO); | 47 | + public CommonResult<Boolean> updateSignInConfig(@Valid @RequestBody MemberSignInConfigUpdateReqVO updateReqVO) { |
| 48 | + memberSignInConfigService.updateSignInConfig(updateReqVO); | ||
| 52 | return success(true); | 49 | return success(true); |
| 53 | } | 50 | } |
| 54 | 51 | ||
| @@ -57,7 +54,7 @@ public class SignInConfigController { | @@ -57,7 +54,7 @@ public class SignInConfigController { | ||
| 57 | @Parameter(name = "id", description = "编号", required = true) | 54 | @Parameter(name = "id", description = "编号", required = true) |
| 58 | @PreAuthorize("@ss.hasPermission('point:sign-in-config:delete')") | 55 | @PreAuthorize("@ss.hasPermission('point:sign-in-config:delete')") |
| 59 | public CommonResult<Boolean> deleteSignInConfig(@RequestParam("id") Integer id) { | 56 | public CommonResult<Boolean> deleteSignInConfig(@RequestParam("id") Integer id) { |
| 60 | - signInConfigService.deleteSignInConfig(id); | 57 | + memberSignInConfigService.deleteSignInConfig(id); |
| 61 | return success(true); | 58 | return success(true); |
| 62 | } | 59 | } |
| 63 | 60 | ||
| @@ -65,38 +62,38 @@ public class SignInConfigController { | @@ -65,38 +62,38 @@ public class SignInConfigController { | ||
| 65 | @Operation(summary = "获得积分签到规则") | 62 | @Operation(summary = "获得积分签到规则") |
| 66 | @Parameter(name = "id", description = "编号", required = true, example = "1024") | 63 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 67 | @PreAuthorize("@ss.hasPermission('point:sign-in-config:query')") | 64 | @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)); | 65 | + public CommonResult<MemberSignInConfigRespVO> getSignInConfig(@RequestParam("id") Integer id) { |
| 66 | + MemberSignInConfigDO signInConfig = memberSignInConfigService.getSignInConfig(id); | ||
| 67 | + return success(MemberSignInConfigConvert.INSTANCE.convert(signInConfig)); | ||
| 71 | } | 68 | } |
| 72 | 69 | ||
| 73 | @GetMapping("/list") | 70 | @GetMapping("/list") |
| 74 | @Operation(summary = "获得积分签到规则列表") | 71 | @Operation(summary = "获得积分签到规则列表") |
| 75 | @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") | 72 | @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
| 76 | @PreAuthorize("@ss.hasPermission('point:sign-in-config:query')") | 73 | @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)); | 74 | + public CommonResult<List<MemberSignInConfigRespVO>> getSignInConfigList(@RequestParam("ids") Collection<Integer> ids) { |
| 75 | + List<MemberSignInConfigDO> list = memberSignInConfigService.getSignInConfigList(ids); | ||
| 76 | + return success(MemberSignInConfigConvert.INSTANCE.convertList(list)); | ||
| 80 | } | 77 | } |
| 81 | 78 | ||
| 82 | @GetMapping("/page") | 79 | @GetMapping("/page") |
| 83 | @Operation(summary = "获得积分签到规则分页") | 80 | @Operation(summary = "获得积分签到规则分页") |
| 84 | @PreAuthorize("@ss.hasPermission('point:sign-in-config:query')") | 81 | @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)); | 82 | + public CommonResult<PageResult<MemberSignInConfigRespVO>> getSignInConfigPage(@Valid MemberSignInConfigPageReqVO pageVO) { |
| 83 | + PageResult<MemberSignInConfigDO> pageResult = memberSignInConfigService.getSignInConfigPage(pageVO); | ||
| 84 | + return success(MemberSignInConfigConvert.INSTANCE.convertPage(pageResult)); | ||
| 88 | } | 85 | } |
| 89 | 86 | ||
| 90 | @GetMapping("/export-excel") | 87 | @GetMapping("/export-excel") |
| 91 | @Operation(summary = "导出积分签到规则 Excel") | 88 | @Operation(summary = "导出积分签到规则 Excel") |
| 92 | @PreAuthorize("@ss.hasPermission('point:sign-in-config:export')") | 89 | @PreAuthorize("@ss.hasPermission('point:sign-in-config:export')") |
| 93 | @OperateLog(type = EXPORT) | 90 | @OperateLog(type = EXPORT) |
| 94 | - public void exportSignInConfigExcel(@Valid SignInConfigExportReqVO exportReqVO, | 91 | + public void exportSignInConfigExcel(@Valid MemberSignInConfigExportReqVO exportReqVO, |
| 95 | HttpServletResponse response) throws IOException { | 92 | HttpServletResponse response) throws IOException { |
| 96 | - List<SignInConfigDO> list = signInConfigService.getSignInConfigList(exportReqVO); | 93 | + List<MemberSignInConfigDO> list = memberSignInConfigService.getSignInConfigList(exportReqVO); |
| 97 | // 导出 Excel | 94 | // 导出 Excel |
| 98 | - List<SignInConfigExcelVO> datas = SignInConfigConvert.INSTANCE.convertList02(list); | ||
| 99 | - ExcelUtils.write(response, "积分签到规则.xls", "数据", SignInConfigExcelVO.class, datas); | 95 | + List<MemberSignInConfigExcelVO> datas = MemberSignInConfigConvert.INSTANCE.convertList02(list); |
| 96 | + ExcelUtils.write(response, "积分签到规则.xls", "数据", MemberSignInConfigExcelVO.class, datas); | ||
| 100 | } | 97 | } |
| 101 | 98 | ||
| 102 | } | 99 | } |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/SignInRecordController.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/MemberSignInRecordController.java
| 1 | -package cn.iocoder.yudao.module.point.controller.admin.signinrecord; | 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.framework.excel.core.util.ExcelUtils; | ||
| 6 | +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | ||
| 7 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.*; | ||
| 8 | +import cn.iocoder.yudao.module.member.convert.signin.MemberSignInRecordConvert; | ||
| 9 | +import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO; | ||
| 10 | +import cn.iocoder.yudao.module.member.service.signin.MemberSignInRecordService; | ||
| 9 | import io.swagger.v3.oas.annotations.Operation; | 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.*; | ||
| 10 | 17 | ||
| 11 | -import javax.validation.constraints.*; | ||
| 12 | -import javax.validation.*; | ||
| 13 | -import javax.servlet.http.*; | ||
| 14 | -import java.util.*; | 18 | +import javax.annotation.Resource; |
| 19 | +import javax.servlet.http.HttpServletResponse; | ||
| 20 | +import javax.validation.Valid; | ||
| 15 | import java.io.IOException; | 21 | import java.io.IOException; |
| 22 | +import java.util.Collection; | ||
| 23 | +import java.util.List; | ||
| 16 | 24 | ||
| 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; | 25 | 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; | 26 | +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; |
| 30 | 27 | ||
| 31 | @Tag(name = "管理后台 - 用户签到积分") | 28 | @Tag(name = "管理后台 - 用户签到积分") |
| 32 | @RestController | 29 | @RestController |
| 33 | @RequestMapping("/point/sign-in-record") | 30 | @RequestMapping("/point/sign-in-record") |
| 34 | @Validated | 31 | @Validated |
| 35 | -public class SignInRecordController { | 32 | +public class MemberSignInRecordController { |
| 36 | 33 | ||
| 37 | @Resource | 34 | @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 | - } | 35 | + private MemberSignInRecordService memberSignInRecordService; |
| 54 | 36 | ||
| 55 | @DeleteMapping("/delete") | 37 | @DeleteMapping("/delete") |
| 56 | @Operation(summary = "删除用户签到积分") | 38 | @Operation(summary = "删除用户签到积分") |
| 57 | @Parameter(name = "id", description = "编号", required = true) | 39 | @Parameter(name = "id", description = "编号", required = true) |
| 58 | @PreAuthorize("@ss.hasPermission('point:sign-in-record:delete')") | 40 | @PreAuthorize("@ss.hasPermission('point:sign-in-record:delete')") |
| 59 | public CommonResult<Boolean> deleteSignInRecord(@RequestParam("id") Long id) { | 41 | public CommonResult<Boolean> deleteSignInRecord(@RequestParam("id") Long id) { |
| 60 | - signInRecordService.deleteSignInRecord(id); | 42 | + memberSignInRecordService.deleteSignInRecord(id); |
| 61 | return success(true); | 43 | return success(true); |
| 62 | } | 44 | } |
| 63 | 45 | ||
| @@ -65,38 +47,38 @@ public class SignInRecordController { | @@ -65,38 +47,38 @@ public class SignInRecordController { | ||
| 65 | @Operation(summary = "获得用户签到积分") | 47 | @Operation(summary = "获得用户签到积分") |
| 66 | @Parameter(name = "id", description = "编号", required = true, example = "1024") | 48 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| 67 | @PreAuthorize("@ss.hasPermission('point:sign-in-record:query')") | 49 | @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)); | 50 | + public CommonResult<MemberSignInRecordRespVO> getSignInRecord(@RequestParam("id") Long id) { |
| 51 | + MemberSignInRecordDO signInRecord = memberSignInRecordService.getSignInRecord(id); | ||
| 52 | + return success(MemberSignInRecordConvert.INSTANCE.convert(signInRecord)); | ||
| 71 | } | 53 | } |
| 72 | 54 | ||
| 73 | @GetMapping("/list") | 55 | @GetMapping("/list") |
| 74 | @Operation(summary = "获得用户签到积分列表") | 56 | @Operation(summary = "获得用户签到积分列表") |
| 75 | @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") | 57 | @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
| 76 | @PreAuthorize("@ss.hasPermission('point:sign-in-record:query')") | 58 | @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)); | 59 | + public CommonResult<List<MemberSignInRecordRespVO>> getSignInRecordList(@RequestParam("ids") Collection<Long> ids) { |
| 60 | + List<MemberSignInRecordDO> list = memberSignInRecordService.getSignInRecordList(ids); | ||
| 61 | + return success(MemberSignInRecordConvert.INSTANCE.convertList(list)); | ||
| 80 | } | 62 | } |
| 81 | 63 | ||
| 82 | @GetMapping("/page") | 64 | @GetMapping("/page") |
| 83 | @Operation(summary = "获得用户签到积分分页") | 65 | @Operation(summary = "获得用户签到积分分页") |
| 84 | @PreAuthorize("@ss.hasPermission('point:sign-in-record:query')") | 66 | @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)); | 67 | + public CommonResult<PageResult<MemberSignInRecordRespVO>> getSignInRecordPage(@Valid MemberSignInRecordPageReqVO pageVO) { |
| 68 | + PageResult<MemberSignInRecordDO> pageResult = memberSignInRecordService.getSignInRecordPage(pageVO); | ||
| 69 | + return success(MemberSignInRecordConvert.INSTANCE.convertPage(pageResult)); | ||
| 88 | } | 70 | } |
| 89 | 71 | ||
| 90 | @GetMapping("/export-excel") | 72 | @GetMapping("/export-excel") |
| 91 | @Operation(summary = "导出用户签到积分 Excel") | 73 | @Operation(summary = "导出用户签到积分 Excel") |
| 92 | @PreAuthorize("@ss.hasPermission('point:sign-in-record:export')") | 74 | @PreAuthorize("@ss.hasPermission('point:sign-in-record:export')") |
| 93 | @OperateLog(type = EXPORT) | 75 | @OperateLog(type = EXPORT) |
| 94 | - public void exportSignInRecordExcel(@Valid SignInRecordExportReqVO exportReqVO, | 76 | + public void exportSignInRecordExcel(@Valid MemberSignInRecordExportReqVO exportReqVO, |
| 95 | HttpServletResponse response) throws IOException { | 77 | HttpServletResponse response) throws IOException { |
| 96 | - List<SignInRecordDO> list = signInRecordService.getSignInRecordList(exportReqVO); | 78 | + List<MemberSignInRecordDO> list = memberSignInRecordService.getSignInRecordList(exportReqVO); |
| 97 | // 导出 Excel | 79 | // 导出 Excel |
| 98 | - List<SignInRecordExcelVO> datas = SignInRecordConvert.INSTANCE.convertList02(list); | ||
| 99 | - ExcelUtils.write(response, "用户签到积分.xls", "数据", SignInRecordExcelVO.class, datas); | 80 | + List<MemberSignInRecordExcelVO> datas = MemberSignInRecordConvert.INSTANCE.convertList02(list); |
| 81 | + ExcelUtils.write(response, "用户签到积分.xls", "数据", MemberSignInRecordExcelVO.class, datas); | ||
| 100 | } | 82 | } |
| 101 | 83 | ||
| 102 | } | 84 | } |
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 | import io.swagger.v3.oas.annotations.media.Schema; | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | import lombok.*; | 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 | * 积分签到规则 Base VO,提供给添加、修改、详细的子 VO 使用 | 7 | * 积分签到规则 Base VO,提供给添加、修改、详细的子 VO 使用 |
| 12 | * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | 8 | * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
| 13 | */ | 9 | */ |
| 14 | @Data | 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 | private Integer day; | 14 | private Integer day; |
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 | import lombok.*; | 3 | import lombok.*; |
| 4 | -import java.util.*; | ||
| 5 | import io.swagger.v3.oas.annotations.media.Schema; | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | -import javax.validation.constraints.*; | ||
| 7 | 5 | ||
| 8 | @Schema(description = "管理后台 - 积分签到规则创建 Request VO") | 6 | @Schema(description = "管理后台 - 积分签到规则创建 Request VO") |
| 9 | @Data | 7 | @Data |
| 10 | @EqualsAndHashCode(callSuper = true) | 8 | @EqualsAndHashCode(callSuper = true) |
| 11 | @ToString(callSuper = true) | 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/SignInConfigExcelVO.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigExcelVO.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 | -import io.swagger.v3.oas.annotations.media.Schema; | ||
| 4 | import lombok.*; | 3 | import lombok.*; |
| 5 | -import java.util.*; | ||
| 6 | -import java.time.LocalDateTime; | 4 | + |
| 7 | import java.time.LocalDateTime; | 5 | import java.time.LocalDateTime; |
| 8 | 6 | ||
| 9 | import com.alibaba.excel.annotation.ExcelProperty; | 7 | import com.alibaba.excel.annotation.ExcelProperty; |
| @@ -14,7 +12,7 @@ import com.alibaba.excel.annotation.ExcelProperty; | @@ -14,7 +12,7 @@ import com.alibaba.excel.annotation.ExcelProperty; | ||
| 14 | * @author QingX | 12 | * @author QingX |
| 15 | */ | 13 | */ |
| 16 | @Data | 14 | @Data |
| 17 | -public class SignInConfigExcelVO { | 15 | +public class MemberSignInConfigExcelVO { |
| 18 | 16 | ||
| 19 | @ExcelProperty("签到第x天") | 17 | @ExcelProperty("签到第x天") |
| 20 | private Integer day; | 18 | private Integer day; |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinconfig/vo/SignInConfigExportReqVO.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInConfigExportReqVO.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 | import lombok.*; | 3 | import lombok.*; |
| 4 | -import java.util.*; | ||
| 5 | import io.swagger.v3.oas.annotations.media.Schema; | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | -import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||
| 7 | 5 | ||
| 8 | @Schema(description = "管理后台 - 积分签到规则 Excel 导出 Request VO,参数和 SignInConfigPageReqVO 是一致的") | 6 | @Schema(description = "管理后台 - 积分签到规则 Excel 导出 Request VO,参数和 SignInConfigPageReqVO 是一致的") |
| 9 | @Data | 7 | @Data |
| 10 | -public class SignInConfigExportReqVO { | 8 | +public class MemberSignInConfigExportReqVO { |
| 11 | 9 | ||
| 12 | @Schema(description = "签到第x天", example = "7") | 10 | @Schema(description = "签到第x天", example = "7") |
| 13 | private Integer day; | 11 | private Integer day; |
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 | import lombok.*; | 3 | import lombok.*; |
| 4 | -import java.util.*; | ||
| 5 | import io.swagger.v3.oas.annotations.media.Schema; | 4 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | import cn.iocoder.yudao.framework.common.pojo.PageParam; | 5 | import cn.iocoder.yudao.framework.common.pojo.PageParam; |
| 7 | 6 | ||
| @@ -9,7 +8,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam; | @@ -9,7 +8,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||
| 9 | @Data | 8 | @Data |
| 10 | @EqualsAndHashCode(callSuper = true) | 9 | @EqualsAndHashCode(callSuper = true) |
| 11 | @ToString(callSuper = true) | 10 | @ToString(callSuper = true) |
| 12 | -public class SignInConfigPageReqVO extends PageParam { | 11 | +public class MemberSignInConfigPageReqVO extends PageParam { |
| 13 | 12 | ||
| 14 | @Schema(description = "签到第x天", example = "7") | 13 | @Schema(description = "签到第x天", example = "7") |
| 15 | private Integer day; | 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 | import io.swagger.v3.oas.annotations.media.Schema; | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | import lombok.*; | 4 | import lombok.*; |
| @@ -8,7 +8,7 @@ import java.time.LocalDateTime; | @@ -8,7 +8,7 @@ import java.time.LocalDateTime; | ||
| 8 | @Data | 8 | @Data |
| 9 | @EqualsAndHashCode(callSuper = true) | 9 | @EqualsAndHashCode(callSuper = true) |
| 10 | @ToString(callSuper = true) | 10 | @ToString(callSuper = true) |
| 11 | -public class SignInConfigRespVO extends SignInConfigBaseVO { | 11 | +public class MemberSignInConfigRespVO extends MemberSignInConfigBaseVO { |
| 12 | 12 | ||
| 13 | @Schema(description = "自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "20937") | 13 | @Schema(description = "自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "20937") |
| 14 | private Integer id; | 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 | import io.swagger.v3.oas.annotations.media.Schema; | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 4 | import lombok.*; | 4 | import lombok.*; |
| 5 | -import java.util.*; | 5 | + |
| 6 | import javax.validation.constraints.*; | 6 | import javax.validation.constraints.*; |
| 7 | 7 | ||
| 8 | @Schema(description = "管理后台 - 积分签到规则更新 Request VO") | 8 | @Schema(description = "管理后台 - 积分签到规则更新 Request VO") |
| 9 | @Data | 9 | @Data |
| 10 | @EqualsAndHashCode(callSuper = true) | 10 | @EqualsAndHashCode(callSuper = true) |
| 11 | @ToString(callSuper = true) | 11 | @ToString(callSuper = true) |
| 12 | -public class SignInConfigUpdateReqVO extends SignInConfigBaseVO { | 12 | +public class MemberSignInConfigUpdateReqVO extends MemberSignInConfigBaseVO { |
| 13 | 13 | ||
| 14 | @Schema(description = "规则自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "13653") | 14 | @Schema(description = "规则自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "13653") |
| 15 | @NotNull(message = "规则自增主键不能为空") | 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 | import io.swagger.v3.oas.annotations.media.Schema; | 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 | * 用户签到积分 Base VO,提供给添加、修改、详细的子 VO 使用 | 7 | * 用户签到积分 Base VO,提供给添加、修改、详细的子 VO 使用 |
| 12 | * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | 8 | * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
| 13 | */ | 9 | */ |
| 14 | @Data | 10 | @Data |
| 15 | -public class SignInRecordBaseVO { | 11 | +public class MemberSignInRecordBaseVO { |
| 16 | 12 | ||
| 17 | @Schema(description = "签到用户", example = "6507") | 13 | @Schema(description = "签到用户", example = "6507") |
| 18 | private Integer userId; | 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 | import io.swagger.v3.oas.annotations.media.Schema; | 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 | @Schema(description = "管理后台 - 用户签到积分创建 Request VO") | 8 | @Schema(description = "管理后台 - 用户签到积分创建 Request VO") |
| 9 | @Data | 9 | @Data |
| 10 | @EqualsAndHashCode(callSuper = true) | 10 | @EqualsAndHashCode(callSuper = true) |
| 11 | @ToString(callSuper = true) | 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/SignInRecordExcelVO.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordExcelVO.java
| 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; | 1 | +package cn.iocoder.yudao.module.member.controller.admin.signin.vo; |
| 8 | 2 | ||
| 9 | import com.alibaba.excel.annotation.ExcelProperty; | 3 | import com.alibaba.excel.annotation.ExcelProperty; |
| 4 | +import lombok.Data; | ||
| 5 | + | ||
| 6 | +import java.time.LocalDateTime; | ||
| 10 | 7 | ||
| 11 | /** | 8 | /** |
| 12 | * 用户签到积分 Excel VO | 9 | * 用户签到积分 Excel VO |
| @@ -14,7 +11,7 @@ import com.alibaba.excel.annotation.ExcelProperty; | @@ -14,7 +11,7 @@ import com.alibaba.excel.annotation.ExcelProperty; | ||
| 14 | * @author 芋道源码 | 11 | * @author 芋道源码 |
| 15 | */ | 12 | */ |
| 16 | @Data | 13 | @Data |
| 17 | -public class SignInRecordExcelVO { | 14 | +public class MemberSignInRecordExcelVO { |
| 18 | 15 | ||
| 19 | @ExcelProperty("签到自增id") | 16 | @ExcelProperty("签到自增id") |
| 20 | private Long id; | 17 | private Long id; |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/controller/admin/signinrecord/vo/SignInRecordExportReqVO.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/signin/vo/MemberSignInRecordExportReqVO.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; | 3 | import io.swagger.v3.oas.annotations.media.Schema; |
| 6 | -import cn.iocoder.yudao.framework.common.pojo.PageParam; | ||
| 7 | -import java.time.LocalDateTime; | 4 | +import lombok.Data; |
| 8 | import org.springframework.format.annotation.DateTimeFormat; | 5 | import org.springframework.format.annotation.DateTimeFormat; |
| 9 | 6 | ||
| 7 | +import java.time.LocalDateTime; | ||
| 8 | + | ||
| 10 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | 9 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; |
| 11 | 10 | ||
| 12 | @Schema(description = "管理后台 - 用户签到积分 Excel 导出 Request VO,参数和 SignInRecordPageReqVO 是一致的") | 11 | @Schema(description = "管理后台 - 用户签到积分 Excel 导出 Request VO,参数和 SignInRecordPageReqVO 是一致的") |
| 13 | @Data | 12 | @Data |
| 14 | -public class SignInRecordExportReqVO { | 13 | +public class MemberSignInRecordExportReqVO { |
| 15 | 14 | ||
| 16 | @Schema(description = "签到用户", example = "6507") | 15 | @Schema(description = "签到用户", example = "6507") |
| 17 | private Integer userId; | 16 | private Integer userId; |
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 | import cn.iocoder.yudao.framework.common.pojo.PageParam; | 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 | import org.springframework.format.annotation.DateTimeFormat; | 8 | import org.springframework.format.annotation.DateTimeFormat; |
| 9 | + | ||
| 8 | import java.time.LocalDateTime; | 10 | import java.time.LocalDateTime; |
| 9 | 11 | ||
| 10 | import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; | 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,7 +15,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ | ||
| 13 | @Data | 15 | @Data |
| 14 | @EqualsAndHashCode(callSuper = true) | 16 | @EqualsAndHashCode(callSuper = true) |
| 15 | @ToString(callSuper = true) | 17 | @ToString(callSuper = true) |
| 16 | -public class SignInRecordPageReqVO extends PageParam { | 18 | +public class MemberSignInRecordPageReqVO extends PageParam { |
| 17 | 19 | ||
| 18 | @Schema(description = "签到用户", example = "6507") | 20 | @Schema(description = "签到用户", example = "6507") |
| 19 | private Integer userId; | 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 | import io.swagger.v3.oas.annotations.media.Schema; | 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 | import java.time.LocalDateTime; | 8 | import java.time.LocalDateTime; |
| 6 | 9 | ||
| 7 | @Schema(description = "管理后台 - 用户签到积分 Response VO") | 10 | @Schema(description = "管理后台 - 用户签到积分 Response VO") |
| 8 | @Data | 11 | @Data |
| 9 | @EqualsAndHashCode(callSuper = true) | 12 | @EqualsAndHashCode(callSuper = true) |
| 10 | @ToString(callSuper = true) | 13 | @ToString(callSuper = true) |
| 11 | -public class SignInRecordRespVO extends SignInRecordBaseVO { | 14 | +public class MemberSignInRecordRespVO extends MemberSignInRecordBaseVO { |
| 12 | 15 | ||
| 13 | @Schema(description = "签到自增id", requiredMode = Schema.RequiredMode.REQUIRED, example = "11903") | 16 | @Schema(description = "签到自增id", requiredMode = Schema.RequiredMode.REQUIRED, example = "11903") |
| 14 | private Long id; | 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 | import io.swagger.v3.oas.annotations.media.Schema; | 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 | @Schema(description = "管理后台 - 用户签到积分更新 Request VO") | 10 | @Schema(description = "管理后台 - 用户签到积分更新 Request VO") |
| 9 | @Data | 11 | @Data |
| 10 | @EqualsAndHashCode(callSuper = true) | 12 | @EqualsAndHashCode(callSuper = true) |
| 11 | @ToString(callSuper = true) | 13 | @ToString(callSuper = true) |
| 12 | -public class SignInRecordUpdateReqVO extends SignInRecordBaseVO { | 14 | +public class MemberSignInRecordUpdateReqVO extends MemberSignInRecordBaseVO { |
| 13 | 15 | ||
| 14 | @Schema(description = "签到自增id", requiredMode = Schema.RequiredMode.REQUIRED, example = "11903") | 16 | @Schema(description = "签到自增id", requiredMode = Schema.RequiredMode.REQUIRED, example = "11903") |
| 15 | @NotNull(message = "签到自增id不能为空") | 17 | @NotNull(message = "签到自增id不能为空") |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/point/MemberPointConfigConvert.java
| 1 | package cn.iocoder.yudao.module.member.convert.point; | 1 | package cn.iocoder.yudao.module.member.convert.point; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.module.member.controller.admin.point.vo.config.MemberPointConfigRespVO; | 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 | import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointConfigDO; | 6 | import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointConfigDO; |
| 7 | +import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointRecordDO; | ||
| 5 | import org.mapstruct.Mapper; | 8 | import org.mapstruct.Mapper; |
| 6 | import org.mapstruct.factory.Mappers; | 9 | import org.mapstruct.factory.Mappers; |
| 7 | 10 | ||
| @@ -17,4 +20,7 @@ public interface MemberPointConfigConvert { | @@ -17,4 +20,7 @@ public interface MemberPointConfigConvert { | ||
| 17 | 20 | ||
| 18 | MemberPointConfigRespVO convert(MemberPointConfigDO bean); | 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 java.util.*; | ||
| 4 | + | ||
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 6 | + | ||
| 7 | +import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordCreateReqVO; | ||
| 8 | +import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordExcelVO; | ||
| 9 | +import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordRespVO; | ||
| 10 | +import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordUpdateReqVO; | ||
| 11 | +import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointRecordDO; | ||
| 12 | +import org.mapstruct.Mapper; | ||
| 13 | +import org.mapstruct.factory.Mappers; | ||
| 14 | + | ||
| 15 | +/** | ||
| 16 | + * 用户积分记录 Convert | ||
| 17 | + * | ||
| 18 | + * @author QingX | ||
| 19 | + */ | ||
| 20 | +@Mapper | ||
| 21 | +public interface MemberPointRecordConvert { | ||
| 22 | + | ||
| 23 | + MemberPointRecordConvert INSTANCE = Mappers.getMapper(MemberPointRecordConvert.class); | ||
| 24 | + | ||
| 25 | + MemberPointRecordDO convert(MemberPointRecordCreateReqVO bean); | ||
| 26 | + | ||
| 27 | + MemberPointRecordDO convert(MemberPointRecordUpdateReqVO bean); | ||
| 28 | + | ||
| 29 | + MemberPointRecordRespVO convert(MemberPointRecordDO bean); | ||
| 30 | + | ||
| 31 | + List<MemberPointRecordRespVO> convertList(List<MemberPointRecordDO> list); | ||
| 32 | + | ||
| 33 | + PageResult<MemberPointRecordRespVO> convertPage(PageResult<MemberPointRecordDO> page); | ||
| 34 | + | ||
| 35 | + List<MemberPointRecordExcelVO> convertList02(List<MemberPointRecordDO> list); | ||
| 36 | + | ||
| 37 | +} |
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 java.util.*; | ||
| 4 | + | ||
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 6 | + | ||
| 7 | +import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO; | ||
| 8 | +import org.mapstruct.Mapper; | ||
| 9 | +import org.mapstruct.factory.Mappers; | ||
| 10 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.*; | ||
| 11 | + | ||
| 12 | +/** | ||
| 13 | + * 积分签到规则 Convert | ||
| 14 | + * | ||
| 15 | + * @author QingX | ||
| 16 | + */ | ||
| 17 | +@Mapper | ||
| 18 | +public interface MemberSignInConfigConvert { | ||
| 19 | + | ||
| 20 | + MemberSignInConfigConvert INSTANCE = Mappers.getMapper(MemberSignInConfigConvert.class); | ||
| 21 | + | ||
| 22 | + MemberSignInConfigDO convert(MemberSignInConfigCreateReqVO bean); | ||
| 23 | + | ||
| 24 | + MemberSignInConfigDO convert(MemberSignInConfigUpdateReqVO bean); | ||
| 25 | + | ||
| 26 | + MemberSignInConfigRespVO convert(MemberSignInConfigDO bean); | ||
| 27 | + | ||
| 28 | + List<MemberSignInConfigRespVO> convertList(List<MemberSignInConfigDO> list); | ||
| 29 | + | ||
| 30 | + PageResult<MemberSignInConfigRespVO> convertPage(PageResult<MemberSignInConfigDO> page); | ||
| 31 | + | ||
| 32 | + List<MemberSignInConfigExcelVO> convertList02(List<MemberSignInConfigDO> list); | ||
| 33 | + | ||
| 34 | +} |
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 java.util.*; | ||
| 4 | + | ||
| 5 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 6 | + | ||
| 7 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordCreateReqVO; | ||
| 8 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordExcelVO; | ||
| 9 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordRespVO; | ||
| 10 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordUpdateReqVO; | ||
| 11 | +import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO; | ||
| 12 | +import org.mapstruct.Mapper; | ||
| 13 | +import org.mapstruct.factory.Mappers; | ||
| 14 | + | ||
| 15 | +/** | ||
| 16 | + * 用户签到积分 Convert | ||
| 17 | + * | ||
| 18 | + * @author 芋道源码 | ||
| 19 | + */ | ||
| 20 | +@Mapper | ||
| 21 | +public interface MemberSignInRecordConvert { | ||
| 22 | + | ||
| 23 | + MemberSignInRecordConvert INSTANCE = Mappers.getMapper(MemberSignInRecordConvert.class); | ||
| 24 | + | ||
| 25 | + MemberSignInRecordDO convert(MemberSignInRecordCreateReqVO bean); | ||
| 26 | + | ||
| 27 | + MemberSignInRecordDO convert(MemberSignInRecordUpdateReqVO bean); | ||
| 28 | + | ||
| 29 | + MemberSignInRecordRespVO convert(MemberSignInRecordDO bean); | ||
| 30 | + | ||
| 31 | + List<MemberSignInRecordRespVO> convertList(List<MemberSignInRecordDO> list); | ||
| 32 | + | ||
| 33 | + PageResult<MemberSignInRecordRespVO> convertPage(PageResult<MemberSignInRecordDO> page); | ||
| 34 | + | ||
| 35 | + List<MemberSignInRecordExcelVO> convertList02(List<MemberSignInRecordDO> list); | ||
| 36 | + | ||
| 37 | +} |
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 | import lombok.*; | 7 | import lombok.*; |
| 4 | -import java.util.*; | ||
| 5 | -import java.time.LocalDateTime; | ||
| 6 | -import java.time.LocalDateTime; | ||
| 7 | -import java.time.LocalDateTime; | 8 | + |
| 8 | import java.time.LocalDateTime; | 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 | * 用户积分记录 DO | 12 | * 用户积分记录 DO |
| @@ -22,7 +21,7 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | @@ -22,7 +21,7 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||
| 22 | @Builder | 21 | @Builder |
| 23 | @NoArgsConstructor | 22 | @NoArgsConstructor |
| 24 | @AllArgsConstructor | 23 | @AllArgsConstructor |
| 25 | -public class PointRecordDO extends BaseDO { | 24 | +public class MemberPointRecordDO extends BaseDO { |
| 26 | 25 | ||
| 27 | /** | 26 | /** |
| 28 | * 自增主键 | 27 | * 自增主键 |
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 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | 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 | * 积分签到规则 DO | 10 | * 积分签到规则 DO |
| @@ -20,7 +19,7 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | @@ -20,7 +19,7 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||
| 20 | @Builder | 19 | @Builder |
| 21 | @NoArgsConstructor | 20 | @NoArgsConstructor |
| 22 | @AllArgsConstructor | 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 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | 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 | * 用户签到积分 DO | 10 | * 用户签到积分 DO |
| @@ -20,7 +19,7 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | @@ -20,7 +19,7 @@ import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | ||
| 20 | @Builder | 19 | @Builder |
| 21 | @NoArgsConstructor | 20 | @NoArgsConstructor |
| 22 | @AllArgsConstructor | 21 | @AllArgsConstructor |
| 23 | -public class SignInRecordDO extends BaseDO { | 22 | +public class MemberSignInRecordDO extends BaseDO { |
| 24 | 23 | ||
| 25 | /** | 24 | /** |
| 26 | * 签到自增id | 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.MemberPointRecordExportReqVO; | ||
| 7 | +import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordPageReqVO; | ||
| 8 | +import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointRecordDO; | ||
| 9 | +import org.apache.ibatis.annotations.Mapper; | ||
| 10 | + | ||
| 11 | +import java.util.List; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * 用户积分记录 Mapper | ||
| 15 | + * | ||
| 16 | + * @author QingX | ||
| 17 | + */ | ||
| 18 | +@Mapper | ||
| 19 | +public interface MemberPointRecordMapper extends BaseMapperX<MemberPointRecordDO> { | ||
| 20 | + | ||
| 21 | + default PageResult<MemberPointRecordDO> selectPage(MemberPointRecordPageReqVO reqVO) { | ||
| 22 | + return selectPage(reqVO, new LambdaQueryWrapperX<MemberPointRecordDO>() | ||
| 23 | + .eqIfPresent(MemberPointRecordDO::getBizId, reqVO.getBizId()) | ||
| 24 | + .eqIfPresent(MemberPointRecordDO::getBizType, reqVO.getBizType()) | ||
| 25 | + .eqIfPresent(MemberPointRecordDO::getType, reqVO.getType()) | ||
| 26 | + .eqIfPresent(MemberPointRecordDO::getTitle, reqVO.getTitle()) | ||
| 27 | + .eqIfPresent(MemberPointRecordDO::getStatus, reqVO.getStatus()) | ||
| 28 | + .orderByDesc(MemberPointRecordDO::getId)); | ||
| 29 | + } | ||
| 30 | + | ||
| 31 | + default List<MemberPointRecordDO> selectList(MemberPointRecordExportReqVO reqVO) { | ||
| 32 | + return selectList(new LambdaQueryWrapperX<MemberPointRecordDO>() | ||
| 33 | + .eqIfPresent(MemberPointRecordDO::getBizId, reqVO.getBizId()) | ||
| 34 | + .eqIfPresent(MemberPointRecordDO::getBizType, reqVO.getBizType()) | ||
| 35 | + .eqIfPresent(MemberPointRecordDO::getType, reqVO.getType()) | ||
| 36 | + .eqIfPresent(MemberPointRecordDO::getTitle, reqVO.getTitle()) | ||
| 37 | + .eqIfPresent(MemberPointRecordDO::getStatus, reqVO.getStatus()) | ||
| 38 | + .orderByDesc(MemberPointRecordDO::getId)); | ||
| 39 | + } | ||
| 40 | + | ||
| 41 | +} |
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.MemberSignInConfigExportReqVO; | ||
| 7 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigPageReqVO; | ||
| 8 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigUpdateReqVO; | ||
| 9 | +import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO; | ||
| 10 | +import org.apache.ibatis.annotations.Mapper; | ||
| 11 | + | ||
| 12 | +import java.util.List; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * 积分签到规则 Mapper | ||
| 16 | + * | ||
| 17 | + * @author QingX | ||
| 18 | + */ | ||
| 19 | +@Mapper | ||
| 20 | +public interface MemberSignInConfigMapper extends BaseMapperX<MemberSignInConfigDO> { | ||
| 21 | + | ||
| 22 | + default PageResult<MemberSignInConfigDO> selectPage(MemberSignInConfigPageReqVO reqVO) { | ||
| 23 | + return selectPage(reqVO, new LambdaQueryWrapperX<MemberSignInConfigDO>() | ||
| 24 | + .eqIfPresent(MemberSignInConfigDO::getDay, reqVO.getDay()) | ||
| 25 | + .orderByAsc(MemberSignInConfigDO::getDay)); | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + default List<MemberSignInConfigDO> selectList(MemberSignInConfigExportReqVO reqVO) { | ||
| 29 | + return selectList(new LambdaQueryWrapperX<MemberSignInConfigDO>() | ||
| 30 | + .eqIfPresent(MemberSignInConfigDO::getDay, reqVO.getDay()) | ||
| 31 | + .orderByDesc(MemberSignInConfigDO::getId)); | ||
| 32 | + } | ||
| 33 | + | ||
| 34 | + // | ||
| 35 | + default long selectSameDayNotSelf(MemberSignInConfigUpdateReqVO reqVO){ | ||
| 36 | + return selectCount(new LambdaQueryWrapperX <MemberSignInConfigDO>() | ||
| 37 | + .ne(MemberSignInConfigDO::getId, reqVO.getId()) | ||
| 38 | + .eq(MemberSignInConfigDO::getDay,reqVO.getDay()) | ||
| 39 | + ); | ||
| 40 | + } | ||
| 41 | + | ||
| 42 | +} |
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.MemberSignInRecordExportReqVO; | ||
| 7 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordPageReqVO; | ||
| 8 | +import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO; | ||
| 9 | +import org.apache.ibatis.annotations.Mapper; | ||
| 10 | + | ||
| 11 | +import java.util.List; | ||
| 12 | + | ||
| 13 | +/** | ||
| 14 | + * 用户签到积分 Mapper | ||
| 15 | + * | ||
| 16 | + * @author 芋道源码 | ||
| 17 | + */ | ||
| 18 | +@Mapper | ||
| 19 | +public interface MemberSignInRecordMapper extends BaseMapperX<MemberSignInRecordDO> { | ||
| 20 | + | ||
| 21 | + default PageResult<MemberSignInRecordDO> selectPage(MemberSignInRecordPageReqVO reqVO) { | ||
| 22 | + return selectPage(reqVO, new LambdaQueryWrapperX<MemberSignInRecordDO>() | ||
| 23 | + .eqIfPresent(MemberSignInRecordDO::getUserId, reqVO.getUserId()) | ||
| 24 | + .eqIfPresent(MemberSignInRecordDO::getDay, reqVO.getDay()) | ||
| 25 | + .betweenIfPresent(MemberSignInRecordDO::getCreateTime, reqVO.getCreateTime()) | ||
| 26 | + .orderByDesc(MemberSignInRecordDO::getId)); | ||
| 27 | + } | ||
| 28 | + | ||
| 29 | + default List<MemberSignInRecordDO> selectList(MemberSignInRecordExportReqVO reqVO) { | ||
| 30 | + return selectList(new LambdaQueryWrapperX<MemberSignInRecordDO>() | ||
| 31 | + .eqIfPresent(MemberSignInRecordDO::getUserId, reqVO.getUserId()) | ||
| 32 | + .eqIfPresent(MemberSignInRecordDO::getDay, reqVO.getDay()) | ||
| 33 | + .betweenIfPresent(MemberSignInRecordDO::getCreateTime, reqVO.getCreateTime()) | ||
| 34 | + .orderByDesc(MemberSignInRecordDO::getId)); | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | +} |
yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointConfigServiceImpl.java
| 1 | package cn.iocoder.yudao.module.member.service.point; | 1 | package cn.iocoder.yudao.module.member.service.point; |
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.module.member.controller.admin.point.vo.config.MemberPointConfigSaveReqVO; | 3 | import cn.iocoder.yudao.module.member.controller.admin.point.vo.config.MemberPointConfigSaveReqVO; |
| 4 | +import cn.iocoder.yudao.module.member.convert.point.MemberPointConfigConvert; | ||
| 4 | import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointConfigDO; | 5 | import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointConfigDO; |
| 6 | +import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointRecordDO; | ||
| 5 | import cn.iocoder.yudao.module.member.dal.mysql.point.MemberPointConfigMapper; | 7 | import cn.iocoder.yudao.module.member.dal.mysql.point.MemberPointConfigMapper; |
| 6 | import org.springframework.stereotype.Service; | 8 | import org.springframework.stereotype.Service; |
| 7 | import org.springframework.validation.annotation.Validated; | 9 | import org.springframework.validation.annotation.Validated; |
| 8 | 10 | ||
| 9 | import javax.annotation.Resource; | 11 | import javax.annotation.Resource; |
| 12 | +import java.util.List; | ||
| 10 | 13 | ||
| 11 | /** | 14 | /** |
| 12 | * 会员积分配置 Service 实现类 | 15 | * 会员积分配置 Service 实现类 |
| @@ -18,16 +21,23 @@ import javax.annotation.Resource; | @@ -18,16 +21,23 @@ import javax.annotation.Resource; | ||
| 18 | public class MemberPointConfigServiceImpl implements MemberPointConfigService { | 21 | public class MemberPointConfigServiceImpl implements MemberPointConfigService { |
| 19 | 22 | ||
| 20 | @Resource | 23 | @Resource |
| 21 | - private MemberPointConfigMapper memberPointConfigMapper; | 24 | + private MemberPointConfigMapper pointConfigMapper; |
| 22 | 25 | ||
| 23 | @Override | 26 | @Override |
| 24 | public void saveConfig(MemberPointConfigSaveReqVO saveReqVO) { | 27 | public void saveConfig(MemberPointConfigSaveReqVO saveReqVO) { |
| 25 | - // TODO qingx:配置存在,则 update;不存在则 insert | 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 | @Override | 38 | @Override |
| 29 | public MemberPointConfigDO getConfig() { | 39 | public MemberPointConfigDO getConfig() { |
| 30 | - // TODO qingx:直接查询到一条; | ||
| 31 | - return null; | 40 | + List <MemberPointConfigDO> list = pointConfigMapper.selectList(); |
| 41 | + return list == null ? null : list.get(0); | ||
| 32 | } | 42 | } |
| 33 | } | 43 | } |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/pointrecord/PointRecordService.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/point/MemberPointRecordService.java
| 1 | -package cn.iocoder.yudao.module.point.service.pointrecord; | 1 | +package cn.iocoder.yudao.module.member.service.point; |
| 2 | 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; | 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.MemberPointRecordExportReqVO; | ||
| 6 | +import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordPageReqVO; | ||
| 7 | +import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordUpdateReqVO; | ||
| 8 | +import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointRecordDO; | ||
| 9 | + | ||
| 10 | +import javax.validation.Valid; | ||
| 11 | +import java.util.Collection; | ||
| 12 | +import java.util.List; | ||
| 8 | 13 | ||
| 9 | /** | 14 | /** |
| 10 | * 用户积分记录 Service 接口 | 15 | * 用户积分记录 Service 接口 |
| 11 | * | 16 | * |
| 12 | * @author QingX | 17 | * @author QingX |
| 13 | */ | 18 | */ |
| 14 | -public interface PointRecordService { | 19 | +public interface MemberPointRecordService { |
| 15 | 20 | ||
| 16 | - /** | ||
| 17 | - * 创建用户积分记录 | ||
| 18 | - * | ||
| 19 | - * @param createReqVO 创建信息 | ||
| 20 | - * @return 编号 | ||
| 21 | - */ | ||
| 22 | - Long createRecord(@Valid PointRecordCreateReqVO createReqVO); | ||
| 23 | 21 | ||
| 24 | /** | 22 | /** |
| 25 | * 更新用户积分记录 | 23 | * 更新用户积分记录 |
| 26 | * | 24 | * |
| 27 | * @param updateReqVO 更新信息 | 25 | * @param updateReqVO 更新信息 |
| 28 | */ | 26 | */ |
| 29 | - void updateRecord(@Valid PointRecordUpdateReqVO updateReqVO); | 27 | + void updateRecord(@Valid MemberPointRecordUpdateReqVO updateReqVO); |
| 28 | + | ||
| 30 | 29 | ||
| 31 | - /** | ||
| 32 | - * 删除用户积分记录 | ||
| 33 | - * | ||
| 34 | - * @param id 编号 | ||
| 35 | - */ | ||
| 36 | - void deleteRecord(Long id); | ||
| 37 | 30 | ||
| 38 | /** | 31 | /** |
| 39 | * 获得用户积分记录 | 32 | * 获得用户积分记录 |
| @@ -41,7 +34,7 @@ public interface PointRecordService { | @@ -41,7 +34,7 @@ public interface PointRecordService { | ||
| 41 | * @param id 编号 | 34 | * @param id 编号 |
| 42 | * @return 用户积分记录 | 35 | * @return 用户积分记录 |
| 43 | */ | 36 | */ |
| 44 | - PointRecordDO getRecord(Long id); | 37 | + MemberPointRecordDO getRecord(Long id); |
| 45 | 38 | ||
| 46 | /** | 39 | /** |
| 47 | * 获得用户积分记录列表 | 40 | * 获得用户积分记录列表 |
| @@ -49,7 +42,7 @@ public interface PointRecordService { | @@ -49,7 +42,7 @@ public interface PointRecordService { | ||
| 49 | * @param ids 编号 | 42 | * @param ids 编号 |
| 50 | * @return 用户积分记录列表 | 43 | * @return 用户积分记录列表 |
| 51 | */ | 44 | */ |
| 52 | - List<PointRecordDO> getRecordList(Collection<Long> ids); | 45 | + List<MemberPointRecordDO> getRecordList(Collection<Long> ids); |
| 53 | 46 | ||
| 54 | /** | 47 | /** |
| 55 | * 获得用户积分记录分页 | 48 | * 获得用户积分记录分页 |
| @@ -57,7 +50,7 @@ public interface PointRecordService { | @@ -57,7 +50,7 @@ public interface PointRecordService { | ||
| 57 | * @param pageReqVO 分页查询 | 50 | * @param pageReqVO 分页查询 |
| 58 | * @return 用户积分记录分页 | 51 | * @return 用户积分记录分页 |
| 59 | */ | 52 | */ |
| 60 | - PageResult<PointRecordDO> getRecordPage(PointRecordPageReqVO pageReqVO); | 53 | + PageResult<MemberPointRecordDO> getRecordPage(MemberPointRecordPageReqVO pageReqVO); |
| 61 | 54 | ||
| 62 | /** | 55 | /** |
| 63 | * 获得用户积分记录列表, 用于 Excel 导出 | 56 | * 获得用户积分记录列表, 用于 Excel 导出 |
| @@ -65,6 +58,6 @@ public interface PointRecordService { | @@ -65,6 +58,6 @@ public interface PointRecordService { | ||
| 65 | * @param exportReqVO 查询条件 | 58 | * @param exportReqVO 查询条件 |
| 66 | * @return 用户积分记录列表 | 59 | * @return 用户积分记录列表 |
| 67 | */ | 60 | */ |
| 68 | - List<PointRecordDO> getRecordList(PointRecordExportReqVO exportReqVO); | 61 | + List<MemberPointRecordDO> getRecordList(MemberPointRecordExportReqVO exportReqVO); |
| 69 | 62 | ||
| 70 | } | 63 | } |
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.MemberPointRecordCreateReqVO; | ||
| 5 | +import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordExportReqVO; | ||
| 6 | +import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordPageReqVO; | ||
| 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.dal.mysql.point.MemberPointRecordMapper; | ||
| 11 | +import cn.iocoder.yudao.module.member.enums.ErrorCodeConstants; | ||
| 3 | import org.springframework.stereotype.Service; | 12 | import org.springframework.stereotype.Service; |
| 4 | -import javax.annotation.Resource; | ||
| 5 | import org.springframework.validation.annotation.Validated; | 13 | import org.springframework.validation.annotation.Validated; |
| 6 | 14 | ||
| 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; | 15 | +import javax.annotation.Resource; |
| 16 | +import java.util.Collection; | ||
| 17 | +import java.util.List; | ||
| 14 | 18 | ||
| 15 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | 19 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 16 | -import static cn.iocoder.yudao.module.point.enums.ErrorCodeConstants.*; | 20 | + |
| 17 | 21 | ||
| 18 | /** | 22 | /** |
| 19 | * 用户积分记录 Service 实现类 | 23 | * 用户积分记录 Service 实现类 |
| @@ -22,60 +26,44 @@ import static cn.iocoder.yudao.module.point.enums.ErrorCodeConstants.*; | @@ -22,60 +26,44 @@ import static cn.iocoder.yudao.module.point.enums.ErrorCodeConstants.*; | ||
| 22 | */ | 26 | */ |
| 23 | @Service | 27 | @Service |
| 24 | @Validated | 28 | @Validated |
| 25 | -public class PointRecordServiceImpl implements PointRecordService { | 29 | +public class MemberPointRecordServiceImpl implements MemberPointRecordService { |
| 26 | 30 | ||
| 27 | @Resource | 31 | @Resource |
| 28 | - private PointRecordMapper recordMapper; | 32 | + private MemberPointRecordMapper recordMapper; |
| 29 | 33 | ||
| 30 | @Override | 34 | @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) { | 35 | + public void updateRecord(MemberPointRecordUpdateReqVO updateReqVO) { |
| 41 | // 校验存在 | 36 | // 校验存在 |
| 42 | validateRecordExists(updateReqVO.getId()); | 37 | validateRecordExists(updateReqVO.getId()); |
| 43 | // 更新 | 38 | // 更新 |
| 44 | - PointRecordDO updateObj = PointRecordConvert.INSTANCE.convert(updateReqVO); | 39 | + MemberPointRecordDO updateObj = MemberPointRecordConvert.INSTANCE.convert(updateReqVO); |
| 45 | recordMapper.updateById(updateObj); | 40 | recordMapper.updateById(updateObj); |
| 46 | } | 41 | } |
| 47 | 42 | ||
| 48 | - @Override | ||
| 49 | - public void deleteRecord(Long id) { | ||
| 50 | - // 校验存在 | ||
| 51 | - validateRecordExists(id); | ||
| 52 | - // 删除 | ||
| 53 | - recordMapper.deleteById(id); | ||
| 54 | - } | ||
| 55 | 43 | ||
| 56 | private void validateRecordExists(Long id) { | 44 | private void validateRecordExists(Long id) { |
| 57 | if (recordMapper.selectById(id) == null) { | 45 | if (recordMapper.selectById(id) == null) { |
| 58 | - throw exception(RECORD_NOT_EXISTS); | 46 | + throw exception(ErrorCodeConstants.RECORD_NOT_EXISTS); |
| 59 | } | 47 | } |
| 60 | } | 48 | } |
| 61 | 49 | ||
| 62 | @Override | 50 | @Override |
| 63 | - public PointRecordDO getRecord(Long id) { | 51 | + public MemberPointRecordDO getRecord(Long id) { |
| 64 | return recordMapper.selectById(id); | 52 | return recordMapper.selectById(id); |
| 65 | } | 53 | } |
| 66 | 54 | ||
| 67 | @Override | 55 | @Override |
| 68 | - public List<PointRecordDO> getRecordList(Collection<Long> ids) { | 56 | + public List<MemberPointRecordDO> getRecordList(Collection<Long> ids) { |
| 69 | return recordMapper.selectBatchIds(ids); | 57 | return recordMapper.selectBatchIds(ids); |
| 70 | } | 58 | } |
| 71 | 59 | ||
| 72 | @Override | 60 | @Override |
| 73 | - public PageResult<PointRecordDO> getRecordPage(PointRecordPageReqVO pageReqVO) { | 61 | + public PageResult<MemberPointRecordDO> getRecordPage(MemberPointRecordPageReqVO pageReqVO) { |
| 74 | return recordMapper.selectPage(pageReqVO); | 62 | return recordMapper.selectPage(pageReqVO); |
| 75 | } | 63 | } |
| 76 | 64 | ||
| 77 | @Override | 65 | @Override |
| 78 | - public List<PointRecordDO> getRecordList(PointRecordExportReqVO exportReqVO) { | 66 | + public List<MemberPointRecordDO> getRecordList(MemberPointRecordExportReqVO exportReqVO) { |
| 79 | return recordMapper.selectList(exportReqVO); | 67 | return recordMapper.selectList(exportReqVO); |
| 80 | } | 68 | } |
| 81 | 69 |
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.*; | 3 | import java.util.*; |
| 4 | import javax.validation.*; | 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; | 5 | + |
| 6 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigCreateReqVO; | ||
| 7 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigExportReqVO; | ||
| 8 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigPageReqVO; | ||
| 9 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInConfigUpdateReqVO; | ||
| 10 | +import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO; | ||
| 7 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 11 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 8 | 12 | ||
| 9 | /** | 13 | /** |
| @@ -11,7 +15,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; | @@ -11,7 +15,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 11 | * | 15 | * |
| 12 | * @author QingX | 16 | * @author QingX |
| 13 | */ | 17 | */ |
| 14 | -public interface SignInConfigService { | 18 | +public interface MemberSignInConfigService { |
| 15 | 19 | ||
| 16 | /** | 20 | /** |
| 17 | * 创建积分签到规则 | 21 | * 创建积分签到规则 |
| @@ -19,14 +23,14 @@ public interface SignInConfigService { | @@ -19,14 +23,14 @@ public interface SignInConfigService { | ||
| 19 | * @param createReqVO 创建信息 | 23 | * @param createReqVO 创建信息 |
| 20 | * @return 编号 | 24 | * @return 编号 |
| 21 | */ | 25 | */ |
| 22 | - Integer createSignInConfig(@Valid SignInConfigCreateReqVO createReqVO); | 26 | + Integer createSignInConfig(@Valid MemberSignInConfigCreateReqVO createReqVO); |
| 23 | 27 | ||
| 24 | /** | 28 | /** |
| 25 | * 更新积分签到规则 | 29 | * 更新积分签到规则 |
| 26 | * | 30 | * |
| 27 | * @param updateReqVO 更新信息 | 31 | * @param updateReqVO 更新信息 |
| 28 | */ | 32 | */ |
| 29 | - void updateSignInConfig(@Valid SignInConfigUpdateReqVO updateReqVO); | 33 | + void updateSignInConfig(@Valid MemberSignInConfigUpdateReqVO updateReqVO); |
| 30 | 34 | ||
| 31 | /** | 35 | /** |
| 32 | * 删除积分签到规则 | 36 | * 删除积分签到规则 |
| @@ -41,7 +45,7 @@ public interface SignInConfigService { | @@ -41,7 +45,7 @@ public interface SignInConfigService { | ||
| 41 | * @param id 编号 | 45 | * @param id 编号 |
| 42 | * @return 积分签到规则 | 46 | * @return 积分签到规则 |
| 43 | */ | 47 | */ |
| 44 | - SignInConfigDO getSignInConfig(Integer id); | 48 | + MemberSignInConfigDO getSignInConfig(Integer id); |
| 45 | 49 | ||
| 46 | /** | 50 | /** |
| 47 | * 获得积分签到规则列表 | 51 | * 获得积分签到规则列表 |
| @@ -49,7 +53,7 @@ public interface SignInConfigService { | @@ -49,7 +53,7 @@ public interface SignInConfigService { | ||
| 49 | * @param ids 编号 | 53 | * @param ids 编号 |
| 50 | * @return 积分签到规则列表 | 54 | * @return 积分签到规则列表 |
| 51 | */ | 55 | */ |
| 52 | - List<SignInConfigDO> getSignInConfigList(Collection<Integer> ids); | 56 | + List<MemberSignInConfigDO> getSignInConfigList(Collection<Integer> ids); |
| 53 | 57 | ||
| 54 | /** | 58 | /** |
| 55 | * 获得积分签到规则分页 | 59 | * 获得积分签到规则分页 |
| @@ -57,7 +61,7 @@ public interface SignInConfigService { | @@ -57,7 +61,7 @@ public interface SignInConfigService { | ||
| 57 | * @param pageReqVO 分页查询 | 61 | * @param pageReqVO 分页查询 |
| 58 | * @return 积分签到规则分页 | 62 | * @return 积分签到规则分页 |
| 59 | */ | 63 | */ |
| 60 | - PageResult<SignInConfigDO> getSignInConfigPage(SignInConfigPageReqVO pageReqVO); | 64 | + PageResult<MemberSignInConfigDO> getSignInConfigPage(MemberSignInConfigPageReqVO pageReqVO); |
| 61 | 65 | ||
| 62 | /** | 66 | /** |
| 63 | * 获得积分签到规则列表, 用于 Excel 导出 | 67 | * 获得积分签到规则列表, 用于 Excel 导出 |
| @@ -65,6 +69,6 @@ public interface SignInConfigService { | @@ -65,6 +69,6 @@ public interface SignInConfigService { | ||
| 65 | * @param exportReqVO 查询条件 | 69 | * @param exportReqVO 查询条件 |
| 66 | * @return 积分签到规则列表 | 70 | * @return 积分签到规则列表 |
| 67 | */ | 71 | */ |
| 68 | - List<SignInConfigDO> getSignInConfigList(SignInConfigExportReqVO exportReqVO); | 72 | + List<MemberSignInConfigDO> getSignInConfigList(MemberSignInConfigExportReqVO exportReqVO); |
| 69 | 73 | ||
| 70 | } | 74 | } |
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.module.member.service.signin.MemberSignInConfigService; | ||
| 3 | import org.springframework.stereotype.Service; | 4 | import org.springframework.stereotype.Service; |
| 4 | import javax.annotation.Resource; | 5 | import javax.annotation.Resource; |
| 5 | import org.springframework.validation.annotation.Validated; | 6 | import org.springframework.validation.annotation.Validated; |
| 6 | 7 | ||
| 7 | import java.util.*; | 8 | 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; | 9 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.*; |
| 10 | +import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO; | ||
| 10 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 11 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 11 | 12 | ||
| 12 | -import cn.iocoder.yudao.module.point.convert.signinconfig.SignInConfigConvert; | ||
| 13 | -import cn.iocoder.yudao.module.point.dal.mysql.signinconfig.SignInConfigMapper; | 13 | +import cn.iocoder.yudao.module.member.convert.signin.MemberSignInConfigConvert; |
| 14 | +import cn.iocoder.yudao.module.member.dal.mysql.signin.MemberSignInConfigMapper; | ||
| 14 | 15 | ||
| 15 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | 16 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 16 | -import static cn.iocoder.yudao.module.point.enums.ErrorCodeConstants.*; | 17 | +import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*; |
| 17 | 18 | ||
| 18 | /** | 19 | /** |
| 19 | * 积分签到规则 Service 实现类 | 20 | * 积分签到规则 Service 实现类 |
| @@ -22,33 +23,33 @@ import static cn.iocoder.yudao.module.point.enums.ErrorCodeConstants.*; | @@ -22,33 +23,33 @@ import static cn.iocoder.yudao.module.point.enums.ErrorCodeConstants.*; | ||
| 22 | */ | 23 | */ |
| 23 | @Service | 24 | @Service |
| 24 | @Validated | 25 | @Validated |
| 25 | -public class SignInConfigServiceImpl implements SignInConfigService { | 26 | +public class MemberSignInConfigServiceImpl implements MemberSignInConfigService { |
| 26 | 27 | ||
| 27 | @Resource | 28 | @Resource |
| 28 | - private SignInConfigMapper signInConfigMapper; | 29 | + private MemberSignInConfigMapper memberSignInConfigMapper; |
| 29 | 30 | ||
| 30 | @Override | 31 | @Override |
| 31 | - public Integer createSignInConfig(SignInConfigCreateReqVO createReqVO) { | 32 | + public Integer createSignInConfig(MemberSignInConfigCreateReqVO createReqVO) { |
| 32 | // 插入 | 33 | // 插入 |
| 33 | - SignInConfigDO signInConfig = SignInConfigConvert.INSTANCE.convert(createReqVO); | 34 | + MemberSignInConfigDO signInConfig = MemberSignInConfigConvert.INSTANCE.convert(createReqVO); |
| 34 | //判断是否重复插入签到天数 | 35 | //判断是否重复插入签到天数 |
| 35 | validateSignInConfigExistsDay(signInConfig.getDay()); | 36 | validateSignInConfigExistsDay(signInConfig.getDay()); |
| 36 | - signInConfigMapper.insert(signInConfig); | 37 | + memberSignInConfigMapper.insert(signInConfig); |
| 37 | // 返回 | 38 | // 返回 |
| 38 | return signInConfig.getId(); | 39 | return signInConfig.getId(); |
| 39 | } | 40 | } |
| 40 | 41 | ||
| 41 | @Override | 42 | @Override |
| 42 | - public void updateSignInConfig(SignInConfigUpdateReqVO updateReqVO) { | 43 | + public void updateSignInConfig(MemberSignInConfigUpdateReqVO updateReqVO) { |
| 43 | // 校验存在 | 44 | // 校验存在 |
| 44 | validateSignInConfigExists(updateReqVO.getId()); | 45 | validateSignInConfigExists(updateReqVO.getId()); |
| 45 | //判断是否重复插入签到天数 | 46 | //判断是否重复插入签到天数 |
| 46 | validateSignInConfigSameDayNotSelf(updateReqVO); | 47 | validateSignInConfigSameDayNotSelf(updateReqVO); |
| 47 | // 判断更新的 | 48 | // 判断更新的 |
| 48 | - SignInConfigDO updateObj = SignInConfigConvert.INSTANCE.convert(updateReqVO); | 49 | + MemberSignInConfigDO updateObj = MemberSignInConfigConvert.INSTANCE.convert(updateReqVO); |
| 49 | 50 | ||
| 50 | 51 | ||
| 51 | - signInConfigMapper.updateById(updateObj); | 52 | + memberSignInConfigMapper.updateById(updateObj); |
| 52 | } | 53 | } |
| 53 | 54 | ||
| 54 | @Override | 55 | @Override |
| @@ -56,47 +57,47 @@ public class SignInConfigServiceImpl implements SignInConfigService { | @@ -56,47 +57,47 @@ public class SignInConfigServiceImpl implements SignInConfigService { | ||
| 56 | // 校验存在 | 57 | // 校验存在 |
| 57 | validateSignInConfigExists(id); | 58 | validateSignInConfigExists(id); |
| 58 | // 删除 | 59 | // 删除 |
| 59 | - signInConfigMapper.deleteById(id); | 60 | + memberSignInConfigMapper.deleteById(id); |
| 60 | } | 61 | } |
| 61 | 62 | ||
| 62 | private void validateSignInConfigExists(Integer id) { | 63 | private void validateSignInConfigExists(Integer id) { |
| 63 | - if (signInConfigMapper.selectById(id) == null) { | 64 | + if (memberSignInConfigMapper.selectById(id) == null) { |
| 64 | throw exception(SIGN_IN_CONFIG_NOT_EXISTS); | 65 | throw exception(SIGN_IN_CONFIG_NOT_EXISTS); |
| 65 | } | 66 | } |
| 66 | } | 67 | } |
| 67 | //根据签到天数判断是否存在一个相同的天数 | 68 | //根据签到天数判断是否存在一个相同的天数 |
| 68 | private void validateSignInConfigExistsDay(Integer day) { | 69 | private void validateSignInConfigExistsDay(Integer day) { |
| 69 | - if (signInConfigMapper.selectCount(SignInConfigDO::getDay,day)>0) { | 70 | + if (memberSignInConfigMapper.selectCount(MemberSignInConfigDO::getDay,day)>0) { |
| 70 | throw exception(SIGN_IN_CONFIG_EXISTS); | 71 | throw exception(SIGN_IN_CONFIG_EXISTS); |
| 71 | } | 72 | } |
| 72 | } | 73 | } |
| 73 | 74 | ||
| 74 | //更新天数时判断是否有重复的天数,需要去除自己 | 75 | //更新天数时判断是否有重复的天数,需要去除自己 |
| 75 | - private void validateSignInConfigSameDayNotSelf(SignInConfigUpdateReqVO reqVO) { | ||
| 76 | - if (signInConfigMapper.selectSameDayNotSelf(reqVO)>0) { | 76 | + private void validateSignInConfigSameDayNotSelf(MemberSignInConfigUpdateReqVO reqVO) { |
| 77 | + if (memberSignInConfigMapper.selectSameDayNotSelf(reqVO)>0) { | ||
| 77 | throw exception(SIGN_IN_CONFIG_EXISTS); | 78 | throw exception(SIGN_IN_CONFIG_EXISTS); |
| 78 | } | 79 | } |
| 79 | } | 80 | } |
| 80 | 81 | ||
| 81 | 82 | ||
| 82 | @Override | 83 | @Override |
| 83 | - public SignInConfigDO getSignInConfig(Integer id) { | ||
| 84 | - return signInConfigMapper.selectById(id); | 84 | + public MemberSignInConfigDO getSignInConfig(Integer id) { |
| 85 | + return memberSignInConfigMapper.selectById(id); | ||
| 85 | } | 86 | } |
| 86 | 87 | ||
| 87 | @Override | 88 | @Override |
| 88 | - public List<SignInConfigDO> getSignInConfigList(Collection<Integer> ids) { | ||
| 89 | - return signInConfigMapper.selectBatchIds(ids); | 89 | + public List<MemberSignInConfigDO> getSignInConfigList(Collection<Integer> ids) { |
| 90 | + return memberSignInConfigMapper.selectBatchIds(ids); | ||
| 90 | } | 91 | } |
| 91 | 92 | ||
| 92 | @Override | 93 | @Override |
| 93 | - public PageResult<SignInConfigDO> getSignInConfigPage(SignInConfigPageReqVO pageReqVO) { | ||
| 94 | - return signInConfigMapper.selectPage(pageReqVO); | 94 | + public PageResult<MemberSignInConfigDO> getSignInConfigPage(MemberSignInConfigPageReqVO pageReqVO) { |
| 95 | + return memberSignInConfigMapper.selectPage(pageReqVO); | ||
| 95 | } | 96 | } |
| 96 | 97 | ||
| 97 | @Override | 98 | @Override |
| 98 | - public List<SignInConfigDO> getSignInConfigList(SignInConfigExportReqVO exportReqVO) { | ||
| 99 | - return signInConfigMapper.selectList(exportReqVO); | 99 | + public List<MemberSignInConfigDO> getSignInConfigList(MemberSignInConfigExportReqVO exportReqVO) { |
| 100 | + return memberSignInConfigMapper.selectList(exportReqVO); | ||
| 100 | } | 101 | } |
| 101 | 102 | ||
| 102 | } | 103 | } |
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.*; | 3 | import java.util.*; |
| 4 | import javax.validation.*; | 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; | 5 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.*; |
| 6 | +import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO; | ||
| 7 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 7 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 8 | 8 | ||
| 9 | /** | 9 | /** |
| @@ -11,22 +11,9 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; | @@ -11,22 +11,9 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 11 | * | 11 | * |
| 12 | * @author 芋道源码 | 12 | * @author 芋道源码 |
| 13 | */ | 13 | */ |
| 14 | -public interface SignInRecordService { | 14 | +public interface MemberSignInRecordService { |
| 15 | 15 | ||
| 16 | - /** | ||
| 17 | - * 创建用户签到积分 | ||
| 18 | - * | ||
| 19 | - * @param createReqVO 创建信息 | ||
| 20 | - * @return 编号 | ||
| 21 | - */ | ||
| 22 | - Long createSignInRecord(@Valid SignInRecordCreateReqVO createReqVO); | ||
| 23 | 16 | ||
| 24 | - /** | ||
| 25 | - * 更新用户签到积分 | ||
| 26 | - * | ||
| 27 | - * @param updateReqVO 更新信息 | ||
| 28 | - */ | ||
| 29 | - void updateSignInRecord(@Valid SignInRecordUpdateReqVO updateReqVO); | ||
| 30 | 17 | ||
| 31 | /** | 18 | /** |
| 32 | * 删除用户签到积分 | 19 | * 删除用户签到积分 |
| @@ -41,7 +28,7 @@ public interface SignInRecordService { | @@ -41,7 +28,7 @@ public interface SignInRecordService { | ||
| 41 | * @param id 编号 | 28 | * @param id 编号 |
| 42 | * @return 用户签到积分 | 29 | * @return 用户签到积分 |
| 43 | */ | 30 | */ |
| 44 | - SignInRecordDO getSignInRecord(Long id); | 31 | + MemberSignInRecordDO getSignInRecord(Long id); |
| 45 | 32 | ||
| 46 | /** | 33 | /** |
| 47 | * 获得用户签到积分列表 | 34 | * 获得用户签到积分列表 |
| @@ -49,7 +36,7 @@ public interface SignInRecordService { | @@ -49,7 +36,7 @@ public interface SignInRecordService { | ||
| 49 | * @param ids 编号 | 36 | * @param ids 编号 |
| 50 | * @return 用户签到积分列表 | 37 | * @return 用户签到积分列表 |
| 51 | */ | 38 | */ |
| 52 | - List<SignInRecordDO> getSignInRecordList(Collection<Long> ids); | 39 | + List<MemberSignInRecordDO> getSignInRecordList(Collection<Long> ids); |
| 53 | 40 | ||
| 54 | /** | 41 | /** |
| 55 | * 获得用户签到积分分页 | 42 | * 获得用户签到积分分页 |
| @@ -57,7 +44,7 @@ public interface SignInRecordService { | @@ -57,7 +44,7 @@ public interface SignInRecordService { | ||
| 57 | * @param pageReqVO 分页查询 | 44 | * @param pageReqVO 分页查询 |
| 58 | * @return 用户签到积分分页 | 45 | * @return 用户签到积分分页 |
| 59 | */ | 46 | */ |
| 60 | - PageResult<SignInRecordDO> getSignInRecordPage(SignInRecordPageReqVO pageReqVO); | 47 | + PageResult<MemberSignInRecordDO> getSignInRecordPage(MemberSignInRecordPageReqVO pageReqVO); |
| 61 | 48 | ||
| 62 | /** | 49 | /** |
| 63 | * 获得用户签到积分列表, 用于 Excel 导出 | 50 | * 获得用户签到积分列表, 用于 Excel 导出 |
| @@ -65,6 +52,6 @@ public interface SignInRecordService { | @@ -65,6 +52,6 @@ public interface SignInRecordService { | ||
| 65 | * @param exportReqVO 查询条件 | 52 | * @param exportReqVO 查询条件 |
| 66 | * @return 用户签到积分列表 | 53 | * @return 用户签到积分列表 |
| 67 | */ | 54 | */ |
| 68 | - List<SignInRecordDO> getSignInRecordList(SignInRecordExportReqVO exportReqVO); | 55 | + List<MemberSignInRecordDO> getSignInRecordList(MemberSignInRecordExportReqVO exportReqVO); |
| 69 | 56 | ||
| 70 | } | 57 | } |
yudao-module-point/yudao-module-point-biz/src/main/java/cn/iocoder/yudao/module/point/service/signinrecord/SignInRecordServiceImpl.java renamed to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/signin/MemberSignInRecordServiceImpl.java
| 1 | -package cn.iocoder.yudao.module.point.service.signinrecord; | 1 | +package cn.iocoder.yudao.module.member.service.signin; |
| 2 | 2 | ||
| 3 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordCreateReqVO; | ||
| 4 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordExportReqVO; | ||
| 5 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordPageReqVO; | ||
| 6 | +import cn.iocoder.yudao.module.member.controller.admin.signin.vo.MemberSignInRecordUpdateReqVO; | ||
| 7 | +import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO; | ||
| 3 | import org.springframework.stereotype.Service; | 8 | import org.springframework.stereotype.Service; |
| 4 | import javax.annotation.Resource; | 9 | import javax.annotation.Resource; |
| 5 | import org.springframework.validation.annotation.Validated; | 10 | import org.springframework.validation.annotation.Validated; |
| 6 | 11 | ||
| 7 | import java.util.*; | 12 | 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; | 13 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 11 | 14 | ||
| 12 | -import cn.iocoder.yudao.module.point.convert.signinrecord.SignInRecordConvert; | ||
| 13 | -import cn.iocoder.yudao.module.point.dal.mysql.signinrecord.SignInRecordMapper; | 15 | +import cn.iocoder.yudao.module.member.convert.signin.MemberSignInRecordConvert; |
| 16 | +import cn.iocoder.yudao.module.member.dal.mysql.signin.MemberSignInRecordMapper; | ||
| 14 | 17 | ||
| 15 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | 18 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 16 | -import static cn.iocoder.yudao.module.point.enums.ErrorCodeConstants.*; | 19 | +import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*; |
| 17 | 20 | ||
| 18 | /** | 21 | /** |
| 19 | * 用户签到积分 Service 实现类 | 22 | * 用户签到积分 Service 实现类 |
| @@ -22,61 +25,43 @@ import static cn.iocoder.yudao.module.point.enums.ErrorCodeConstants.*; | @@ -22,61 +25,43 @@ import static cn.iocoder.yudao.module.point.enums.ErrorCodeConstants.*; | ||
| 22 | */ | 25 | */ |
| 23 | @Service | 26 | @Service |
| 24 | @Validated | 27 | @Validated |
| 25 | -public class SignInRecordServiceImpl implements SignInRecordService { | 28 | +public class MemberSignInRecordServiceImpl implements MemberSignInRecordService { |
| 26 | 29 | ||
| 27 | @Resource | 30 | @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 | - } | 31 | + private MemberSignInRecordMapper memberSignInRecordMapper; |
| 47 | 32 | ||
| 48 | @Override | 33 | @Override |
| 49 | public void deleteSignInRecord(Long id) { | 34 | public void deleteSignInRecord(Long id) { |
| 50 | // 校验存在 | 35 | // 校验存在 |
| 51 | validateSignInRecordExists(id); | 36 | validateSignInRecordExists(id); |
| 52 | // 删除 | 37 | // 删除 |
| 53 | - signInRecordMapper.deleteById(id); | 38 | + memberSignInRecordMapper.deleteById(id); |
| 54 | } | 39 | } |
| 55 | 40 | ||
| 56 | private void validateSignInRecordExists(Long id) { | 41 | private void validateSignInRecordExists(Long id) { |
| 57 | - if (signInRecordMapper.selectById(id) == null) { | 42 | + if (memberSignInRecordMapper.selectById(id) == null) { |
| 58 | throw exception(SIGN_IN_RECORD_NOT_EXISTS); | 43 | throw exception(SIGN_IN_RECORD_NOT_EXISTS); |
| 59 | } | 44 | } |
| 60 | } | 45 | } |
| 61 | 46 | ||
| 62 | @Override | 47 | @Override |
| 63 | - public SignInRecordDO getSignInRecord(Long id) { | ||
| 64 | - return signInRecordMapper.selectById(id); | 48 | + public MemberSignInRecordDO getSignInRecord(Long id) { |
| 49 | + return memberSignInRecordMapper.selectById(id); | ||
| 65 | } | 50 | } |
| 66 | 51 | ||
| 67 | @Override | 52 | @Override |
| 68 | - public List<SignInRecordDO> getSignInRecordList(Collection<Long> ids) { | ||
| 69 | - return signInRecordMapper.selectBatchIds(ids); | 53 | + public List<MemberSignInRecordDO> getSignInRecordList(Collection<Long> ids) { |
| 54 | + return memberSignInRecordMapper.selectBatchIds(ids); | ||
| 70 | } | 55 | } |
| 71 | 56 | ||
| 72 | @Override | 57 | @Override |
| 73 | - public PageResult<SignInRecordDO> getSignInRecordPage(SignInRecordPageReqVO pageReqVO) { | ||
| 74 | - return signInRecordMapper.selectPage(pageReqVO); | 58 | + public PageResult<MemberSignInRecordDO> getSignInRecordPage(MemberSignInRecordPageReqVO pageReqVO) { |
| 59 | + return memberSignInRecordMapper.selectPage(pageReqVO); | ||
| 75 | } | 60 | } |
| 76 | 61 | ||
| 77 | @Override | 62 | @Override |
| 78 | - public List<SignInRecordDO> getSignInRecordList(SignInRecordExportReqVO exportReqVO) { | ||
| 79 | - return signInRecordMapper.selectList(exportReqVO); | 63 | + public List<MemberSignInRecordDO> getSignInRecordList(MemberSignInRecordExportReqVO exportReqVO) { |
| 64 | + return memberSignInRecordMapper.selectList(exportReqVO); | ||
| 80 | } | 65 | } |
| 81 | 66 | ||
| 82 | } | 67 | } |
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 | \ No newline at end of file | 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 | \ No newline at end of file | 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 | \ No newline at end of file | 0 | \ No newline at end of file |
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/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 | -} |