From d2c735ac189138fff826bec44e0a093d0d3b4409 Mon Sep 17 00:00:00 2001 From: khy <2908249413@qq.com> Date: Thu, 17 Oct 2024 11:19:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E5=91=98=E6=9D=83=E7=9B=8A=E5=88=97?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../benefit/AppMemberBenefitController.java | 37 +++++++++++++++++++ .../benefit/vo/AppMemberBenefitRespVO.java | 23 ++++++++++++ .../convert/benefit/MemberBenefitConvert.java | 19 ++++++++++ .../PaidMemberBenefitMapper.java | 4 ++ .../PaidMemberBenefitService.java | 7 ++++ .../PaidMemberBenefitServiceImpl.java | 6 +++ 6 files changed, 96 insertions(+) create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/benefit/AppMemberBenefitController.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/benefit/vo/AppMemberBenefitRespVO.java create mode 100644 yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/benefit/MemberBenefitConvert.java diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/benefit/AppMemberBenefitController.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/benefit/AppMemberBenefitController.java new file mode 100644 index 0000000..5bebcdc --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/benefit/AppMemberBenefitController.java @@ -0,0 +1,37 @@ +package cn.iocoder.yudao.module.member.controller.app.benefit; + +import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.module.member.controller.app.benefit.vo.AppMemberBenefitRespVO; +import cn.iocoder.yudao.module.member.convert.benefit.MemberBenefitConvert; +import cn.iocoder.yudao.module.member.dal.dataobject.memberbenefit.PaidMemberBenefitDO; +import cn.iocoder.yudao.module.member.service.memberbenefit.PaidMemberBenefitService; +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/benefit") +@Validated +public class AppMemberBenefitController { + @Resource + private PaidMemberBenefitService paidMemberBenefitService; + + + @GetMapping("/list") + @Operation(summary = "获得会员权益列表") + public CommonResult> getPaidMemberBenefitPage() { + List list = paidMemberBenefitService.getMemberBenefitList(CommonStatusEnum.DISABLE.getStatus()); + return success(MemberBenefitConvert.INSTANCE.convertList(list)); + } + +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/benefit/vo/AppMemberBenefitRespVO.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/benefit/vo/AppMemberBenefitRespVO.java new file mode 100644 index 0000000..8ad4377 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/controller/app/benefit/vo/AppMemberBenefitRespVO.java @@ -0,0 +1,23 @@ +package cn.iocoder.yudao.module.member.controller.app.benefit.vo; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +@Schema(description = "用户 App - 会员权益 Response VOO") +@Data +public class AppMemberBenefitRespVO { + + @Schema(description = "权益名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + private String benName; + + @Schema(description = "展示名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五") + private String showName; + + @Schema(description = "图标地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn") + private String iconUrl; + + @Schema(description = "描述") + private String intro; + +} + diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/benefit/MemberBenefitConvert.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/benefit/MemberBenefitConvert.java new file mode 100644 index 0000000..76aa7e0 --- /dev/null +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/benefit/MemberBenefitConvert.java @@ -0,0 +1,19 @@ +package cn.iocoder.yudao.module.member.convert.benefit; + +import cn.iocoder.yudao.module.member.controller.app.benefit.vo.AppMemberBenefitRespVO; +import cn.iocoder.yudao.module.member.dal.dataobject.memberbenefit.PaidMemberBenefitDO; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +import java.util.List; + +/** + * 会员权益 Convert + */ +@Mapper +public interface MemberBenefitConvert { + + MemberBenefitConvert INSTANCE = Mappers.getMapper(MemberBenefitConvert.class); + + List convertList(List list); +} diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/memberbenefit/PaidMemberBenefitMapper.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/memberbenefit/PaidMemberBenefitMapper.java index 20ef673..414e612 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/memberbenefit/PaidMemberBenefitMapper.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/dal/mysql/memberbenefit/PaidMemberBenefitMapper.java @@ -29,4 +29,8 @@ public interface PaidMemberBenefitMapper extends BaseMapperX selectListByStatus(Integer status){ + return selectList(PaidMemberBenefitDO::getStatus, status); + } + } \ No newline at end of file diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/memberbenefit/PaidMemberBenefitService.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/memberbenefit/PaidMemberBenefitService.java index 2efa755..738f4d1 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/memberbenefit/PaidMemberBenefitService.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/memberbenefit/PaidMemberBenefitService.java @@ -59,4 +59,11 @@ public interface PaidMemberBenefitService { * @return void */ void updatePaidMemberBenefitStatus(PaidMemberBenefitStatusReqVO req); + + /** + * 查询付费会员列表 + * @param status + * @return + */ + List getMemberBenefitList(Integer status); } \ No newline at end of file diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/memberbenefit/PaidMemberBenefitServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/memberbenefit/PaidMemberBenefitServiceImpl.java index bf16cc2..c81e23c 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/memberbenefit/PaidMemberBenefitServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/memberbenefit/PaidMemberBenefitServiceImpl.java @@ -82,4 +82,10 @@ public class PaidMemberBenefitServiceImpl implements PaidMemberBenefitService { paidMemberBenefitMapper.updateById(new PaidMemberBenefitDO().setId(req.getId()).setStatus(req.getStatus())); } + @Override + public List getMemberBenefitList(Integer status) { + List list = paidMemberBenefitMapper.selectListByStatus(status); + return list; + } + } \ No newline at end of file