code review:会员等级

This commit is contained in:
YunaiV 2023-08-21 23:18:04 +08:00
parent 4cd5b5712b
commit 800c44a46e
25 changed files with 59 additions and 48 deletions

View File

@ -28,9 +28,7 @@ import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
/** // TODO @疯狂要不 Log 改成 Record PointRecord 保持一致
* @author owen
*/
@Tag(name = "管理后台 - 会员经验记录") @Tag(name = "管理后台 - 会员经验记录")
@RestController @RestController
@RequestMapping("/member/experience-log") @RequestMapping("/member/experience-log")
@ -40,6 +38,7 @@ public class MemberExperienceLogController {
@Resource @Resource
private MemberExperienceLogService experienceLogService; private MemberExperienceLogService experienceLogService;
// TODO @疯狂不允许删除经验哈
@DeleteMapping("/delete") @DeleteMapping("/delete")
@Operation(summary = "删除会员经验记录") @Operation(summary = "删除会员经验记录")
@Parameter(name = "id", description = "编号", required = true) @Parameter(name = "id", description = "编号", required = true)
@ -58,6 +57,7 @@ public class MemberExperienceLogController {
return success(MemberExperienceLogConvert.INSTANCE.convert(experienceLog)); return success(MemberExperienceLogConvert.INSTANCE.convert(experienceLog));
} }
// TODO @疯狂这个接口可以删除哈应该用不到
@GetMapping("/list") @GetMapping("/list")
@Operation(summary = "获得会员经验记录列表") @Operation(summary = "获得会员经验记录列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@ -75,6 +75,7 @@ public class MemberExperienceLogController {
return success(MemberExperienceLogConvert.INSTANCE.convertPage(pageResult)); return success(MemberExperienceLogConvert.INSTANCE.convertPage(pageResult));
} }
// TODO @疯狂导出可以先不支持场景不多
@GetMapping("/export-excel") @GetMapping("/export-excel")
@Operation(summary = "导出会员经验记录 Excel") @Operation(summary = "导出会员经验记录 Excel")
@PreAuthorize("@ss.hasPermission('member:experience-log:export')") @PreAuthorize("@ss.hasPermission('member:experience-log:export')")

View File

@ -2,7 +2,7 @@ package cn.iocoder.yudao.module.member.controller.admin.level;
import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.*; import cn.iocoder.yudao.module.member.controller.admin.level.vo.level.*;
import cn.iocoder.yudao.module.member.convert.level.MemberLevelConvert; import cn.iocoder.yudao.module.member.convert.level.MemberLevelConvert;
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelDO; import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelDO;
import cn.iocoder.yudao.module.member.service.level.MemberLevelService; import cn.iocoder.yudao.module.member.service.level.MemberLevelService;
@ -20,9 +20,6 @@ import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
/**
* @author owen
*/
@Tag(name = "管理后台 - 会员等级") @Tag(name = "管理后台 - 会员等级")
@RestController @RestController
@RequestMapping("/member/level") @RequestMapping("/member/level")
@ -65,6 +62,7 @@ public class MemberLevelController {
return success(MemberLevelConvert.INSTANCE.convert(level)); return success(MemberLevelConvert.INSTANCE.convert(level));
} }
// TODO @疯狂这个应该用不到哈
@GetMapping("/list") @GetMapping("/list")
@Operation(summary = "获得会员等级列表") @Operation(summary = "获得会员等级列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@ -83,6 +81,7 @@ public class MemberLevelController {
return success(MemberLevelConvert.INSTANCE.convertSimpleList(list)); return success(MemberLevelConvert.INSTANCE.convertSimpleList(list));
} }
// TODO @疯狂是不是不做分页直接 list 就好啦返回的时候按照经验排序下哈
@GetMapping("/page") @GetMapping("/page")
@Operation(summary = "获得会员等级分页") @Operation(summary = "获得会员等级分页")
@PreAuthorize("@ss.hasPermission('member:level:query')") @PreAuthorize("@ss.hasPermission('member:level:query')")

View File

@ -28,9 +28,7 @@ import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
/** // TODO @疯狂是不是不用这个 controller因为日志只是为了记录db 可以查询和审计即可目前暂时不需要开放出来
* @author owen
*/
@Tag(name = "管理后台 - 会员等级记录") @Tag(name = "管理后台 - 会员等级记录")
@RestController @RestController
@RequestMapping("/member/level-log") @RequestMapping("/member/level-log")
@ -40,6 +38,7 @@ public class MemberLevelLogController {
@Resource @Resource
private MemberLevelLogService levelLogService; private MemberLevelLogService levelLogService;
// TODO @疯狂这个不允许删除哈
@DeleteMapping("/delete") @DeleteMapping("/delete")
@Operation(summary = "删除会员等级记录") @Operation(summary = "删除会员等级记录")
@Parameter(name = "id", description = "编号", required = true) @Parameter(name = "id", description = "编号", required = true)
@ -58,6 +57,7 @@ public class MemberLevelLogController {
return success(MemberLevelLogConvert.INSTANCE.convert(levelLog)); return success(MemberLevelLogConvert.INSTANCE.convert(levelLog));
} }
// TODO @疯狂这个接口应该没用
@GetMapping("/list") @GetMapping("/list")
@Operation(summary = "获得会员等级记录列表") @Operation(summary = "获得会员等级记录列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@ -75,6 +75,7 @@ public class MemberLevelLogController {
return success(MemberLevelLogConvert.INSTANCE.convertPage(pageResult)); return success(MemberLevelLogConvert.INSTANCE.convertPage(pageResult));
} }
// TODO @疯狂导出可以去掉先
@GetMapping("/export-excel") @GetMapping("/export-excel")
@Operation(summary = "导出会员等级记录 Excel") @Operation(summary = "导出会员等级记录 Excel")
@PreAuthorize("@ss.hasPermission('member:level-log:export')") @PreAuthorize("@ss.hasPermission('member:level-log:export')")

View File

@ -38,7 +38,7 @@ public class MemberExperienceLogBaseVO {
@NotNull(message = "变更后的经验不能为空") @NotNull(message = "变更后的经验不能为空")
private Integer totalExperience; private Integer totalExperience;
@Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "下单增加100经验") @Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "下单增加 100 经验")
@NotNull(message = "描述不能为空") @NotNull(message = "描述不能为空")
private String description; private String description;

View File

@ -1,5 +1,7 @@
package cn.iocoder.yudao.module.member.controller.admin.level.vo; package cn.iocoder.yudao.module.member.controller.admin.level.vo.level;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.validation.InEnum;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import org.hibernate.validator.constraints.Range; import org.hibernate.validator.constraints.Range;
@ -24,29 +26,30 @@ public class MemberLevelBaseVO {
@Schema(description = "升级经验", requiredMode = Schema.RequiredMode.REQUIRED, example = "100") @Schema(description = "升级经验", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
@NotNull(message = "升级经验不能为空") @NotNull(message = "升级经验不能为空")
@Positive(message = "升级经验必须大于0") @Positive(message = "升级经验必须大于 0")
private Integer experience; private Integer experience;
@Schema(description = "等级", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @Schema(description = "等级", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "等级不能为空") @NotNull(message = "等级不能为空")
@Positive(message = "等级必须大于0") @Positive(message = "等级必须大于 0")
private Integer level; private Integer level;
@Schema(description = "享受折扣", requiredMode = Schema.RequiredMode.REQUIRED, example = "98") @Schema(description = "享受折扣", requiredMode = Schema.RequiredMode.REQUIRED, example = "98")
@NotNull(message = "享受折扣不能为空") @NotNull(message = "享受折扣不能为空")
@Range(min = 0, max = 100, message = "享受折扣的范围为0-100") @Range(min = 0, max = 100, message = "享受折扣的范围为 0-100")
private Integer discount; private Integer discount;
@Schema(description = "等级图标", example = "https://www.iocoder.cn/yudao.jpg") @Schema(description = "等级图标", example = "https://www.iocoder.cn/yudao.jpg")
@URL(message = "等级图标 必须是 URL 格式") @URL(message = "等级图标必须是 URL 格式")
private String icon; private String icon;
@Schema(description = "等级背景图", example = "https://www.iocoder.cn/yudao.jpg") @Schema(description = "等级背景图", example = "https://www.iocoder.cn/yudao.jpg")
@URL(message = "等级背景图 必须是 URL 格式") @URL(message = "等级背景图必须是 URL 格式")
private String backgroundUrl; private String backgroundUrl;
@Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @Schema(description = "状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "状态不能为空") @NotNull(message = "状态不能为空")
@InEnum(CommonStatusEnum.class)
private Integer status; private Integer status;
} }

View File

@ -1,10 +1,11 @@
package cn.iocoder.yudao.module.member.controller.admin.level.vo; package cn.iocoder.yudao.module.member.controller.admin.level.vo.level;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
// TODO @疯狂项目的 vo controller 不写 author 信息哈只写 swagger 注解
/** /**
* @author owen * @author owen
*/ */

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.member.controller.admin.level.vo; package cn.iocoder.yudao.module.member.controller.admin.level.vo.level;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.member.controller.admin.level.vo; package cn.iocoder.yudao.module.member.controller.admin.level.vo.level;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;

View File

@ -1,13 +1,11 @@
package cn.iocoder.yudao.module.member.controller.admin.level.vo; package cn.iocoder.yudao.module.member.controller.admin.level.vo.level;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
/** // TODO @疯狂不需要继承 MemberLevelBaseVO
* @author owen
*/
@Schema(description = "管理后台 - 会员等级 Response VO") @Schema(description = "管理后台 - 会员等级 Response VO")
@Data @Data
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)

View File

@ -1,4 +1,4 @@
package cn.iocoder.yudao.module.member.controller.admin.level.vo; package cn.iocoder.yudao.module.member.controller.admin.level.vo.level;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;

View File

@ -69,7 +69,7 @@ public class MemberTagController {
@Operation(summary = "获取会员标签精简信息列表", description = "只包含被开启的会员标签,主要用于前端的下拉选项") @Operation(summary = "获取会员标签精简信息列表", description = "只包含被开启的会员标签,主要用于前端的下拉选项")
public CommonResult<List<MemberTagRespVO>> getSimpleTagList() { public CommonResult<List<MemberTagRespVO>> getSimpleTagList() {
// 获用户列表只要开启状态的 // 获用户列表只要开启状态的
List<MemberTagDO> list = tagService.getList(); List<MemberTagDO> list = tagService.getTagList();
// 排序后返回给前端 // 排序后返回给前端
return success(MemberTagConvert.INSTANCE.convertList(list)); return success(MemberTagConvert.INSTANCE.convertList(list));
} }

View File

@ -76,10 +76,9 @@ public class MemberUserController {
.flatMap(Collection::stream) .flatMap(Collection::stream)
.collect(Collectors.toSet()); .collect(Collectors.toSet());
List<MemberTagDO> tags = memberTagService.getTagList(tagIds); List<MemberTagDO> tags = memberTagService.getTagList(tagIds);
// 处理会员级别返显 // 处理会员级别返显
List<MemberLevelDO> levels = memberLevelService.getEnableLevelList(); List<MemberLevelDO> levels = memberLevelService.getEnableLevelList();
// 拼接
return success(MemberUserConvert.INSTANCE.convertPage(pageResult, tags, levels)); return success(MemberUserConvert.INSTANCE.convertPage(pageResult, tags, levels));
} }

View File

@ -1,10 +1,10 @@
package cn.iocoder.yudao.module.member.convert.level; package cn.iocoder.yudao.module.member.convert.level;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.MemberLevelCreateReqVO; import cn.iocoder.yudao.module.member.controller.admin.level.vo.level.MemberLevelCreateReqVO;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.MemberLevelRespVO; import cn.iocoder.yudao.module.member.controller.admin.level.vo.level.MemberLevelRespVO;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.MemberLevelSimpleRespVO; import cn.iocoder.yudao.module.member.controller.admin.level.vo.level.MemberLevelSimpleRespVO;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.MemberLevelUpdateReqVO; import cn.iocoder.yudao.module.member.controller.admin.level.vo.level.MemberLevelUpdateReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelDO; import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelDO;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers; import org.mapstruct.factory.Mappers;

View File

@ -44,8 +44,6 @@ public interface MemberUserConvert {
// 处理关联数据 // 处理关联数据
Map<Long, String> tagMap = convertMap(tags, MemberTagDO::getId, MemberTagDO::getName); Map<Long, String> tagMap = convertMap(tags, MemberTagDO::getId, MemberTagDO::getName);
Map<Long, String> levelMap = convertMap(levels, MemberLevelDO::getId, MemberLevelDO::getName); Map<Long, String> levelMap = convertMap(levels, MemberLevelDO::getId, MemberLevelDO::getName);
// 填充关联数据
for (MemberUserRespVO vo : result.getList()) { for (MemberUserRespVO vo : result.getList()) {
vo.setTagNames(convertList(vo.getTagIds(), tagMap::get)); vo.setTagNames(convertList(vo.getTagIds(), tagMap::get));
vo.setLevelName(MapUtil.getStr(levelMap, vo.getLevelId(), StrUtil.EMPTY)); vo.setLevelName(MapUtil.getStr(levelMap, vo.getLevelId(), StrUtil.EMPTY));

View File

@ -10,6 +10,8 @@ import lombok.*;
/** /**
* 会员等级 DO * 会员等级 DO
* *
* 配置每个等级需要的积分
*
* @author owen * @author owen
*/ */
@TableName("member_level") @TableName("member_level")

View File

@ -9,6 +9,8 @@ import lombok.*;
/** /**
* 会员等级记录 DO * 会员等级记录 DO
* *
* 用户每次等级发生变更时记录一条日志
*
* @author owen * @author owen
*/ */
@TableName("member_level_log") @TableName("member_level_log")

View File

@ -4,6 +4,7 @@ import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.ip.core.Area; import cn.iocoder.yudao.framework.ip.core.Area;
import cn.iocoder.yudao.framework.mybatis.core.type.LongListTypeHandler; import cn.iocoder.yudao.framework.mybatis.core.type.LongListTypeHandler;
import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO; import cn.iocoder.yudao.framework.tenant.core.db.TenantBaseDO;
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelDO;
import cn.iocoder.yudao.module.system.enums.common.SexEnum; import cn.iocoder.yudao.module.system.enums.common.SexEnum;
import com.baomidou.mybatisplus.annotation.KeySequence; import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
@ -119,6 +120,8 @@ public class MemberUserDO extends TenantBaseDO {
/** /**
* 会员级别编号 * 会员级别编号
*
* 关联 {@link MemberLevelDO#getLevel()} 字段
*/ */
private Long levelId; private Long levelId;
/** /**
@ -126,5 +129,4 @@ public class MemberUserDO extends TenantBaseDO {
*/ */
private Integer experience; private Integer experience;
// TODO 积分等等
} }

View File

@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.member.dal.mysql.level;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.MemberLevelPageReqVO; import cn.iocoder.yudao.module.member.controller.admin.level.vo.level.MemberLevelPageReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelDO; import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;

View File

@ -49,6 +49,7 @@ public interface MemberUserMapper extends BaseMapperX<MemberUserDO> {
.orderByDesc(MemberUserDO::getId)); .orderByDesc(MemberUserDO::getId));
} }
// TODO @疯狂命名可以改成 updateUserLevelToNulldb 侧的操作尽量无业务含义更多是 selectupdateinsert 操作
/** /**
* 取消会员的等级 * 取消会员的等级
* *

View File

@ -2,9 +2,9 @@ package cn.iocoder.yudao.module.member.service.level;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.MemberLevelCreateReqVO; import cn.iocoder.yudao.module.member.controller.admin.level.vo.level.MemberLevelCreateReqVO;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.MemberLevelPageReqVO; import cn.iocoder.yudao.module.member.controller.admin.level.vo.level.MemberLevelPageReqVO;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.MemberLevelUpdateReqVO; import cn.iocoder.yudao.module.member.controller.admin.level.vo.level.MemberLevelUpdateReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelDO; import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelDO;
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
import cn.iocoder.yudao.module.member.enums.MemberExperienceBizTypeEnum; import cn.iocoder.yudao.module.member.enums.MemberExperienceBizTypeEnum;

View File

@ -6,9 +6,9 @@ import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.MemberLevelCreateReqVO; import cn.iocoder.yudao.module.member.controller.admin.level.vo.level.MemberLevelCreateReqVO;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.MemberLevelPageReqVO; import cn.iocoder.yudao.module.member.controller.admin.level.vo.level.MemberLevelPageReqVO;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.MemberLevelUpdateReqVO; import cn.iocoder.yudao.module.member.controller.admin.level.vo.level.MemberLevelUpdateReqVO;
import cn.iocoder.yudao.module.member.convert.level.MemberLevelConvert; import cn.iocoder.yudao.module.member.convert.level.MemberLevelConvert;
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelDO; import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelDO;
import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO;
@ -74,6 +74,7 @@ public class MemberLevelServiceImpl implements MemberLevelService {
@Override @Override
public void deleteLevel(Long id) { public void deleteLevel(Long id) {
// TODO @疯狂校验是否有用户使用该等级
// 校验存在 // 校验存在
validateLevelExists(id); validateLevelExists(id);
// 删除 // 删除

View File

@ -68,5 +68,6 @@ public interface MemberTagService {
* *
* @return 标签列表 * @return 标签列表
*/ */
List<MemberTagDO> getList(); List<MemberTagDO> getTagList();
} }

View File

@ -106,7 +106,7 @@ public class MemberTagServiceImpl implements MemberTagService {
} }
@Override @Override
public List<MemberTagDO> getList() { public List<MemberTagDO> getTagList() {
return tagMapper.selectList(); return tagMapper.selectList();
} }

View File

@ -184,8 +184,8 @@ public class MemberUserServiceImpl implements MemberUserService {
return passwordEncoder.encode(password); return passwordEncoder.encode(password);
} }
@Transactional(rollbackFor = Exception.class)
@Override @Override
@Transactional(rollbackFor = Exception.class)
public void updateUser(MemberUserUpdateReqVO updateReqVO) { public void updateUser(MemberUserUpdateReqVO updateReqVO) {
// 校验存在 // 校验存在
MemberUserDO user = validateUserExists(updateReqVO.getId()); MemberUserDO user = validateUserExists(updateReqVO.getId());
@ -197,6 +197,7 @@ public class MemberUserServiceImpl implements MemberUserService {
memberUserMapper.updateById(updateObj); memberUserMapper.updateById(updateObj);
// 会员级别修改 // 会员级别修改
// TODO @疯狂修改用户等级要不要单独一个前端操作 + 接口因为它是个相对严肃独立的动作
memberLevelService.updateUserLevel(user, updateReqVO.getLevelId(), updateReqVO.getLevelReason()); memberLevelService.updateUserLevel(user, updateReqVO.getLevelId(), updateReqVO.getLevelReason());
} }

View File

@ -4,9 +4,9 @@ import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils; import cn.iocoder.yudao.framework.common.util.collection.ArrayUtils;
import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest; import cn.iocoder.yudao.framework.test.core.ut.BaseDbUnitTest;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.MemberLevelCreateReqVO; import cn.iocoder.yudao.module.member.controller.admin.level.vo.level.MemberLevelCreateReqVO;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.MemberLevelPageReqVO; import cn.iocoder.yudao.module.member.controller.admin.level.vo.level.MemberLevelPageReqVO;
import cn.iocoder.yudao.module.member.controller.admin.level.vo.MemberLevelUpdateReqVO; import cn.iocoder.yudao.module.member.controller.admin.level.vo.level.MemberLevelUpdateReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelDO; import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelDO;
import cn.iocoder.yudao.module.member.dal.mysql.level.MemberLevelMapper; import cn.iocoder.yudao.module.member.dal.mysql.level.MemberLevelMapper;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@ -25,6 +25,7 @@ import static cn.iocoder.yudao.framework.test.core.util.RandomUtils.*;
import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*; import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;
// TODO 芋艿完全 review 在去 review 单测
/** /**
* {@link MemberLevelServiceImpl} 的单元测试类 * {@link MemberLevelServiceImpl} 的单元测试类
* *