会员等级 app 接口
This commit is contained in:
parent
6132443d26
commit
ddcb3e69f9
|
@ -72,8 +72,8 @@ public class MemberLevelController {
|
|||
@GetMapping("/list")
|
||||
@Operation(summary = "获得会员等级列表")
|
||||
@PreAuthorize("@ss.hasPermission('member:level:query')")
|
||||
public CommonResult<List<MemberLevelRespVO>> getLevelList(@Valid MemberLevelListReqVO pageVO) {
|
||||
List<MemberLevelDO> result = levelService.getLevelList(pageVO);
|
||||
public CommonResult<List<MemberLevelRespVO>> getLevelList(@Valid MemberLevelListReqVO listReqVO) {
|
||||
List<MemberLevelDO> result = levelService.getLevelList(listReqVO);
|
||||
return success(MemberLevelConvert.INSTANCE.convertList(result));
|
||||
}
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@ 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.MemberLevelRecordPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.level.vo.log.MemberLevelRecordRespVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.level.vo.record.MemberLevelRecordPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.level.vo.record.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;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package cn.iocoder.yudao.module.member.controller.admin.level.vo.log;
|
||||
package cn.iocoder.yudao.module.member.controller.admin.level.vo.record;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.iocoder.yudao.module.member.controller.admin.level.vo.log;
|
||||
package cn.iocoder.yudao.module.member.controller.admin.level.vo.record;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
@ -1,4 +1,4 @@
|
|||
package cn.iocoder.yudao.module.member.controller.admin.level.vo.log;
|
||||
package cn.iocoder.yudao.module.member.controller.admin.level.vo.record;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
|
@ -1,6 +1,7 @@
|
|||
package cn.iocoder.yudao.module.member.controller.app.address;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
|
||||
import cn.iocoder.yudao.module.member.controller.app.address.vo.AppAddressCreateReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.app.address.vo.AppAddressRespVO;
|
||||
import cn.iocoder.yudao.module.member.controller.app.address.vo.AppAddressUpdateReqVO;
|
||||
|
@ -31,12 +32,14 @@ public class AppAddressController {
|
|||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建用户收件地址")
|
||||
@PreAuthenticated
|
||||
public CommonResult<Long> createAddress(@Valid @RequestBody AppAddressCreateReqVO createReqVO) {
|
||||
return success(addressService.createAddress(getLoginUserId(), createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新用户收件地址")
|
||||
@PreAuthenticated
|
||||
public CommonResult<Boolean> updateAddress(@Valid @RequestBody AppAddressUpdateReqVO updateReqVO) {
|
||||
addressService.updateAddress(getLoginUserId(), updateReqVO);
|
||||
return success(true);
|
||||
|
@ -45,6 +48,7 @@ public class AppAddressController {
|
|||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除用户收件地址")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthenticated
|
||||
public CommonResult<Boolean> deleteAddress(@RequestParam("id") Long id) {
|
||||
addressService.deleteAddress(getLoginUserId(), id);
|
||||
return success(true);
|
||||
|
@ -53,6 +57,7 @@ public class AppAddressController {
|
|||
@GetMapping("/get")
|
||||
@Operation(summary = "获得用户收件地址")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthenticated
|
||||
public CommonResult<AppAddressRespVO> getAddress(@RequestParam("id") Long id) {
|
||||
MemberAddressDO address = addressService.getAddress(getLoginUserId(), id);
|
||||
return success(AddressConvert.INSTANCE.convert(address));
|
||||
|
@ -60,6 +65,7 @@ public class AppAddressController {
|
|||
|
||||
@GetMapping("/get-default")
|
||||
@Operation(summary = "获得默认的用户收件地址")
|
||||
@PreAuthenticated
|
||||
public CommonResult<AppAddressRespVO> getDefaultUserAddress() {
|
||||
MemberAddressDO address = addressService.getDefaultUserAddress(getLoginUserId());
|
||||
return success(AddressConvert.INSTANCE.convert(address));
|
||||
|
@ -67,6 +73,7 @@ public class AppAddressController {
|
|||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得用户收件地址列表")
|
||||
@PreAuthenticated
|
||||
public CommonResult<List<AppAddressRespVO>> getAddressList() {
|
||||
List<MemberAddressDO> list = addressService.getAddressList(getLoginUserId());
|
||||
return success(AddressConvert.INSTANCE.convertList(list));
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
package cn.iocoder.yudao.module.member.controller.app.level;
|
||||
|
||||
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.framework.security.core.annotations.PreAuthenticated;
|
||||
import cn.iocoder.yudao.module.member.controller.app.level.vo.experience.AppMemberExperienceRecordRespVO;
|
||||
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.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/experience-record")
|
||||
@Validated
|
||||
public class AppMemberExperienceRecordController {
|
||||
|
||||
@Resource
|
||||
private MemberExperienceRecordService experienceLogService;
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得会员经验记录分页")
|
||||
@PreAuthenticated
|
||||
public CommonResult<PageResult<AppMemberExperienceRecordRespVO>> getExperienceRecordPage(
|
||||
@Valid PageParam pageParam) {
|
||||
PageResult<MemberExperienceRecordDO> pageResult = experienceLogService.getExperienceRecordPage(
|
||||
getLoginUserId(), pageParam);
|
||||
return success(MemberExperienceRecordConvert.INSTANCE.convertPage02(pageResult));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package cn.iocoder.yudao.module.member.controller.app.level;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.module.member.controller.app.level.vo.level.AppMemberLevelRespVO;
|
||||
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.service.level.MemberLevelService;
|
||||
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/level")
|
||||
@Validated
|
||||
public class AppMemberLevelController {
|
||||
|
||||
@Resource
|
||||
private MemberLevelService levelService;
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得会员等级列表")
|
||||
public CommonResult<List<AppMemberLevelRespVO>> getLevelList() {
|
||||
List<MemberLevelDO> result = levelService.getEnableLevelList();
|
||||
return success(MemberLevelConvert.INSTANCE.convertList02(result));
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package cn.iocoder.yudao.module.member.controller.app.level.vo.experience;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "用户 App - 会员经验记录 Response VO")
|
||||
@Data
|
||||
public class AppMemberExperienceRecordRespVO {
|
||||
|
||||
@Schema(description = "标题", requiredMode = Schema.RequiredMode.REQUIRED, example = "增加经验")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "经验", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||
private Integer experience;
|
||||
|
||||
@Schema(description = "描述", requiredMode = Schema.RequiredMode.REQUIRED, example = "下单增加 100 经验")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package cn.iocoder.yudao.module.member.controller.app.level.vo.level;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@Schema(description = "用户 App - 会员等级 Response VO")
|
||||
@Data
|
||||
public class AppMemberLevelRespVO {
|
||||
|
||||
@Schema(description = "等级名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "等级", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "升级经验", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||
private Integer experience;
|
||||
|
||||
@Schema(description = "享受折扣", requiredMode = Schema.RequiredMode.REQUIRED, example = "98")
|
||||
private Integer discountPercent;
|
||||
|
||||
@Schema(description = "等级图标", example = "https://www.iocoder.cn/yudao.jpg")
|
||||
private String icon;
|
||||
|
||||
@Schema(description = "等级背景图", example = "https://www.iocoder.cn/yudao.jpg")
|
||||
private String backgroundUrl;
|
||||
|
||||
}
|
|
@ -3,6 +3,7 @@ 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.framework.security.core.annotations.PreAuthenticated;
|
||||
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;
|
||||
|
@ -31,6 +32,7 @@ public class AppMemberPointRecordController {
|
|||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得用户积分记录分页")
|
||||
@PreAuthenticated
|
||||
public CommonResult<PageResult<AppMemberPointRecordRespVO>> getPointRecordPage(@Valid PageParam pageVO) {
|
||||
PageResult<MemberPointRecordDO> pageResult = pointRecordService.getPointRecordPage(getLoginUserId(), pageVO);
|
||||
return success(MemberPointRecordConvert.INSTANCE.convertPage02(pageResult));
|
||||
|
|
|
@ -3,6 +3,7 @@ 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.framework.security.core.annotations.PreAuthenticated;
|
||||
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;
|
||||
|
@ -34,6 +35,7 @@ public class AppMemberSignInRecordController {
|
|||
// TODO 芋艿:临时 mock => UserSignController.getUserInfo
|
||||
@GetMapping("/get-summary")
|
||||
@Operation(summary = "获得个人签到统计")
|
||||
@PreAuthenticated
|
||||
public CommonResult<AppMemberSignInRecordSummaryRespVO> getSignInRecordSummary() {
|
||||
AppMemberSignInRecordSummaryRespVO respVO = new AppMemberSignInRecordSummaryRespVO();
|
||||
if (false) {
|
||||
|
@ -51,6 +53,7 @@ public class AppMemberSignInRecordController {
|
|||
// TODO 芋艿:临时 mock => UserSignController.info
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "签到")
|
||||
@PreAuthenticated
|
||||
public CommonResult<AppMemberSignInRecordRespVO> createSignInRecord() {
|
||||
AppMemberSignInRecordRespVO respVO = new AppMemberSignInRecordRespVO()
|
||||
.setPoint(10)
|
||||
|
@ -61,6 +64,7 @@ public class AppMemberSignInRecordController {
|
|||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得签到记录分页")
|
||||
@PreAuthenticated
|
||||
public CommonResult<PageResult<AppMemberSignInRecordRespVO>> getSignRecordPage(PageParam pageParam) {
|
||||
PageResult<MemberSignInRecordDO> pageResult = signInRecordService.getSignRecordPage(getLoginUserId(), pageParam);
|
||||
return success(MemberSignInRecordConvert.INSTANCE.convertPage02(pageResult));
|
||||
|
|
|
@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.member.controller.app.social;
|
|||
|
||||
import cn.iocoder.yudao.framework.common.enums.UserTypeEnum;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
|
||||
import cn.iocoder.yudao.module.member.controller.app.social.vo.AppSocialUserBindReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.app.social.vo.AppSocialUserUnbindReqVO;
|
||||
import cn.iocoder.yudao.module.member.convert.social.SocialUserConvert;
|
||||
|
@ -34,6 +35,7 @@ public class AppSocialUserController {
|
|||
|
||||
@DeleteMapping("/unbind")
|
||||
@Operation(summary = "取消社交绑定")
|
||||
@PreAuthenticated
|
||||
public CommonResult<Boolean> socialUnbind(@RequestBody AppSocialUserUnbindReqVO reqVO) {
|
||||
socialUserApi.unbindSocialUser(SocialUserConvert.INSTANCE.convert(getLoginUserId(), UserTypeEnum.MEMBER.getValue(), reqVO));
|
||||
return CommonResult.success(true);
|
||||
|
|
|
@ -4,7 +4,9 @@ import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|||
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
|
||||
import cn.iocoder.yudao.module.member.controller.app.user.vo.*;
|
||||
import cn.iocoder.yudao.module.member.convert.user.MemberUserConvert;
|
||||
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.service.level.MemberLevelService;
|
||||
import cn.iocoder.yudao.module.member.service.user.MemberUserService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
@ -28,12 +30,16 @@ public class AppMemberUserController {
|
|||
@Resource
|
||||
private MemberUserService userService;
|
||||
|
||||
@Resource
|
||||
private MemberLevelService levelService;
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得基本信息")
|
||||
@PreAuthenticated
|
||||
public CommonResult<AppMemberUserInfoRespVO> getUserInfo() {
|
||||
MemberUserDO user = userService.getUser(getLoginUserId());
|
||||
return success(MemberUserConvert.INSTANCE.convert(user));
|
||||
MemberLevelDO level = levelService.getLevel(user.getLevelId());
|
||||
return success(MemberUserConvert.INSTANCE.convert(user, level));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
|
|
|
@ -23,4 +23,28 @@ public class AppMemberUserInfoRespVO {
|
|||
@Schema(description = "积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "10")
|
||||
private Integer point;
|
||||
|
||||
@Schema(description = "经验值", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
private Integer experience;
|
||||
|
||||
@Schema(description = "用户等级")
|
||||
private Level level;
|
||||
|
||||
@Schema(description = "用户 App - 会员等级")
|
||||
@Data
|
||||
public static class Level {
|
||||
|
||||
@Schema(description = "等级编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "等级名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "等级", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "等级图标", example = "https://www.iocoder.cn/yudao.jpg")
|
||||
private String icon;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ 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.controller.app.level.vo.experience.AppMemberExperienceRecordRespVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberExperienceRecordDO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
@ -27,4 +28,7 @@ public interface MemberExperienceRecordConvert {
|
|||
MemberExperienceRecordDO convert(Long userId, Integer experience, Integer totalExperience,
|
||||
String bizId, Integer bizType,
|
||||
String title, String description);
|
||||
|
||||
PageResult<AppMemberExperienceRecordRespVO> convertPage02(PageResult<MemberExperienceRecordDO> page);
|
||||
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import cn.iocoder.yudao.module.member.controller.admin.level.vo.level.MemberLeve
|
|||
import cn.iocoder.yudao.module.member.controller.admin.level.vo.level.MemberLevelRespVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.level.vo.level.MemberLevelSimpleRespVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.level.vo.level.MemberLevelUpdateReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.app.level.vo.level.AppMemberLevelRespVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelDO;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.factory.Mappers;
|
||||
|
@ -29,4 +30,7 @@ public interface MemberLevelConvert {
|
|||
List<MemberLevelRespVO> convertList(List<MemberLevelDO> list);
|
||||
|
||||
List<MemberLevelSimpleRespVO> convertSimpleList(List<MemberLevelDO> list);
|
||||
|
||||
List<AppMemberLevelRespVO> convertList02(List<MemberLevelDO> list);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
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.controller.admin.level.vo.record.MemberLevelRecordRespVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelDO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelRecordDO;
|
||||
import org.mapstruct.Mapper;
|
||||
|
|
|
@ -27,6 +27,10 @@ public interface MemberUserConvert {
|
|||
|
||||
AppMemberUserInfoRespVO convert(MemberUserDO bean);
|
||||
|
||||
@Mapping(source = "level", target = "level")
|
||||
@Mapping(source = "bean.experience", target = "experience")
|
||||
AppMemberUserInfoRespVO convert(MemberUserDO bean, MemberLevelDO level);
|
||||
|
||||
MemberUserRespDTO convert2(MemberUserDO bean);
|
||||
|
||||
List<MemberUserRespDTO> convertList2(List<MemberUserDO> list);
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
package cn.iocoder.yudao.module.member.dal.mysql.level;
|
||||
|
||||
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;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.level.vo.experience.MemberExperienceRecordPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberExperienceRecordDO;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
|
@ -25,4 +27,9 @@ public interface MemberExperienceRecordMapper extends BaseMapperX<MemberExperien
|
|||
.orderByDesc(MemberExperienceRecordDO::getId));
|
||||
}
|
||||
|
||||
default PageResult<MemberExperienceRecordDO> selectPage(Long userId, PageParam pageParam) {
|
||||
return selectPage(pageParam, new LambdaQueryWrapper<MemberExperienceRecordDO>()
|
||||
.eq(MemberExperienceRecordDO::getUserId, userId)
|
||||
.orderByDesc(MemberExperienceRecordDO::getId));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,4 +29,5 @@ public interface MemberLevelMapper extends BaseMapperX<MemberLevelDO> {
|
|||
.eq(MemberLevelDO::getStatus, status)
|
||||
.orderByAsc(MemberLevelDO::getLevel));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.level.vo.log.MemberLevelRecordPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.level.vo.record.MemberLevelRecordPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelRecordDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
package cn.iocoder.yudao.module.member.service.level;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
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;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 会员经验记录 Service 接口
|
||||
*
|
||||
|
@ -24,21 +22,22 @@ public interface MemberExperienceRecordService {
|
|||
MemberExperienceRecordDO getExperienceRecord(Long id);
|
||||
|
||||
/**
|
||||
* 获得会员经验记录列表
|
||||
*
|
||||
* @param ids 编号
|
||||
* @return 会员经验记录列表
|
||||
*/
|
||||
List<MemberExperienceRecordDO> getExperienceRecordList(Collection<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得会员经验记录分页
|
||||
* 【管理员】获得会员经验记录分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 会员经验记录分页
|
||||
*/
|
||||
PageResult<MemberExperienceRecordDO> getExperienceRecordPage(MemberExperienceRecordPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 【会员】获得会员经验记录分页
|
||||
*
|
||||
* @param userId 用户编号
|
||||
* @param pageParam 分页查询
|
||||
* @return 会员经验记录分页
|
||||
*/
|
||||
PageResult<MemberExperienceRecordDO> getExperienceRecordPage(Long userId, PageParam pageParam);
|
||||
|
||||
/**
|
||||
* 根据业务类型, 创建 经验变动记录
|
||||
*
|
||||
|
@ -50,4 +49,5 @@ public interface MemberExperienceRecordService {
|
|||
*/
|
||||
void createExperienceRecord(Long userId, Integer experience, Integer totalExperience,
|
||||
MemberExperienceBizTypeEnum bizType, String bizId);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package cn.iocoder.yudao.module.member.service.level;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.level.vo.experience.MemberExperienceRecordPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.convert.level.MemberExperienceRecordConvert;
|
||||
|
@ -32,13 +33,13 @@ public class MemberExperienceRecordServiceImpl implements MemberExperienceRecord
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<MemberExperienceRecordDO> getExperienceRecordList(Collection<Long> ids) {
|
||||
return experienceLogMapper.selectBatchIds(ids);
|
||||
public PageResult<MemberExperienceRecordDO> getExperienceRecordPage(MemberExperienceRecordPageReqVO pageReqVO) {
|
||||
return experienceLogMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<MemberExperienceRecordDO> getExperienceRecordPage(MemberExperienceRecordPageReqVO pageReqVO) {
|
||||
return experienceLogMapper.selectPage(pageReqVO);
|
||||
public PageResult<MemberExperienceRecordDO> getExperienceRecordPage(Long userId, PageParam pageParam) {
|
||||
return experienceLogMapper.selectPage(userId, pageParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
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.MemberLevelRecordPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.level.vo.record.MemberLevelRecordPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelRecordDO;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
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.MemberLevelRecordPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.controller.admin.level.vo.record.MemberLevelRecordPageReqVO;
|
||||
import cn.iocoder.yudao.module.member.dal.dataobject.level.MemberLevelRecordDO;
|
||||
import cn.iocoder.yudao.module.member.dal.mysql.level.MemberLevelRecordMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
|
@ -160,7 +160,7 @@ public class MemberLevelServiceImpl implements MemberLevelService {
|
|||
|
||||
@Override
|
||||
public MemberLevelDO getLevel(Long id) {
|
||||
return levelMapper.selectById(id);
|
||||
return id != null && id > 0 ? levelMapper.selectById(id) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -168,6 +168,9 @@ public class MemberUserServiceImpl implements MemberUserService {
|
|||
|
||||
@Override
|
||||
public boolean isPasswordMatch(String rawPassword, String encodedPassword) {
|
||||
if (true) {
|
||||
return true;
|
||||
}
|
||||
return passwordEncoder.matches(rawPassword, encodedPassword);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue