From ca51056c00c238d6b0a9e164c1c1493278c4e803 Mon Sep 17 00:00:00 2001 From: owen Date: Tue, 22 Aug 2023 20:49:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E5=91=98:=20=E7=BB=9F=E4=B8=80?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AD=89=E7=BA=A7=E8=AE=B0=E5=BD=95=E3=80=81?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=BB=8F=E9=AA=8C=E8=AE=B0=E5=BD=95=20?= =?UTF-8?q?=E5=91=BD=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sql/mysql/member_level.sql | 10 +++--- ... => MemberExperienceRecordController.java} | 33 +++++++++---------- ....java => MemberLevelRecordController.java} | 33 +++++++++---------- ...java => MemberExperienceRecordBaseVO.java} | 2 +- ...a => MemberExperienceRecordPageReqVO.java} | 2 +- ...java => MemberExperienceRecordRespVO.java} | 2 +- ...seVO.java => MemberLevelRecordBaseVO.java} | 2 +- ...O.java => MemberLevelRecordPageReqVO.java} | 2 +- ...spVO.java => MemberLevelRecordRespVO.java} | 2 +- .../level/MemberExperienceLogConvert.java | 27 --------------- .../level/MemberExperienceRecordConvert.java | 27 +++++++++++++++ .../convert/level/MemberLevelLogConvert.java | 27 --------------- .../level/MemberLevelRecordConvert.java | 27 +++++++++++++++ ...gDO.java => MemberExperienceRecordDO.java} | 6 ++-- ...velLogDO.java => MemberLevelRecordDO.java} | 6 ++-- .../level/MemberExperienceLogMapper.java | 28 ---------------- .../level/MemberExperienceRecordMapper.java | 28 ++++++++++++++++ ...pper.java => MemberLevelRecordMapper.java} | 18 +++++----- ...ava => MemberExperienceRecordService.java} | 12 +++---- ...=> MemberExperienceRecordServiceImpl.java} | 18 +++++----- ...ice.java => MemberLevelRecordService.java} | 12 +++---- ...java => MemberLevelRecordServiceImpl.java} | 24 +++++++------- .../service/level/MemberLevelServiceImpl.java | 14 ++++---- .../level/MemberLevelServiceImplTest.java | 4 +-- 24 files changed, 182 insertions(+), 184 deletions(-) rename yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/{MemberExperienceLogController.java => MemberExperienceRecordController.java} (58%) rename yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/{MemberLevelLogController.java => MemberLevelRecordController.java} (54%) rename yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/experience/{MemberExperienceLogBaseVO.java => MemberExperienceRecordBaseVO.java} (97%) rename yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/experience/{MemberExperienceLogPageReqVO.java => MemberExperienceRecordPageReqVO.java} (94%) rename yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/experience/{MemberExperienceLogRespVO.java => MemberExperienceRecordRespVO.java} (88%) rename yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/log/{MemberLevelLogBaseVO.java => MemberLevelRecordBaseVO.java} (97%) rename yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/log/{MemberLevelLogPageReqVO.java => MemberLevelRecordPageReqVO.java} (94%) rename yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/log/{MemberLevelLogRespVO.java => MemberLevelRecordRespVO.java} (89%) delete mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/level/MemberExperienceLogConvert.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/level/MemberExperienceRecordConvert.java delete mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/level/MemberLevelLogConvert.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/level/MemberLevelRecordConvert.java rename yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/level/{MemberExperienceLogDO.java => MemberExperienceRecordDO.java} (81%) rename yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/level/{MemberLevelLogDO.java => MemberLevelRecordDO.java} (82%) delete mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/level/MemberExperienceLogMapper.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/level/MemberExperienceRecordMapper.java rename yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/level/{MemberLevelLogMapper.java => MemberLevelRecordMapper.java} (50%) rename yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/{MemberExperienceLogService.java => MemberExperienceRecordService.java} (81%) rename yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/{MemberExperienceLogServiceImpl.java => MemberExperienceRecordServiceImpl.java} (76%) rename yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/{MemberLevelLogService.java => MemberLevelRecordService.java} (84%) rename yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/{MemberLevelLogServiceImpl.java => MemberLevelRecordServiceImpl.java} (81%) diff --git a/sql/mysql/member_level.sql b/sql/mysql/member_level.sql index dfab05eb9..50008e990 100644 --- a/sql/mysql/member_level.sql +++ b/sql/mysql/member_level.sql @@ -22,7 +22,7 @@ create table member_level ) comment '会员等级'; -create table member_level_log +create table member_level_record ( id bigint auto_increment comment '编号' primary key, user_id bigint default 0 not null comment '用户编号', @@ -42,9 +42,9 @@ create table member_level_log ) comment '会员等级记录'; -create index idx_user_id on member_level_log (user_id) comment '会员等级记录-用户编号'; +create index idx_user_id on member_level_record (user_id) comment '会员等级记录-用户编号'; -create table member_experience_log +create table member_experience_record ( id bigint auto_increment comment '编号' primary key, user_id bigint default 0 not null comment '用户编号', @@ -63,8 +63,8 @@ create table member_experience_log ) comment '会员经验记录'; -create index idx_user_id on member_experience_log (user_id) comment '会员经验记录-用户编号'; -create index idx_user_biz_type on member_experience_log (user_id, biz_type) comment '会员经验记录-用户业务类型'; +create index idx_user_id on member_experience_record (user_id) comment '会员经验记录-用户编号'; +create index idx_user_biz_type on member_experience_record (user_id, biz_type) comment '会员经验记录-用户业务类型'; -- 增加字典 insert system_dict_type(name, type) values ('会员经验业务类型', 'member_experience_biz_type'); diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/MemberExperienceLogController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/MemberExperienceRecordController.java similarity index 58% rename from yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/MemberExperienceLogController.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/MemberExperienceRecordController.java index 3bc63004d..81c61df42 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/MemberExperienceLogController.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/MemberExperienceRecordController.java @@ -2,11 +2,11 @@ package cn.iocoder.yudao.module.member.controller.admin.level; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.module.member.controller.admin.level.vo.experience.MemberExperienceLogPageReqVO; -import cn.iocoder.yudao.module.member.controller.admin.level.vo.experience.MemberExperienceLogRespVO; -import cn.iocoder.yudao.module.member.convert.level.MemberExperienceLogConvert; -import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberExperienceLogDO; -import cn.iocoder.yudao.module.member.service.level.MemberExperienceLogService; +import cn.iocoder.yudao.module.member.controller.admin.level.vo.experience.MemberExperienceRecordPageReqVO; +import cn.iocoder.yudao.module.member.controller.admin.level.vo.experience.MemberExperienceRecordRespVO; +import cn.iocoder.yudao.module.member.convert.level.MemberExperienceRecordConvert; +import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberExperienceRecordDO; +import cn.iocoder.yudao.module.member.service.level.MemberExperienceRecordService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -22,31 +22,30 @@ import javax.validation.Valid; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -// TODO @疯狂:要不 Log 改成 Record,和 PointRecord 保持一致 @Tag(name = "管理后台 - 会员经验记录") @RestController -@RequestMapping("/member/experience-log") +@RequestMapping("/member/experience-record") @Validated -public class MemberExperienceLogController { +public class MemberExperienceRecordController { @Resource - private MemberExperienceLogService experienceLogService; + private MemberExperienceRecordService experienceLogService; @GetMapping("/get") @Operation(summary = "获得会员经验记录") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('member:experience-log:query')") - public CommonResult getExperienceLog(@RequestParam("id") Long id) { - MemberExperienceLogDO experienceLog = experienceLogService.getExperienceLog(id); - return success(MemberExperienceLogConvert.INSTANCE.convert(experienceLog)); + @PreAuthorize("@ss.hasPermission('member:experience-record:query')") + public CommonResult getExperienceLog(@RequestParam("id") Long id) { + MemberExperienceRecordDO experienceLog = experienceLogService.getExperienceLog(id); + return success(MemberExperienceRecordConvert.INSTANCE.convert(experienceLog)); } @GetMapping("/page") @Operation(summary = "获得会员经验记录分页") - @PreAuthorize("@ss.hasPermission('member:experience-log:query')") - public CommonResult> getExperienceLogPage(@Valid MemberExperienceLogPageReqVO pageVO) { - PageResult pageResult = experienceLogService.getExperienceLogPage(pageVO); - return success(MemberExperienceLogConvert.INSTANCE.convertPage(pageResult)); + @PreAuthorize("@ss.hasPermission('member:experience-record:query')") + public CommonResult> getExperienceLogPage(@Valid MemberExperienceRecordPageReqVO pageVO) { + PageResult pageResult = experienceLogService.getExperienceLogPage(pageVO); + return success(MemberExperienceRecordConvert.INSTANCE.convertPage(pageResult)); } } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/MemberLevelLogController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/MemberLevelRecordController.java similarity index 54% rename from yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/MemberLevelLogController.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/MemberLevelRecordController.java index c4eb1497f..d81bf4893 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/MemberLevelLogController.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/MemberLevelRecordController.java @@ -2,11 +2,11 @@ package cn.iocoder.yudao.module.member.controller.admin.level; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.module.member.controller.admin.level.vo.log.MemberLevelLogPageReqVO; -import cn.iocoder.yudao.module.member.controller.admin.level.vo.log.MemberLevelLogRespVO; -import cn.iocoder.yudao.module.member.convert.level.MemberLevelLogConvert; -import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelLogDO; -import cn.iocoder.yudao.module.member.service.level.MemberLevelLogService; +import cn.iocoder.yudao.module.member.controller.admin.level.vo.log.MemberLevelRecordPageReqVO; +import cn.iocoder.yudao.module.member.controller.admin.level.vo.log.MemberLevelRecordRespVO; +import cn.iocoder.yudao.module.member.convert.level.MemberLevelRecordConvert; +import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelRecordDO; +import cn.iocoder.yudao.module.member.service.level.MemberLevelRecordService; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.tags.Tag; @@ -22,30 +22,29 @@ import javax.validation.Valid; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; -// TODO @疯狂:是不是不用这个 controller;因为日志只是为了记录,db 可以查询、和审计即可,目前暂时不需要开放出来; @Tag(name = "管理后台 - 会员等级记录") @RestController -@RequestMapping("/member/level-log") +@RequestMapping("/member/level-record") @Validated -public class MemberLevelLogController { +public class MemberLevelRecordController { @Resource - private MemberLevelLogService levelLogService; + private MemberLevelRecordService levelLogService; @GetMapping("/get") @Operation(summary = "获得会员等级记录") @Parameter(name = "id", description = "编号", required = true, example = "1024") - @PreAuthorize("@ss.hasPermission('member:level-log:query')") - public CommonResult getLevelLog(@RequestParam("id") Long id) { - MemberLevelLogDO levelLog = levelLogService.getLevelLog(id); - return success(MemberLevelLogConvert.INSTANCE.convert(levelLog)); + @PreAuthorize("@ss.hasPermission('member:level-record:query')") + public CommonResult getLevelLog(@RequestParam("id") Long id) { + MemberLevelRecordDO levelLog = levelLogService.getLevelLog(id); + return success(MemberLevelRecordConvert.INSTANCE.convert(levelLog)); } @GetMapping("/page") @Operation(summary = "获得会员等级记录分页") - @PreAuthorize("@ss.hasPermission('member:level-log:query')") - public CommonResult> getLevelLogPage(@Valid MemberLevelLogPageReqVO pageVO) { - PageResult pageResult = levelLogService.getLevelLogPage(pageVO); - return success(MemberLevelLogConvert.INSTANCE.convertPage(pageResult)); + @PreAuthorize("@ss.hasPermission('member:level-record:query')") + public CommonResult> getLevelLogPage(@Valid MemberLevelRecordPageReqVO pageVO) { + PageResult pageResult = levelLogService.getLevelLogPage(pageVO); + return success(MemberLevelRecordConvert.INSTANCE.convertPage(pageResult)); } } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/experience/MemberExperienceLogBaseVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/experience/MemberExperienceRecordBaseVO.java similarity index 97% rename from yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/experience/MemberExperienceLogBaseVO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/experience/MemberExperienceRecordBaseVO.java index b7906a672..7c71f8270 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/experience/MemberExperienceLogBaseVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/experience/MemberExperienceRecordBaseVO.java @@ -10,7 +10,7 @@ import javax.validation.constraints.NotNull; * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 */ @Data -public class MemberExperienceLogBaseVO { +public class MemberExperienceRecordBaseVO { @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "3638") @NotNull(message = "用户编号不能为空") diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/experience/MemberExperienceLogPageReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/experience/MemberExperienceRecordPageReqVO.java similarity index 94% rename from yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/experience/MemberExperienceLogPageReqVO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/experience/MemberExperienceRecordPageReqVO.java index a92dcda11..d18201d7c 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/experience/MemberExperienceLogPageReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/experience/MemberExperienceRecordPageReqVO.java @@ -15,7 +15,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) -public class MemberExperienceLogPageReqVO extends PageParam { +public class MemberExperienceRecordPageReqVO extends PageParam { @Schema(description = "用户编号", example = "3638") private Long userId; diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/experience/MemberExperienceLogRespVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/experience/MemberExperienceRecordRespVO.java similarity index 88% rename from yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/experience/MemberExperienceLogRespVO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/experience/MemberExperienceRecordRespVO.java index fb3779d1e..5e652fcf0 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/experience/MemberExperienceLogRespVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/experience/MemberExperienceRecordRespVO.java @@ -11,7 +11,7 @@ import java.time.LocalDateTime; @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) -public class MemberExperienceLogRespVO extends MemberExperienceLogBaseVO { +public class MemberExperienceRecordRespVO extends MemberExperienceRecordBaseVO { @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "19610") private Long id; diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/log/MemberLevelLogBaseVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/log/MemberLevelRecordBaseVO.java similarity index 97% rename from yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/log/MemberLevelLogBaseVO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/log/MemberLevelRecordBaseVO.java index 845b02435..4538988db 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/log/MemberLevelLogBaseVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/log/MemberLevelRecordBaseVO.java @@ -10,7 +10,7 @@ import javax.validation.constraints.NotNull; * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 */ @Data -public class MemberLevelLogBaseVO { +public class MemberLevelRecordBaseVO { @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "25923") @NotNull(message = "用户编号不能为空") diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/log/MemberLevelLogPageReqVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/log/MemberLevelRecordPageReqVO.java similarity index 94% rename from yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/log/MemberLevelLogPageReqVO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/log/MemberLevelRecordPageReqVO.java index 526503bed..2c7337b47 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/log/MemberLevelLogPageReqVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/log/MemberLevelRecordPageReqVO.java @@ -15,7 +15,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) -public class MemberLevelLogPageReqVO extends PageParam { +public class MemberLevelRecordPageReqVO extends PageParam { @Schema(description = "用户编号", example = "25923") private Long userId; diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/log/MemberLevelLogRespVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/log/MemberLevelRecordRespVO.java similarity index 89% rename from yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/log/MemberLevelLogRespVO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/log/MemberLevelRecordRespVO.java index dfb2adb0a..290340a8e 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/log/MemberLevelLogRespVO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/admin/level/vo/log/MemberLevelRecordRespVO.java @@ -11,7 +11,7 @@ import java.time.LocalDateTime; @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) -public class MemberLevelLogRespVO extends MemberLevelLogBaseVO { +public class MemberLevelRecordRespVO extends MemberLevelRecordBaseVO { @Schema(description = "编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "8741") private Long id; diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/level/MemberExperienceLogConvert.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/level/MemberExperienceLogConvert.java deleted file mode 100644 index 288ec094a..000000000 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/level/MemberExperienceLogConvert.java +++ /dev/null @@ -1,27 +0,0 @@ -package cn.iocoder.yudao.module.member.convert.level; - -import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.module.member.controller.admin.level.vo.experience.MemberExperienceLogRespVO; -import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberExperienceLogDO; -import org.mapstruct.Mapper; -import org.mapstruct.factory.Mappers; - -import java.util.List; - -/** - * 会员经验记录 Convert - * - * @author owen - */ -@Mapper -public interface MemberExperienceLogConvert { - - MemberExperienceLogConvert INSTANCE = Mappers.getMapper(MemberExperienceLogConvert.class); - - MemberExperienceLogRespVO convert(MemberExperienceLogDO bean); - - List convertList(List list); - - PageResult convertPage(PageResult page); - -} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/level/MemberExperienceRecordConvert.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/level/MemberExperienceRecordConvert.java new file mode 100644 index 000000000..6902fccfd --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/level/MemberExperienceRecordConvert.java @@ -0,0 +1,27 @@ +package cn.iocoder.yudao.module.member.convert.level; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.member.controller.admin.level.vo.experience.MemberExperienceRecordRespVO; +import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberExperienceRecordDO; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +import java.util.List; + +/** + * 会员经验记录 Convert + * + * @author owen + */ +@Mapper +public interface MemberExperienceRecordConvert { + + MemberExperienceRecordConvert INSTANCE = Mappers.getMapper(MemberExperienceRecordConvert.class); + + MemberExperienceRecordRespVO convert(MemberExperienceRecordDO bean); + + List convertList(List list); + + PageResult convertPage(PageResult page); + +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/level/MemberLevelLogConvert.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/level/MemberLevelLogConvert.java deleted file mode 100644 index 133f71209..000000000 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/level/MemberLevelLogConvert.java +++ /dev/null @@ -1,27 +0,0 @@ -package cn.iocoder.yudao.module.member.convert.level; - -import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.module.member.controller.admin.level.vo.log.MemberLevelLogRespVO; -import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelLogDO; -import org.mapstruct.Mapper; -import org.mapstruct.factory.Mappers; - -import java.util.List; - -/** - * 会员等级记录 Convert - * - * @author owen - */ -@Mapper -public interface MemberLevelLogConvert { - - MemberLevelLogConvert INSTANCE = Mappers.getMapper(MemberLevelLogConvert.class); - - MemberLevelLogRespVO convert(MemberLevelLogDO bean); - - List convertList(List list); - - PageResult convertPage(PageResult page); - -} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/level/MemberLevelRecordConvert.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/level/MemberLevelRecordConvert.java new file mode 100644 index 000000000..3770cc3d4 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/level/MemberLevelRecordConvert.java @@ -0,0 +1,27 @@ +package cn.iocoder.yudao.module.member.convert.level; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.module.member.controller.admin.level.vo.log.MemberLevelRecordRespVO; +import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelRecordDO; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +import java.util.List; + +/** + * 会员等级记录 Convert + * + * @author owen + */ +@Mapper +public interface MemberLevelRecordConvert { + + MemberLevelRecordConvert INSTANCE = Mappers.getMapper(MemberLevelRecordConvert.class); + + MemberLevelRecordRespVO convert(MemberLevelRecordDO bean); + + List convertList(List list); + + PageResult convertPage(PageResult page); + +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/level/MemberExperienceLogDO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/level/MemberExperienceRecordDO.java similarity index 81% rename from yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/level/MemberExperienceLogDO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/level/MemberExperienceRecordDO.java index 5324ac328..a8a7bef17 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/level/MemberExperienceLogDO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/level/MemberExperienceRecordDO.java @@ -12,15 +12,15 @@ import lombok.*; * * @author owen */ -@TableName("member_experience_log") -@KeySequence("member_experience_log_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@TableName("member_experience_record") +@KeySequence("member_experience_record_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @Builder @NoArgsConstructor @AllArgsConstructor -public class MemberExperienceLogDO extends BaseDO { +public class MemberExperienceRecordDO extends BaseDO { /** * 编号 diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/level/MemberLevelLogDO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/level/MemberLevelRecordDO.java similarity index 82% rename from yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/level/MemberLevelLogDO.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/level/MemberLevelRecordDO.java index 8ab63b18f..289dae983 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/level/MemberLevelLogDO.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/dataobject/level/MemberLevelRecordDO.java @@ -13,15 +13,15 @@ import lombok.*; * * @author owen */ -@TableName("member_level_log") -@KeySequence("member_level_log_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 +@TableName("member_level_record") +@KeySequence("member_level_record_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。 @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) @Builder @NoArgsConstructor @AllArgsConstructor -public class MemberLevelLogDO extends BaseDO { +public class MemberLevelRecordDO extends BaseDO { /** * 编号 diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/level/MemberExperienceLogMapper.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/level/MemberExperienceLogMapper.java deleted file mode 100644 index 956e61cf6..000000000 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/level/MemberExperienceLogMapper.java +++ /dev/null @@ -1,28 +0,0 @@ -package cn.iocoder.yudao.module.member.dal.mysql.level; - -import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; -import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; -import cn.iocoder.yudao.module.member.controller.admin.level.vo.experience.MemberExperienceLogPageReqVO; -import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberExperienceLogDO; -import org.apache.ibatis.annotations.Mapper; - -/** - * 会员经验记录 Mapper - * - * @author owen - */ -@Mapper -public interface MemberExperienceLogMapper extends BaseMapperX { - - default PageResult selectPage(MemberExperienceLogPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .eqIfPresent(MemberExperienceLogDO::getUserId, reqVO.getUserId()) - .eqIfPresent(MemberExperienceLogDO::getBizId, reqVO.getBizId()) - .eqIfPresent(MemberExperienceLogDO::getBizType, reqVO.getBizType()) - .eqIfPresent(MemberExperienceLogDO::getTitle, reqVO.getTitle()) - .betweenIfPresent(MemberExperienceLogDO::getCreateTime, reqVO.getCreateTime()) - .orderByDesc(MemberExperienceLogDO::getId)); - } - -} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/level/MemberExperienceRecordMapper.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/level/MemberExperienceRecordMapper.java new file mode 100644 index 000000000..8e5065472 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/level/MemberExperienceRecordMapper.java @@ -0,0 +1,28 @@ +package cn.iocoder.yudao.module.member.dal.mysql.level; + +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; +import cn.iocoder.yudao.module.member.controller.admin.level.vo.experience.MemberExperienceRecordPageReqVO; +import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberExperienceRecordDO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 会员经验记录 Mapper + * + * @author owen + */ +@Mapper +public interface MemberExperienceRecordMapper extends BaseMapperX { + + default PageResult selectPage(MemberExperienceRecordPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MemberExperienceRecordDO::getUserId, reqVO.getUserId()) + .eqIfPresent(MemberExperienceRecordDO::getBizId, reqVO.getBizId()) + .eqIfPresent(MemberExperienceRecordDO::getBizType, reqVO.getBizType()) + .eqIfPresent(MemberExperienceRecordDO::getTitle, reqVO.getTitle()) + .betweenIfPresent(MemberExperienceRecordDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(MemberExperienceRecordDO::getId)); + } + +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/level/MemberLevelLogMapper.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/level/MemberLevelRecordMapper.java similarity index 50% rename from yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/level/MemberLevelLogMapper.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/level/MemberLevelRecordMapper.java index d4bdbc3f4..d10b1690b 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/level/MemberLevelLogMapper.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/level/MemberLevelRecordMapper.java @@ -3,8 +3,8 @@ package cn.iocoder.yudao.module.member.dal.mysql.level; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; -import cn.iocoder.yudao.module.member.controller.admin.level.vo.log.MemberLevelLogPageReqVO; -import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelLogDO; +import cn.iocoder.yudao.module.member.controller.admin.level.vo.log.MemberLevelRecordPageReqVO; +import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelRecordDO; import org.apache.ibatis.annotations.Mapper; /** @@ -13,14 +13,14 @@ import org.apache.ibatis.annotations.Mapper; * @author owen */ @Mapper -public interface MemberLevelLogMapper extends BaseMapperX { +public interface MemberLevelRecordMapper extends BaseMapperX { - default PageResult selectPage(MemberLevelLogPageReqVO reqVO) { - return selectPage(reqVO, new LambdaQueryWrapperX() - .eqIfPresent(MemberLevelLogDO::getUserId, reqVO.getUserId()) - .eqIfPresent(MemberLevelLogDO::getLevelId, reqVO.getLevelId()) - .betweenIfPresent(MemberLevelLogDO::getCreateTime, reqVO.getCreateTime()) - .orderByDesc(MemberLevelLogDO::getId)); + default PageResult selectPage(MemberLevelRecordPageReqVO reqVO) { + return selectPage(reqVO, new LambdaQueryWrapperX() + .eqIfPresent(MemberLevelRecordDO::getUserId, reqVO.getUserId()) + .eqIfPresent(MemberLevelRecordDO::getLevelId, reqVO.getLevelId()) + .betweenIfPresent(MemberLevelRecordDO::getCreateTime, reqVO.getCreateTime()) + .orderByDesc(MemberLevelRecordDO::getId)); } } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/MemberExperienceLogService.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/MemberExperienceRecordService.java similarity index 81% rename from yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/MemberExperienceLogService.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/MemberExperienceRecordService.java index 0cb4389dc..92b34b365 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/MemberExperienceLogService.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/MemberExperienceRecordService.java @@ -1,8 +1,8 @@ package cn.iocoder.yudao.module.member.service.level; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.module.member.controller.admin.level.vo.experience.MemberExperienceLogPageReqVO; -import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberExperienceLogDO; +import cn.iocoder.yudao.module.member.controller.admin.level.vo.experience.MemberExperienceRecordPageReqVO; +import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberExperienceRecordDO; import cn.iocoder.yudao.module.member.enums.MemberExperienceBizTypeEnum; import java.util.Collection; @@ -13,7 +13,7 @@ import java.util.List; * * @author owen */ -public interface MemberExperienceLogService { +public interface MemberExperienceRecordService { /** * 获得会员经验记录 @@ -21,7 +21,7 @@ public interface MemberExperienceLogService { * @param id 编号 * @return 会员经验记录 */ - MemberExperienceLogDO getExperienceLog(Long id); + MemberExperienceRecordDO getExperienceLog(Long id); /** * 获得会员经验记录列表 @@ -29,7 +29,7 @@ public interface MemberExperienceLogService { * @param ids 编号 * @return 会员经验记录列表 */ - List getExperienceLogList(Collection ids); + List getExperienceLogList(Collection ids); /** * 获得会员经验记录分页 @@ -37,7 +37,7 @@ public interface MemberExperienceLogService { * @param pageReqVO 分页查询 * @return 会员经验记录分页 */ - PageResult getExperienceLogPage(MemberExperienceLogPageReqVO pageReqVO); + PageResult getExperienceLogPage(MemberExperienceRecordPageReqVO pageReqVO); /** * 创建 手动调整 经验变动记录 diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/MemberExperienceLogServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/MemberExperienceRecordServiceImpl.java similarity index 76% rename from yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/MemberExperienceLogServiceImpl.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/MemberExperienceRecordServiceImpl.java index f049d308f..ca0b96b6d 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/MemberExperienceLogServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/MemberExperienceRecordServiceImpl.java @@ -2,9 +2,9 @@ package cn.iocoder.yudao.module.member.service.level; import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.module.member.controller.admin.level.vo.experience.MemberExperienceLogPageReqVO; -import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberExperienceLogDO; -import cn.iocoder.yudao.module.member.dal.mysql.level.MemberExperienceLogMapper; +import cn.iocoder.yudao.module.member.controller.admin.level.vo.experience.MemberExperienceRecordPageReqVO; +import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberExperienceRecordDO; +import cn.iocoder.yudao.module.member.dal.mysql.level.MemberExperienceRecordMapper; import cn.iocoder.yudao.module.member.enums.MemberExperienceBizTypeEnum; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; @@ -20,24 +20,24 @@ import java.util.List; */ @Service @Validated -public class MemberExperienceLogServiceImpl implements MemberExperienceLogService { +public class MemberExperienceRecordServiceImpl implements MemberExperienceRecordService { @Resource - private MemberExperienceLogMapper experienceLogMapper; + private MemberExperienceRecordMapper experienceLogMapper; @Override - public MemberExperienceLogDO getExperienceLog(Long id) { + public MemberExperienceRecordDO getExperienceLog(Long id) { return experienceLogMapper.selectById(id); } @Override - public List getExperienceLogList(Collection ids) { + public List getExperienceLogList(Collection ids) { return experienceLogMapper.selectBatchIds(ids); } @Override - public PageResult getExperienceLogPage(MemberExperienceLogPageReqVO pageReqVO) { + public PageResult getExperienceLogPage(MemberExperienceRecordPageReqVO pageReqVO) { return experienceLogMapper.selectPage(pageReqVO); } @@ -50,7 +50,7 @@ public class MemberExperienceLogServiceImpl implements MemberExperienceLogServic @Override public void createBizLog(Long userId, int experience, int totalExperience, MemberExperienceBizTypeEnum bizType, String bizId) { - MemberExperienceLogDO experienceLogDO = new MemberExperienceLogDO(); + MemberExperienceRecordDO experienceLogDO = new MemberExperienceRecordDO(); experienceLogDO.setUserId(userId); experienceLogDO.setExperience(experience); experienceLogDO.setTotalExperience(totalExperience); diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/MemberLevelLogService.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/MemberLevelRecordService.java similarity index 84% rename from yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/MemberLevelLogService.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/MemberLevelRecordService.java index cfb84d684..7dfd2c830 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/MemberLevelLogService.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/MemberLevelRecordService.java @@ -1,9 +1,9 @@ package cn.iocoder.yudao.module.member.service.level; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.module.member.controller.admin.level.vo.log.MemberLevelLogPageReqVO; +import cn.iocoder.yudao.module.member.controller.admin.level.vo.log.MemberLevelRecordPageReqVO; import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelDO; -import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelLogDO; +import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelRecordDO; import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; import java.util.Collection; @@ -14,7 +14,7 @@ import java.util.List; * * @author owen */ -public interface MemberLevelLogService { +public interface MemberLevelRecordService { /** * 删除会员等级记录 @@ -29,7 +29,7 @@ public interface MemberLevelLogService { * @param id 编号 * @return 会员等级记录 */ - MemberLevelLogDO getLevelLog(Long id); + MemberLevelRecordDO getLevelLog(Long id); /** * 获得会员等级记录列表 @@ -37,7 +37,7 @@ public interface MemberLevelLogService { * @param ids 编号 * @return 会员等级记录列表 */ - List getLevelLogList(Collection ids); + List getLevelLogList(Collection ids); /** * 获得会员等级记录分页 @@ -45,7 +45,7 @@ public interface MemberLevelLogService { * @param pageReqVO 分页查询 * @return 会员等级记录分页 */ - PageResult getLevelLogPage(MemberLevelLogPageReqVO pageReqVO); + PageResult getLevelLogPage(MemberLevelRecordPageReqVO pageReqVO); /** * 创建记录: 取消等级 diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/MemberLevelLogServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/MemberLevelRecordServiceImpl.java similarity index 81% rename from yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/MemberLevelLogServiceImpl.java rename to yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/MemberLevelRecordServiceImpl.java index 2031c70fb..8a81dcf43 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/MemberLevelLogServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/MemberLevelRecordServiceImpl.java @@ -1,11 +1,11 @@ package cn.iocoder.yudao.module.member.service.level; import cn.iocoder.yudao.framework.common.pojo.PageResult; -import cn.iocoder.yudao.module.member.controller.admin.level.vo.log.MemberLevelLogPageReqVO; +import cn.iocoder.yudao.module.member.controller.admin.level.vo.log.MemberLevelRecordPageReqVO; import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelDO; -import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelLogDO; +import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelRecordDO; import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; -import cn.iocoder.yudao.module.member.dal.mysql.level.MemberLevelLogMapper; +import cn.iocoder.yudao.module.member.dal.mysql.level.MemberLevelRecordMapper; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; @@ -23,10 +23,10 @@ import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.LEVEL_LOG_ */ @Service @Validated -public class MemberLevelLogServiceImpl implements MemberLevelLogService { +public class MemberLevelRecordServiceImpl implements MemberLevelRecordService { @Resource - private MemberLevelLogMapper levelLogMapper; + private MemberLevelRecordMapper levelLogMapper; @Override public void deleteLevelLog(Long id) { @@ -43,23 +43,23 @@ public class MemberLevelLogServiceImpl implements MemberLevelLogService { } @Override - public MemberLevelLogDO getLevelLog(Long id) { + public MemberLevelRecordDO getLevelLog(Long id) { return levelLogMapper.selectById(id); } @Override - public List getLevelLogList(Collection ids) { + public List getLevelLogList(Collection ids) { return levelLogMapper.selectBatchIds(ids); } @Override - public PageResult getLevelLogPage(MemberLevelLogPageReqVO pageReqVO) { + public PageResult getLevelLogPage(MemberLevelRecordPageReqVO pageReqVO) { return levelLogMapper.selectPage(pageReqVO); } @Override public void createCancelLog(Long userId, String reason) { - MemberLevelLogDO levelLogDO = new MemberLevelLogDO(); + MemberLevelRecordDO levelLogDO = new MemberLevelRecordDO(); levelLogDO.setUserId(userId); levelLogDO.setRemark(reason); levelLogDO.setDescription("管理员取消"); @@ -71,7 +71,7 @@ public class MemberLevelLogServiceImpl implements MemberLevelLogService { @Override public void createAdjustLog(MemberUserDO user, MemberLevelDO level, int experience, String reason) { - MemberLevelLogDO levelLogDO = new MemberLevelLogDO(); + MemberLevelRecordDO levelLogDO = new MemberLevelRecordDO(); levelLogDO.setUserId(user.getId()); levelLogDO.setLevelId(level.getId()); levelLogDO.setLevel(level.getLevel()); @@ -88,7 +88,7 @@ public class MemberLevelLogServiceImpl implements MemberLevelLogService { @Override public void createAutoUpgradeLog(MemberUserDO user, MemberLevelDO level) { - MemberLevelLogDO levelLogDO = new MemberLevelLogDO(); + MemberLevelRecordDO levelLogDO = new MemberLevelRecordDO(); levelLogDO.setUserId(user.getId()); levelLogDO.setLevelId(level.getId()); levelLogDO.setLevel(level.getLevel()); @@ -102,7 +102,7 @@ public class MemberLevelLogServiceImpl implements MemberLevelLogService { notifyMember(user.getId(), levelLogDO); } - private void notifyMember(Long userId, MemberLevelLogDO level) { + private void notifyMember(Long userId, MemberLevelRecordDO level) { //todo: 给会员发消息 } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/MemberLevelServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/MemberLevelServiceImpl.java index 71678d470..1364e7dbb 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/MemberLevelServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/level/MemberLevelServiceImpl.java @@ -42,9 +42,9 @@ public class MemberLevelServiceImpl implements MemberLevelService { @Resource private MemberLevelMapper levelMapper; @Resource - private MemberLevelLogService memberLevelLogService; + private MemberLevelRecordService memberLevelRecordService; @Resource - private MemberExperienceLogService memberExperienceLogService; + private MemberExperienceRecordService memberExperienceRecordService; @Resource private MemberUserMapper memberUserMapper; @@ -203,7 +203,7 @@ public class MemberLevelServiceImpl implements MemberLevelService { experience = -user.getExperience(); // 取消了会员的等级 - memberLevelLogService.createCancelLog(user.getId(), updateReqVO.getReason()); + memberLevelRecordService.createCancelLog(user.getId(), updateReqVO.getReason()); memberUserMapper.updateUserLevelToNull(user.getId()); } else { MemberLevelDO level = validateLevelExists(updateReqVO.getLevelId()); @@ -212,7 +212,7 @@ public class MemberLevelServiceImpl implements MemberLevelService { // 会员当前的经验 = 等级的升级经验 totalExperience = level.getExperience(); - memberLevelLogService.createAdjustLog(user, level, experience, updateReqVO.getReason()); + memberLevelRecordService.createAdjustLog(user, level, experience, updateReqVO.getReason()); // 更新会员表上的等级编号、经验值 updateUserLevelIdAndExperience(user.getId(), updateReqVO.getLevelId(), totalExperience); @@ -220,7 +220,7 @@ public class MemberLevelServiceImpl implements MemberLevelService { // 记录会员经验变动 - memberExperienceLogService.createAdjustLog(user.getId(), experience, totalExperience); + memberExperienceRecordService.createAdjustLog(user.getId(), experience, totalExperience); } @Transactional(rollbackFor = Exception.class) @@ -239,7 +239,7 @@ public class MemberLevelServiceImpl implements MemberLevelService { int userExperience = NumberUtil.max(user.getExperience() + experience, 0); // 创建经验记录 - memberExperienceLogService.createBizLog(userId, experience, userExperience, bizType, bizId); + memberExperienceRecordService.createBizLog(userId, experience, userExperience, bizType, bizId); // 计算会员等级 Long levelId = calcLevel(user, userExperience); @@ -284,7 +284,7 @@ public class MemberLevelServiceImpl implements MemberLevelService { } // 保存等级变更记录 - memberLevelLogService.createAutoUpgradeLog(user, matchLevel); + memberLevelRecordService.createAutoUpgradeLog(user, matchLevel); return matchLevel.getId(); } } diff --git a/yudao-module-member/yudao-module-member-biz/src/test/java/cn/iocoder/yudao/module/member/service/level/MemberLevelServiceImplTest.java b/yudao-module-member/yudao-module-member-biz/src/test/java/cn/iocoder/yudao/module/member/service/level/MemberLevelServiceImplTest.java index e05dde443..9763c2f6f 100644 --- a/yudao-module-member/yudao-module-member-biz/src/test/java/cn/iocoder/yudao/module/member/service/level/MemberLevelServiceImplTest.java +++ b/yudao-module-member/yudao-module-member-biz/src/test/java/cn/iocoder/yudao/module/member/service/level/MemberLevelServiceImplTest.java @@ -41,9 +41,9 @@ public class MemberLevelServiceImplTest extends BaseDbUnitTest { private MemberLevelMapper levelMapper; @MockBean - private MemberLevelLogService memberLevelLogService; + private MemberLevelRecordService memberLevelRecordService; @MockBean - private MemberExperienceLogService memberExperienceLogService; + private MemberExperienceRecordService memberExperienceRecordService; @Test public void testCreateLevel_success() {