code review:获取用户积分记录 接口增加对userId 的支持,获取用户签到记录接口增加对userId的支持

This commit is contained in:
YunaiV 2023-08-23 00:48:33 +08:00
parent 175d244dee
commit 60875a0472
6 changed files with 4 additions and 11 deletions

View File

@ -15,7 +15,7 @@ public class MemberPointRecordPageReqVO extends PageParam {
@Schema(description = "用户昵称", example = "张三") @Schema(description = "用户昵称", example = "张三")
private String nickname; private String nickname;
@Schema(description = "用户ID", example = "123") @Schema(description = "用户编号", example = "123")
private Long userId; private Long userId;
@Schema(description = "业务类型", example = "1") @Schema(description = "业务类型", example = "1")

View File

@ -23,7 +23,7 @@ public class MemberSignInRecordPageReqVO extends PageParam {
@Schema(description = "第几天签到", example = "10") @Schema(description = "第几天签到", example = "10")
private Integer day; private Integer day;
@Schema(description = "用户ID", example = "123") @Schema(description = "用户编号", example = "123")
private Long userId; private Long userId;
@Schema(description = "签到时间") @Schema(description = "签到时间")

View File

@ -21,6 +21,7 @@ public interface MemberPointRecordMapper extends BaseMapperX<MemberPointRecordDO
default PageResult<MemberPointRecordDO> selectPage(MemberPointRecordPageReqVO reqVO, Set<Long> userIds) { default PageResult<MemberPointRecordDO> selectPage(MemberPointRecordPageReqVO reqVO, Set<Long> userIds) {
return selectPage(reqVO, new LambdaQueryWrapperX<MemberPointRecordDO>() return selectPage(reqVO, new LambdaQueryWrapperX<MemberPointRecordDO>()
.inIfPresent(MemberPointRecordDO::getUserId, userIds) .inIfPresent(MemberPointRecordDO::getUserId, userIds)
.eqIfPresent(MemberPointRecordDO::getUserId, reqVO.getUserId())
.eqIfPresent(MemberPointRecordDO::getBizType, reqVO.getBizType()) .eqIfPresent(MemberPointRecordDO::getBizType, reqVO.getBizType())
.likeIfPresent(MemberPointRecordDO::getTitle, reqVO.getTitle()) .likeIfPresent(MemberPointRecordDO::getTitle, reqVO.getTitle())
.orderByDesc(MemberPointRecordDO::getId)); .orderByDesc(MemberPointRecordDO::getId));

View File

@ -21,6 +21,7 @@ public interface MemberSignInRecordMapper extends BaseMapperX<MemberSignInRecord
default PageResult<MemberSignInRecordDO> selectPage(MemberSignInRecordPageReqVO reqVO, Set<Long> userIds) { default PageResult<MemberSignInRecordDO> selectPage(MemberSignInRecordPageReqVO reqVO, Set<Long> userIds) {
return selectPage(reqVO, new LambdaQueryWrapperX<MemberSignInRecordDO>() return selectPage(reqVO, new LambdaQueryWrapperX<MemberSignInRecordDO>()
.inIfPresent(MemberSignInRecordDO::getUserId, userIds) .inIfPresent(MemberSignInRecordDO::getUserId, userIds)
.eqIfPresent(MemberSignInRecordDO::getUserId, reqVO.getUserId())
.eqIfPresent(MemberSignInRecordDO::getDay, reqVO.getDay()) .eqIfPresent(MemberSignInRecordDO::getDay, reqVO.getDay())
.betweenIfPresent(MemberSignInRecordDO::getCreateTime, reqVO.getCreateTime()) .betweenIfPresent(MemberSignInRecordDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(MemberSignInRecordDO::getId)); .orderByDesc(MemberSignInRecordDO::getId));

View File

@ -7,7 +7,6 @@ import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordPageReqVO; import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordPageReqVO;
import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointRecordDO; import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointRecordDO;
import cn.iocoder.yudao.module.member.dal.mysql.point.MemberPointRecordMapper; import cn.iocoder.yudao.module.member.dal.mysql.point.MemberPointRecordMapper;
import com.google.common.collect.Sets;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
@ -47,9 +46,6 @@ public class MemberPointRecordServiceImpl implements MemberPointRecordService {
} }
userIds = convertSet(users, MemberUserRespDTO::getId); userIds = convertSet(users, MemberUserRespDTO::getId);
} }
if (pageReqVO.getUserId() != null) {
userIds = Sets.newHashSet(pageReqVO.getUserId());
}
// 执行查询 // 执行查询
return recordMapper.selectPage(pageReqVO, userIds); return recordMapper.selectPage(pageReqVO, userIds);
} }

View File

@ -5,10 +5,8 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.api.user.MemberUserApi; import cn.iocoder.yudao.module.member.api.user.MemberUserApi;
import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO;
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.record.MemberSignInRecordPageReqVO; import cn.iocoder.yudao.module.member.controller.admin.signin.vo.record.MemberSignInRecordPageReqVO;
import cn.iocoder.yudao.module.member.controller.app.signin.vo.record.AppMemberSignInRecordRespVO;
import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO; import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO;
import cn.iocoder.yudao.module.member.dal.mysql.signin.MemberSignInRecordMapper; import cn.iocoder.yudao.module.member.dal.mysql.signin.MemberSignInRecordMapper;
import com.google.common.collect.Sets;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
@ -47,9 +45,6 @@ public class MemberSignInRecordServiceImpl implements MemberSignInRecordService
} }
userIds = convertSet(users, MemberUserRespDTO::getId); userIds = convertSet(users, MemberUserRespDTO::getId);
} }
if (pageReqVO.getUserId() != null) {
userIds = Sets.newHashSet(pageReqVO.getUserId());
}
// 分页查询 // 分页查询
return signInRecordMapper.selectPage(pageReqVO, userIds); return signInRecordMapper.selectPage(pageReqVO, userIds);
} }