From aa2bf754000ef090597f894ab26fa8f58e74ff72 Mon Sep 17 00:00:00 2001 From: khy <2908249413@qq.com> Date: Thu, 17 Oct 2024 10:16:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=98=E8=B4=B9=E4=BC=9A=E5=91=98=E6=9D=83?= =?UTF-8?q?=E7=9B=8A=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../benefit/AppMemberBenefitController.java | 36 +++++++++++++++++++ .../benefit/vo/AppMemberBenefitRespVO.java | 27 ++++++++++++++ .../convert/benefit/MemberBenefitConvert.java | 19 ++++++++++ .../convert/type/MemberCardTypeConvert.java | 3 ++ .../PaidMemberBenefitMapper.java | 4 +++ .../PaidMemberBenefitService.java | 2 ++ .../PaidMemberBenefitServiceImpl.java | 6 ++++ 7 files changed, 97 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..3ab68a1 --- /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,36 @@ +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.*; + +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..ff762a5 --- /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,27 @@ +package cn.iocoder.yudao.module.member.controller.app.benefit.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDateTime; + +@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/convert/type/MemberCardTypeConvert.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/type/MemberCardTypeConvert.java index 5942d21..8c07a1a 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/type/MemberCardTypeConvert.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/convert/type/MemberCardTypeConvert.java @@ -8,6 +8,9 @@ import org.mapstruct.factory.Mappers; import java.util.List; +/** + * 会员卡类型 Convert + */ @Mapper public interface MemberCardTypeConvert { 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..62a7c86 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,6 @@ public interface PaidMemberBenefitService { * @return void */ void updatePaidMemberBenefitStatus(PaidMemberBenefitStatusReqVO req); + + 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