mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-25 16:51:52 +08:00
增加 app 的签到 mock 接口、积分记录分页、签到记录分页
This commit is contained in:
parent
c3e4e23459
commit
0d1fc1138a
10
pom.xml
10
pom.xml
@ -16,11 +16,11 @@
|
||||
<module>yudao-module-member</module>
|
||||
<module>yudao-module-system</module>
|
||||
<module>yudao-module-infra</module>
|
||||
<!-- <module>yudao-module-pay</module>-->
|
||||
<!-- <module>yudao-module-bpm</module>-->
|
||||
<!-- <module>yudao-module-report</module>-->
|
||||
<!-- <module>yudao-module-mp</module>-->
|
||||
<!-- <module>yudao-module-mall</module>-->
|
||||
<module>yudao-module-pay</module>
|
||||
<module>yudao-module-bpm</module>
|
||||
<module>yudao-module-report</module>
|
||||
<module>yudao-module-mp</module>
|
||||
<module>yudao-module-mall</module>
|
||||
<!-- 示例项目 -->
|
||||
<module>yudao-example</module>
|
||||
</modules>
|
||||
|
@ -29,16 +29,16 @@ public class MemberPointConfigController {
|
||||
@PutMapping("/save")
|
||||
@Operation(summary = "保存会员积分配置")
|
||||
@PreAuthorize("@ss.hasPermission('point:config:save')")
|
||||
public CommonResult<Boolean> updateConfig(@Valid @RequestBody MemberPointConfigSaveReqVO saveReqVO) {
|
||||
memberPointConfigService.saveConfig(saveReqVO);
|
||||
public CommonResult<Boolean> savePointConfig(@Valid @RequestBody MemberPointConfigSaveReqVO saveReqVO) {
|
||||
memberPointConfigService.savePointConfig(saveReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得会员积分配置")
|
||||
@PreAuthorize("@ss.hasPermission('point:config:query')")
|
||||
public CommonResult<MemberPointConfigRespVO> getConfig() {
|
||||
MemberPointConfigDO config = memberPointConfigService.getConfig();
|
||||
public CommonResult<MemberPointConfigRespVO> getPointConfig() {
|
||||
MemberPointConfigDO config = memberPointConfigService.getPointConfig();
|
||||
return success(MemberPointConfigConvert.INSTANCE.convert(config));
|
||||
}
|
||||
|
||||
|
@ -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.util.collection.CollectionUtils.convertSet;
|
||||
|
||||
@Tag(name = "管理后台 - 签到记录")
|
||||
@RestController
|
||||
@RequestMapping("/member/point/record")
|
||||
@Validated
|
||||
@ -39,9 +40,9 @@ public class MemberPointRecordController {
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得用户积分记录分页")
|
||||
@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())) {
|
||||
return success(PageResult.empty(pageResult.getTotal()));
|
||||
}
|
||||
|
@ -20,9 +20,10 @@ import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
// TODO 芋艿:url
|
||||
@Tag(name = "管理后台 - 签到规则")
|
||||
@RestController
|
||||
@RequestMapping("/member/point/sign-in-config")
|
||||
@RequestMapping("/member/sign-in/config")
|
||||
@Validated
|
||||
public class MemberSignInConfigController {
|
||||
|
||||
@ -66,8 +67,8 @@ public class MemberSignInConfigController {
|
||||
@Operation(summary = "获得签到规则列表")
|
||||
@PreAuthorize("@ss.hasPermission('point:sign-in-config:query')")
|
||||
public CommonResult<List<MemberSignInConfigRespVO>> getSignInConfigList() {
|
||||
List<MemberSignInConfigDO> pageResult = signInConfigService.getSignInConfigList();
|
||||
return success(MemberSignInConfigConvert.INSTANCE.convertList(pageResult));
|
||||
List<MemberSignInConfigDO> list = signInConfigService.getSignInConfigList();
|
||||
return success(MemberSignInConfigConvert.INSTANCE.convertList(list));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.
|
||||
|
||||
@Tag(name = "管理后台 - 签到记录")
|
||||
@RestController
|
||||
@RequestMapping("/member/point/sign-in-record")
|
||||
@RequestMapping("/member/sign-in/record")
|
||||
@Validated
|
||||
public class MemberSignInRecordController {
|
||||
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
}
|
@ -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));
|
||||
}
|
||||
|
||||
}
|
@ -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));
|
||||
}
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
}
|
@ -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;
|
||||
|
||||
}
|
@ -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.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.app.point.vo.AppMemberPointRecordRespVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointRecordDO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
@ -33,4 +34,6 @@ public interface MemberPointRecordConvert {
|
||||
}
|
||||
PageResult<MemberPointRecordRespVO> convertPage(PageResult<MemberPointRecordDO> pageResult);
|
||||
|
||||
PageResult<AppMemberPointRecordRespVO> convertPage02(PageResult<MemberPointRecordDO> pageResult);
|
||||
|
||||
}
|
||||
|
@ -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.MemberSignInConfigRespVO;
|
||||
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 org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
@ -27,4 +28,6 @@ public interface MemberSignInConfigConvert {
|
||||
|
||||
List<MemberSignInConfigRespVO> convertList(List<MemberSignInConfigDO> list);
|
||||
|
||||
List<AppMemberSignInConfigRespVO> convertList02(List<MemberSignInConfigDO> list);
|
||||
|
||||
}
|
||||
|
@ -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.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.app.signin.vo.record.AppMemberSignInRecordRespVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
@ -33,4 +34,6 @@ public interface MemberSignInRecordConvert {
|
||||
}
|
||||
PageResult<MemberSignInRecordRespVO> convertPage(PageResult<MemberSignInRecordDO> pageResult);
|
||||
|
||||
PageResult<AppMemberSignInRecordRespVO> convertPage02(PageResult<MemberSignInRecordDO> pageResult);
|
||||
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ import lombok.*;
|
||||
public class MemberSignInRecordDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 签到自增id
|
||||
* 编号
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
@ -109,6 +109,7 @@ public class MemberUserDO extends TenantBaseDO {
|
||||
* 积分
|
||||
*/
|
||||
private Integer point;
|
||||
// TODO 芋艿:增加一个 totalPoint;个人信息接口要返回
|
||||
|
||||
/**
|
||||
* 会员标签列表,以逗号分隔
|
||||
|
@ -1,5 +1,6 @@
|
||||
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.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
@ -25,4 +26,10 @@ public interface MemberPointRecordMapper extends BaseMapperX<MemberPointRecordDO
|
||||
.orderByDesc(MemberPointRecordDO::getId));
|
||||
}
|
||||
|
||||
default PageResult<MemberPointRecordDO> selectPage(Long userId, PageParam pageVO) {
|
||||
return selectPage(pageVO, new LambdaQueryWrapperX<MemberPointRecordDO>()
|
||||
.eq(MemberPointRecordDO::getUserId, userId)
|
||||
.orderByDesc(MemberPointRecordDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -4,6 +4,8 @@ import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInConfigDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 签到规则 Mapper
|
||||
*
|
||||
@ -16,4 +18,7 @@ public interface MemberSignInConfigMapper extends BaseMapperX<MemberSignInConfig
|
||||
return selectOne(MemberSignInConfigDO::getDay, day);
|
||||
}
|
||||
|
||||
default List<MemberSignInConfigDO> selectListByStatus(Integer status) {
|
||||
return selectList(MemberSignInConfigDO::getStatus, status);
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
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.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
@ -25,4 +26,10 @@ public interface MemberSignInRecordMapper extends BaseMapperX<MemberSignInRecord
|
||||
.orderByDesc(MemberSignInRecordDO::getId));
|
||||
}
|
||||
|
||||
default PageResult<MemberSignInRecordDO> selectPage(Long userId, PageParam pageParam) {
|
||||
return selectPage(pageParam, new LambdaQueryWrapperX<MemberSignInRecordDO>()
|
||||
.eq(MemberSignInRecordDO::getUserId, userId)
|
||||
.orderByDesc(MemberSignInRecordDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -17,13 +17,13 @@ public interface MemberPointConfigService {
|
||||
*
|
||||
* @param saveReqVO 更新信息
|
||||
*/
|
||||
void saveConfig(@Valid MemberPointConfigSaveReqVO saveReqVO);
|
||||
void savePointConfig(@Valid MemberPointConfigSaveReqVO saveReqVO);
|
||||
|
||||
/**
|
||||
* 获得会员积分配置
|
||||
*
|
||||
* @return 积分配置
|
||||
*/
|
||||
MemberPointConfigDO getConfig();
|
||||
MemberPointConfigDO getPointConfig();
|
||||
|
||||
}
|
||||
|
@ -24,9 +24,9 @@ public class MemberPointConfigServiceImpl implements MemberPointConfigService {
|
||||
private MemberPointConfigMapper pointConfigMapper;
|
||||
|
||||
@Override
|
||||
public void saveConfig(MemberPointConfigSaveReqVO saveReqVO) {
|
||||
public void savePointConfig(MemberPointConfigSaveReqVO saveReqVO) {
|
||||
// 存在,则进行更新
|
||||
MemberPointConfigDO dbConfig = getConfig();
|
||||
MemberPointConfigDO dbConfig = getPointConfig();
|
||||
if (dbConfig != null) {
|
||||
pointConfigMapper.updateById(MemberPointConfigConvert.INSTANCE.convert(saveReqVO).setId(dbConfig.getId()));
|
||||
return;
|
||||
@ -36,7 +36,7 @@ public class MemberPointConfigServiceImpl implements MemberPointConfigService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public MemberPointConfigDO getConfig() {
|
||||
public MemberPointConfigDO getPointConfig() {
|
||||
List<MemberPointConfigDO> list = pointConfigMapper.selectList();
|
||||
return CollectionUtils.getFirst(list);
|
||||
}
|
||||
|
@ -1,11 +1,10 @@
|
||||
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.module.member.controller.admin.point.vo.recrod.MemberPointRecordPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.point.MemberPointRecordDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 用户积分记录 Service 接口
|
||||
*
|
||||
@ -14,11 +13,20 @@ import javax.validation.Valid;
|
||||
public interface MemberPointRecordService {
|
||||
|
||||
/**
|
||||
* 获得用户积分记录分页
|
||||
* 【管理员】获得积分记录分页
|
||||
*
|
||||
* @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);
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
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.module.member.api.user.MemberUserApi;
|
||||
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
|
||||
*/
|
||||
@ -34,7 +35,7 @@ public class MemberPointRecordServiceImpl implements MemberPointRecordService {
|
||||
private MemberUserApi memberUserApi;
|
||||
|
||||
@Override
|
||||
public PageResult<MemberPointRecordDO> getRecordPage(MemberPointRecordPageReqVO pageReqVO) {
|
||||
public PageResult<MemberPointRecordDO> getPointRecordPage(MemberPointRecordPageReqVO pageReqVO) {
|
||||
// 根据用户昵称查询出用户 ids
|
||||
Set<Long> userIds = null;
|
||||
if (StringUtils.isNotBlank(pageReqVO.getNickname())) {
|
||||
@ -49,4 +50,9 @@ public class MemberPointRecordServiceImpl implements MemberPointRecordService {
|
||||
return recordMapper.selectPage(pageReqVO, userIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<MemberPointRecordDO> getPointRecordPage(Long userId, PageParam pageVO) {
|
||||
return recordMapper.selectPage(userId, pageVO);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -45,10 +45,18 @@ public interface MemberSignInConfigService {
|
||||
MemberSignInConfigDO getSignInConfig(Long id);
|
||||
|
||||
/**
|
||||
* 获得签到规则分页
|
||||
* 获得签到规则列表
|
||||
*
|
||||
* @return 签到规则分页
|
||||
*/
|
||||
List<MemberSignInConfigDO> getSignInConfigList();
|
||||
|
||||
/**
|
||||
* 获得签到规则列表
|
||||
*
|
||||
* @param status 状态
|
||||
* @return 签到规则分页
|
||||
*/
|
||||
List<MemberSignInConfigDO> getSignInConfigList(Integer status);
|
||||
|
||||
}
|
||||
|
@ -96,4 +96,11 @@ public class MemberSignInConfigServiceImpl implements MemberSignInConfigService
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MemberSignInConfigDO> getSignInConfigList(Integer status) {
|
||||
List<MemberSignInConfigDO> list = signInConfigMapper.selectListByStatus(status);
|
||||
list.sort(Comparator.comparing(MemberSignInConfigDO::getDay));
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
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.module.member.controller.admin.signin.vo.record.MemberSignInRecordPageReqVO;
|
||||
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 {
|
||||
|
||||
/**
|
||||
* 获得签到记录分页
|
||||
* 【管理员】获得签到记录分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 签到记录分页
|
||||
*/
|
||||
PageResult<MemberSignInRecordDO> getSignInRecordPage(MemberSignInRecordPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 【会员】获得签到记录分页
|
||||
*
|
||||
* @param userId 用户编号
|
||||
* @param pageParam 分页查询
|
||||
* @return 签到记录分页
|
||||
*/
|
||||
PageResult<MemberSignInRecordDO> getSignRecordPage(Long userId, PageParam pageParam);
|
||||
|
||||
}
|
||||
|
@ -1,9 +1,11 @@
|
||||
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.module.member.api.user.MemberUserApi;
|
||||
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.app.signin.vo.record.AppMemberSignInRecordRespVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.signin.MemberSignInRecordDO;
|
||||
import cn.iocoder.yudao.module.member.dal.mysql.signin.MemberSignInRecordMapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@ -48,4 +50,9 @@ public class MemberSignInRecordServiceImpl implements MemberSignInRecordService
|
||||
return signInRecordMapper.selectPage(pageReqVO, userIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<MemberSignInRecordDO> getSignRecordPage(Long userId, PageParam pageParam) {
|
||||
return signInRecordMapper.selectPage(userId, pageParam);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -54,11 +54,11 @@
|
||||
<!-- <version>${revision}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- 支付服务。默认注释,保证编译速度 -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cn.iocoder.boot</groupId>-->
|
||||
<!-- <artifactId>yudao-module-pay-biz</artifactId>-->
|
||||
<!-- <version>${revision}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-pay-biz</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 微信公众号模块。默认注释,保证编译速度 -->
|
||||
<!-- <dependency>-->
|
||||
@ -68,21 +68,21 @@
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!-- 商城相关模块。默认注释,保证编译速度 -->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cn.iocoder.boot</groupId>-->
|
||||
<!-- <artifactId>yudao-module-promotion-biz</artifactId>-->
|
||||
<!-- <version>${revision}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cn.iocoder.boot</groupId>-->
|
||||
<!-- <artifactId>yudao-module-product-biz</artifactId>-->
|
||||
<!-- <version>${revision}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>cn.iocoder.boot</groupId>-->
|
||||
<!-- <artifactId>yudao-module-trade-biz</artifactId>-->
|
||||
<!-- <version>${revision}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-promotion-biz</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-product-biz</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.boot</groupId>
|
||||
<artifactId>yudao-module-trade-biz</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- spring boot 配置所需依赖 -->
|
||||
<dependency>
|
||||
|
Loading…
Reference in New Issue
Block a user