增加 app 的签到 mock 接口、积分记录分页、签到记录分页

This commit is contained in:
YunaiV 2023-08-21 22:20:59 +08:00
parent c3e4e23459
commit 0d1fc1138a
29 changed files with 355 additions and 50 deletions

10
pom.xml
View File

@ -16,11 +16,11 @@
<module>yudao-module-member</module> <module>yudao-module-member</module>
<module>yudao-module-system</module> <module>yudao-module-system</module>
<module>yudao-module-infra</module> <module>yudao-module-infra</module>
<!-- <module>yudao-module-pay</module>--> <module>yudao-module-pay</module>
<!-- <module>yudao-module-bpm</module>--> <module>yudao-module-bpm</module>
<!-- <module>yudao-module-report</module>--> <module>yudao-module-report</module>
<!-- <module>yudao-module-mp</module>--> <module>yudao-module-mp</module>
<!-- <module>yudao-module-mall</module>--> <module>yudao-module-mall</module>
<!-- 示例项目 --> <!-- 示例项目 -->
<module>yudao-example</module> <module>yudao-example</module>
</modules> </modules>

View File

@ -29,16 +29,16 @@ public class MemberPointConfigController {
@PutMapping("/save") @PutMapping("/save")
@Operation(summary = "保存会员积分配置") @Operation(summary = "保存会员积分配置")
@PreAuthorize("@ss.hasPermission('point:config:save')") @PreAuthorize("@ss.hasPermission('point:config:save')")
public CommonResult<Boolean> updateConfig(@Valid @RequestBody MemberPointConfigSaveReqVO saveReqVO) { public CommonResult<Boolean> savePointConfig(@Valid @RequestBody MemberPointConfigSaveReqVO saveReqVO) {
memberPointConfigService.saveConfig(saveReqVO); memberPointConfigService.savePointConfig(saveReqVO);
return success(true); return success(true);
} }
@GetMapping("/get") @GetMapping("/get")
@Operation(summary = "获得会员积分配置") @Operation(summary = "获得会员积分配置")
@PreAuthorize("@ss.hasPermission('point:config:query')") @PreAuthorize("@ss.hasPermission('point:config:query')")
public CommonResult<MemberPointConfigRespVO> getConfig() { public CommonResult<MemberPointConfigRespVO> getPointConfig() {
MemberPointConfigDO config = memberPointConfigService.getConfig(); MemberPointConfigDO config = memberPointConfigService.getPointConfig();
return success(MemberPointConfigConvert.INSTANCE.convert(config)); return success(MemberPointConfigConvert.INSTANCE.convert(config));
} }

View File

@ -25,6 +25,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.common.util.collection.CollectionUtils.convertSet; import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertSet;
@Tag(name = "管理后台 - 签到记录")
@RestController @RestController
@RequestMapping("/member/point/record") @RequestMapping("/member/point/record")
@Validated @Validated
@ -39,9 +40,9 @@ public class MemberPointRecordController {
@GetMapping("/page") @GetMapping("/page")
@Operation(summary = "获得用户积分记录分页") @Operation(summary = "获得用户积分记录分页")
@PreAuthorize("@ss.hasPermission('point:record:query')") @PreAuthorize("@ss.hasPermission('point:record:query')")
public CommonResult<PageResult<MemberPointRecordRespVO>> getRecordPage(@Valid MemberPointRecordPageReqVO pageVO) { public CommonResult<PageResult<MemberPointRecordRespVO>> getPointRecordPage(@Valid MemberPointRecordPageReqVO pageVO) {
// 执行分页查询 // 执行分页查询
PageResult<MemberPointRecordDO> pageResult = pointRecordService.getRecordPage(pageVO); PageResult<MemberPointRecordDO> pageResult = pointRecordService.getPointRecordPage(pageVO);
if (CollectionUtils.isEmpty(pageResult.getList())) { if (CollectionUtils.isEmpty(pageResult.getList())) {
return success(PageResult.empty(pageResult.getTotal())); return success(PageResult.empty(pageResult.getTotal()));
} }

View File

@ -20,9 +20,10 @@ import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
// TODO 芋艿url
@Tag(name = "管理后台 - 签到规则") @Tag(name = "管理后台 - 签到规则")
@RestController @RestController
@RequestMapping("/member/point/sign-in-config") @RequestMapping("/member/sign-in/config")
@Validated @Validated
public class MemberSignInConfigController { public class MemberSignInConfigController {
@ -66,8 +67,8 @@ public class MemberSignInConfigController {
@Operation(summary = "获得签到规则列表") @Operation(summary = "获得签到规则列表")
@PreAuthorize("@ss.hasPermission('point:sign-in-config:query')") @PreAuthorize("@ss.hasPermission('point:sign-in-config:query')")
public CommonResult<List<MemberSignInConfigRespVO>> getSignInConfigList() { public CommonResult<List<MemberSignInConfigRespVO>> getSignInConfigList() {
List<MemberSignInConfigDO> pageResult = signInConfigService.getSignInConfigList(); List<MemberSignInConfigDO> list = signInConfigService.getSignInConfigList();
return success(MemberSignInConfigConvert.INSTANCE.convertList(pageResult)); return success(MemberSignInConfigConvert.INSTANCE.convertList(list));
} }
} }

View File

@ -27,7 +27,7 @@ import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.
@Tag(name = "管理后台 - 签到记录") @Tag(name = "管理后台 - 签到记录")
@RestController @RestController
@RequestMapping("/member/point/sign-in-record") @RequestMapping("/member/sign-in/record")
@Validated @Validated
public class MemberSignInRecordController { public class MemberSignInRecordController {

View File

@ -0,0 +1,39 @@
package cn.iocoder.yudao.module.member.controller.app.point;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.controller.app.point.vo.AppMemberPointRecordRespVO;
import cn.iocoder.yudao.module.member.convert.point.MemberPointRecordConvert;
import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointRecordDO;
import cn.iocoder.yudao.module.member.service.point.MemberPointRecordService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
@Tag(name = "用户 App - 签到记录")
@RestController
@RequestMapping("/member/point/record")
@Validated
public class AppMemberPointRecordController {
@Resource
private MemberPointRecordService pointRecordService;
@GetMapping("/page")
@Operation(summary = "获得用户积分记录分页")
public CommonResult<PageResult<AppMemberPointRecordRespVO>> getPointRecordPage(@Valid PageParam pageVO) {
PageResult<MemberPointRecordDO> pageResult = pointRecordService.getPointRecordPage(getLoginUserId(), pageVO);
return success(MemberPointRecordConvert.INSTANCE.convertPage02(pageResult));
}
}

View File

@ -0,0 +1,27 @@
package cn.iocoder.yudao.module.member.controller.app.point.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Schema(description = "用户 App - 用户积分记录 Response VO")
@Data
public class AppMemberPointRecordRespVO {
@Schema(description = "自增主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "31457")
private Long id;;
@Schema(description = "积分标题", requiredMode = Schema.RequiredMode.REQUIRED, example = "你猜")
private String title;
@Schema(description = "积分描述", example = "你猜")
private String description;
@Schema(description = "积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
private Integer point;
@Schema(description = "发生时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
}

View File

@ -0,0 +1,37 @@
package cn.iocoder.yudao.module.member.controller.app.signin;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.member.controller.app.signin.vo.config.AppMemberSignInConfigRespVO;
import cn.iocoder.yudao.module.member.convert.signin.MemberSignInConfigConvert;
import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO;
import cn.iocoder.yudao.module.member.service.signin.MemberSignInConfigService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Tag(name = "用户 App - 签到规则")
@RestController
@RequestMapping("/member/sign-in/config")
@Validated
public class AppMemberSignInConfigController {
@Resource
private MemberSignInConfigService signInConfigService;
@GetMapping("/list")
@Operation(summary = "获得签到规则列表")
public CommonResult<List<AppMemberSignInConfigRespVO>> getSignInConfigList() {
List<MemberSignInConfigDO> pageResult = signInConfigService.getSignInConfigList(CommonStatusEnum.ENABLE.getStatus());
return success(MemberSignInConfigConvert.INSTANCE.convertList02(pageResult));
}
}

View File

@ -0,0 +1,69 @@
package cn.iocoder.yudao.module.member.controller.app.signin;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.member.controller.app.signin.vo.record.AppMemberSignInRecordRespVO;
import cn.iocoder.yudao.module.member.controller.app.signin.vo.record.AppMemberSignInRecordSummaryRespVO;
import cn.iocoder.yudao.module.member.convert.signin.MemberSignInRecordConvert;
import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO;
import cn.iocoder.yudao.module.member.service.signin.MemberSignInRecordService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
@Tag(name = "管理后台 - 签到记录")
@RestController
@RequestMapping("/member/sign-in/record")
@Validated
public class AppMemberSignInRecordController {
@Resource
private MemberSignInRecordService signInRecordService;
// TODO 芋艿临时 mock => UserSignController.getUserInfo
@GetMapping("/get-summary")
@Operation(summary = "获得个人签到统计")
public CommonResult<AppMemberSignInRecordSummaryRespVO> getSignInRecordSummary() {
AppMemberSignInRecordSummaryRespVO respVO = new AppMemberSignInRecordSummaryRespVO();
if (false) {
respVO.setTotalDay(100);
respVO.setContinuousDay(5);
respVO.setTodaySignIn(true);
} else {
respVO.setTotalDay(100);
respVO.setContinuousDay(10);
respVO.setTodaySignIn(false);
}
return success(respVO);
}
// TODO 芋艿临时 mock => UserSignController.info
@PostMapping("/create")
@Operation(summary = "签到")
public CommonResult<AppMemberSignInRecordRespVO> createSignInRecord() {
AppMemberSignInRecordRespVO respVO = new AppMemberSignInRecordRespVO()
.setPoint(10)
.setDay(10)
.setCreateTime(LocalDateTime.now());
return success(respVO);
}
@GetMapping("/page")
@Operation(summary = "获得签到记录分页")
public CommonResult<PageResult<AppMemberSignInRecordRespVO>> getSignRecordPage(PageParam pageParam) {
PageResult<MemberSignInRecordDO> pageResult = signInRecordService.getSignRecordPage(getLoginUserId(), pageParam);
return success(MemberSignInRecordConvert.INSTANCE.convertPage02(pageResult));
}
}

View File

@ -0,0 +1,16 @@
package cn.iocoder.yudao.module.member.controller.app.signin.vo.config;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "用户 App - 签到规则 Response VO")
@Data
public class AppMemberSignInConfigRespVO {
@Schema(description = "签到第 x 天", requiredMode = Schema.RequiredMode.REQUIRED, example = "7")
private Integer day;
@Schema(description = "奖励积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
private Integer point;
}

View File

@ -0,0 +1,21 @@
package cn.iocoder.yudao.module.member.controller.app.signin.vo.record;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;
@Schema(description = "用户 App - 签到记录 Response VO")
@Data
public class AppMemberSignInRecordRespVO {
@Schema(description = "第几天签到", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
private Integer day;
@Schema(description = "签到的分数", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
private Integer point;
@Schema(description = "签到时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
}

View File

@ -0,0 +1,19 @@
package cn.iocoder.yudao.module.member.controller.app.signin.vo.record;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
@Schema(description = "用户 App - 个人签到统计 Response VO")
@Data
public class AppMemberSignInRecordSummaryRespVO {
@Schema(description = "总签到天数", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
private Integer totalDay;
@Schema(description = "连续签到第 x 天", requiredMode = Schema.RequiredMode.REQUIRED, example = "3")
private Integer continuousDay;
@Schema(description = "今天是否已签到", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
private Boolean todaySignIn;
}

View File

@ -4,6 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.collection.MapUtils; import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
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.point.vo.recrod.MemberPointRecordRespVO; import cn.iocoder.yudao.module.member.controller.admin.point.vo.recrod.MemberPointRecordRespVO;
import cn.iocoder.yudao.module.member.controller.app.point.vo.AppMemberPointRecordRespVO;
import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointRecordDO; import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointRecordDO;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers; import org.mapstruct.factory.Mappers;
@ -33,4 +34,6 @@ public interface MemberPointRecordConvert {
} }
PageResult<MemberPointRecordRespVO> convertPage(PageResult<MemberPointRecordDO> pageResult); PageResult<MemberPointRecordRespVO> convertPage(PageResult<MemberPointRecordDO> pageResult);
PageResult<AppMemberPointRecordRespVO> convertPage02(PageResult<MemberPointRecordDO> pageResult);
} }

View File

@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.member.convert.signin;
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.config.MemberSignInConfigCreateReqVO; import cn.iocoder.yudao.module.member.controller.admin.signin.vo.config.MemberSignInConfigCreateReqVO;
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.config.MemberSignInConfigRespVO; import cn.iocoder.yudao.module.member.controller.admin.signin.vo.config.MemberSignInConfigRespVO;
import cn.iocoder.yudao.module.member.controller.admin.signin.vo.config.MemberSignInConfigUpdateReqVO; import cn.iocoder.yudao.module.member.controller.admin.signin.vo.config.MemberSignInConfigUpdateReqVO;
import cn.iocoder.yudao.module.member.controller.app.signin.vo.config.AppMemberSignInConfigRespVO;
import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO; import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers; import org.mapstruct.factory.Mappers;
@ -27,4 +28,6 @@ public interface MemberSignInConfigConvert {
List<MemberSignInConfigRespVO> convertList(List<MemberSignInConfigDO> list); List<MemberSignInConfigRespVO> convertList(List<MemberSignInConfigDO> list);
List<AppMemberSignInConfigRespVO> convertList02(List<MemberSignInConfigDO> list);
} }

View File

@ -4,6 +4,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.collection.MapUtils; import cn.iocoder.yudao.framework.common.util.collection.MapUtils;
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.MemberSignInRecordRespVO; import cn.iocoder.yudao.module.member.controller.admin.signin.vo.record.MemberSignInRecordRespVO;
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 org.mapstruct.Mapper; import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers; import org.mapstruct.factory.Mappers;
@ -33,4 +34,6 @@ public interface MemberSignInRecordConvert {
} }
PageResult<MemberSignInRecordRespVO> convertPage(PageResult<MemberSignInRecordDO> pageResult); PageResult<MemberSignInRecordRespVO> convertPage(PageResult<MemberSignInRecordDO> pageResult);
PageResult<AppMemberSignInRecordRespVO> convertPage02(PageResult<MemberSignInRecordDO> pageResult);
} }

View File

@ -22,7 +22,7 @@ import lombok.*;
public class MemberSignInRecordDO extends BaseDO { public class MemberSignInRecordDO extends BaseDO {
/** /**
* 签到自增id * 编号
*/ */
@TableId @TableId
private Long id; private Long id;

View File

@ -109,6 +109,7 @@ public class MemberUserDO extends TenantBaseDO {
* 积分 * 积分
*/ */
private Integer point; private Integer point;
// TODO 芋艿增加一个 totalPoint个人信息接口要返回
/** /**
* 会员标签列表以逗号分隔 * 会员标签列表以逗号分隔

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.member.dal.mysql.point; package cn.iocoder.yudao.module.member.dal.mysql.point;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
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;
@ -25,4 +26,10 @@ public interface MemberPointRecordMapper extends BaseMapperX<MemberPointRecordDO
.orderByDesc(MemberPointRecordDO::getId)); .orderByDesc(MemberPointRecordDO::getId));
} }
default PageResult<MemberPointRecordDO> selectPage(Long userId, PageParam pageVO) {
return selectPage(pageVO, new LambdaQueryWrapperX<MemberPointRecordDO>()
.eq(MemberPointRecordDO::getUserId, userId)
.orderByDesc(MemberPointRecordDO::getId));
}
} }

View File

@ -4,6 +4,8 @@ import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO; import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/** /**
* 签到规则 Mapper * 签到规则 Mapper
* *
@ -16,4 +18,7 @@ public interface MemberSignInConfigMapper extends BaseMapperX<MemberSignInConfig
return selectOne(MemberSignInConfigDO::getDay, day); return selectOne(MemberSignInConfigDO::getDay, day);
} }
default List<MemberSignInConfigDO> selectListByStatus(Integer status) {
return selectList(MemberSignInConfigDO::getStatus, status);
}
} }

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.member.dal.mysql.signin; package cn.iocoder.yudao.module.member.dal.mysql.signin;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
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;
@ -25,4 +26,10 @@ public interface MemberSignInRecordMapper extends BaseMapperX<MemberSignInRecord
.orderByDesc(MemberSignInRecordDO::getId)); .orderByDesc(MemberSignInRecordDO::getId));
} }
default PageResult<MemberSignInRecordDO> selectPage(Long userId, PageParam pageParam) {
return selectPage(pageParam, new LambdaQueryWrapperX<MemberSignInRecordDO>()
.eq(MemberSignInRecordDO::getUserId, userId)
.orderByDesc(MemberSignInRecordDO::getId));
}
} }

View File

@ -17,13 +17,13 @@ public interface MemberPointConfigService {
* *
* @param saveReqVO 更新信息 * @param saveReqVO 更新信息
*/ */
void saveConfig(@Valid MemberPointConfigSaveReqVO saveReqVO); void savePointConfig(@Valid MemberPointConfigSaveReqVO saveReqVO);
/** /**
* 获得会员积分配置 * 获得会员积分配置
* *
* @return 积分配置 * @return 积分配置
*/ */
MemberPointConfigDO getConfig(); MemberPointConfigDO getPointConfig();
} }

View File

@ -24,9 +24,9 @@ public class MemberPointConfigServiceImpl implements MemberPointConfigService {
private MemberPointConfigMapper pointConfigMapper; private MemberPointConfigMapper pointConfigMapper;
@Override @Override
public void saveConfig(MemberPointConfigSaveReqVO saveReqVO) { public void savePointConfig(MemberPointConfigSaveReqVO saveReqVO) {
// 存在则进行更新 // 存在则进行更新
MemberPointConfigDO dbConfig = getConfig(); MemberPointConfigDO dbConfig = getPointConfig();
if (dbConfig != null) { if (dbConfig != null) {
pointConfigMapper.updateById(MemberPointConfigConvert.INSTANCE.convert(saveReqVO).setId(dbConfig.getId())); pointConfigMapper.updateById(MemberPointConfigConvert.INSTANCE.convert(saveReqVO).setId(dbConfig.getId()));
return; return;
@ -36,7 +36,7 @@ public class MemberPointConfigServiceImpl implements MemberPointConfigService {
} }
@Override @Override
public MemberPointConfigDO getConfig() { public MemberPointConfigDO getPointConfig() {
List<MemberPointConfigDO> list = pointConfigMapper.selectList(); List<MemberPointConfigDO> list = pointConfigMapper.selectList();
return CollectionUtils.getFirst(list); return CollectionUtils.getFirst(list);
} }

View File

@ -1,11 +1,10 @@
package cn.iocoder.yudao.module.member.service.point; package cn.iocoder.yudao.module.member.service.point;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
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 javax.validation.Valid;
/** /**
* 用户积分记录 Service 接口 * 用户积分记录 Service 接口
* *
@ -14,11 +13,20 @@ import javax.validation.Valid;
public interface MemberPointRecordService { public interface MemberPointRecordService {
/** /**
* 获得用户积分记录分页 * 管理员获得积分记录分页
* *
* @param pageReqVO 分页查询 * @param pageReqVO 分页查询
* @return 用户积分记录分页 * @return 签到记录分页
*/ */
PageResult<MemberPointRecordDO> getRecordPage(MemberPointRecordPageReqVO pageReqVO); PageResult<MemberPointRecordDO> getPointRecordPage(MemberPointRecordPageReqVO pageReqVO);
/**
* 会员获得积分记录分页
*
* @param userId 用户编号
* @param pageVO 分页查询
* @return 签到记录分页
*/
PageResult<MemberPointRecordDO> getPointRecordPage(Long userId, PageParam pageVO);
} }

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.member.service.point; package cn.iocoder.yudao.module.member.service.point;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult; 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;
@ -19,7 +20,7 @@ import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.
/** /**
* 用户积分记录 Service 实现类 * 积分记录 Service 实现类
* *
* @author QingX * @author QingX
*/ */
@ -34,7 +35,7 @@ public class MemberPointRecordServiceImpl implements MemberPointRecordService {
private MemberUserApi memberUserApi; private MemberUserApi memberUserApi;
@Override @Override
public PageResult<MemberPointRecordDO> getRecordPage(MemberPointRecordPageReqVO pageReqVO) { public PageResult<MemberPointRecordDO> getPointRecordPage(MemberPointRecordPageReqVO pageReqVO) {
// 根据用户昵称查询出用户 ids // 根据用户昵称查询出用户 ids
Set<Long> userIds = null; Set<Long> userIds = null;
if (StringUtils.isNotBlank(pageReqVO.getNickname())) { if (StringUtils.isNotBlank(pageReqVO.getNickname())) {
@ -49,4 +50,9 @@ public class MemberPointRecordServiceImpl implements MemberPointRecordService {
return recordMapper.selectPage(pageReqVO, userIds); return recordMapper.selectPage(pageReqVO, userIds);
} }
@Override
public PageResult<MemberPointRecordDO> getPointRecordPage(Long userId, PageParam pageVO) {
return recordMapper.selectPage(userId, pageVO);
}
} }

View File

@ -45,10 +45,18 @@ public interface MemberSignInConfigService {
MemberSignInConfigDO getSignInConfig(Long id); MemberSignInConfigDO getSignInConfig(Long id);
/** /**
* 获得签到规则分页 * 获得签到规则列表
* *
* @return 签到规则分页 * @return 签到规则分页
*/ */
List<MemberSignInConfigDO> getSignInConfigList(); List<MemberSignInConfigDO> getSignInConfigList();
/**
* 获得签到规则列表
*
* @param status 状态
* @return 签到规则分页
*/
List<MemberSignInConfigDO> getSignInConfigList(Integer status);
} }

View File

@ -96,4 +96,11 @@ public class MemberSignInConfigServiceImpl implements MemberSignInConfigService
return list; return list;
} }
@Override
public List<MemberSignInConfigDO> getSignInConfigList(Integer status) {
List<MemberSignInConfigDO> list = signInConfigMapper.selectListByStatus(status);
list.sort(Comparator.comparing(MemberSignInConfigDO::getDay));
return list;
}
} }

View File

@ -1,5 +1,6 @@
package cn.iocoder.yudao.module.member.service.signin; package cn.iocoder.yudao.module.member.service.signin;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
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.dal.dataobject.signin.MemberSignInRecordDO; import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO;
@ -12,11 +13,20 @@ import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO
public interface MemberSignInRecordService { public interface MemberSignInRecordService {
/** /**
* 获得签到记录分页 * 管理员获得签到记录分页
* *
* @param pageReqVO 分页查询 * @param pageReqVO 分页查询
* @return 签到记录分页 * @return 签到记录分页
*/ */
PageResult<MemberSignInRecordDO> getSignInRecordPage(MemberSignInRecordPageReqVO pageReqVO); PageResult<MemberSignInRecordDO> getSignInRecordPage(MemberSignInRecordPageReqVO pageReqVO);
/**
* 会员获得签到记录分页
*
* @param userId 用户编号
* @param pageParam 分页查询
* @return 签到记录分页
*/
PageResult<MemberSignInRecordDO> getSignRecordPage(Long userId, PageParam pageParam);
} }

View File

@ -1,9 +1,11 @@
package cn.iocoder.yudao.module.member.service.signin; package cn.iocoder.yudao.module.member.service.signin;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult; 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 org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -48,4 +50,9 @@ public class MemberSignInRecordServiceImpl implements MemberSignInRecordService
return signInRecordMapper.selectPage(pageReqVO, userIds); return signInRecordMapper.selectPage(pageReqVO, userIds);
} }
@Override
public PageResult<MemberSignInRecordDO> getSignRecordPage(Long userId, PageParam pageParam) {
return signInRecordMapper.selectPage(userId, pageParam);
}
} }

View File

@ -54,11 +54,11 @@
<!-- <version>${revision}</version>--> <!-- <version>${revision}</version>-->
<!-- </dependency>--> <!-- </dependency>-->
<!-- 支付服务。默认注释,保证编译速度 --> <!-- 支付服务。默认注释,保证编译速度 -->
<!-- <dependency>--> <dependency>
<!-- <groupId>cn.iocoder.boot</groupId>--> <groupId>cn.iocoder.boot</groupId>
<!-- <artifactId>yudao-module-pay-biz</artifactId>--> <artifactId>yudao-module-pay-biz</artifactId>
<!-- <version>${revision}</version>--> <version>${revision}</version>
<!-- </dependency>--> </dependency>
<!-- 微信公众号模块。默认注释,保证编译速度 --> <!-- 微信公众号模块。默认注释,保证编译速度 -->
<!-- <dependency>--> <!-- <dependency>-->
@ -68,21 +68,21 @@
<!-- </dependency>--> <!-- </dependency>-->
<!-- 商城相关模块。默认注释,保证编译速度 --> <!-- 商城相关模块。默认注释,保证编译速度 -->
<!-- <dependency>--> <dependency>
<!-- <groupId>cn.iocoder.boot</groupId>--> <groupId>cn.iocoder.boot</groupId>
<!-- <artifactId>yudao-module-promotion-biz</artifactId>--> <artifactId>yudao-module-promotion-biz</artifactId>
<!-- <version>${revision}</version>--> <version>${revision}</version>
<!-- </dependency>--> </dependency>
<!-- <dependency>--> <dependency>
<!-- <groupId>cn.iocoder.boot</groupId>--> <groupId>cn.iocoder.boot</groupId>
<!-- <artifactId>yudao-module-product-biz</artifactId>--> <artifactId>yudao-module-product-biz</artifactId>
<!-- <version>${revision}</version>--> <version>${revision}</version>
<!-- </dependency>--> </dependency>
<!-- <dependency>--> <dependency>
<!-- <groupId>cn.iocoder.boot</groupId>--> <groupId>cn.iocoder.boot</groupId>
<!-- <artifactId>yudao-module-trade-biz</artifactId>--> <artifactId>yudao-module-trade-biz</artifactId>
<!-- <version>${revision}</version>--> <version>${revision}</version>
<!-- </dependency>--> </dependency>
<!-- spring boot 配置所需依赖 --> <!-- spring boot 配置所需依赖 -->
<dependency> <dependency>