付费会员权益列表

This commit is contained in:
khy 2024-10-17 10:16:08 +08:00
parent 228fe0cc82
commit aa2bf75400
7 changed files with 97 additions and 0 deletions

View File

@ -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<List<AppMemberBenefitRespVO>> getPaidMemberBenefitPage() {
List<PaidMemberBenefitDO> list = paidMemberBenefitService.getMemberBenefitList(CommonStatusEnum.DISABLE.getStatus());
return success(MemberBenefitConvert.INSTANCE.convertList(list));
}
}

View File

@ -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;
}

View File

@ -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<AppMemberBenefitRespVO> convertList(List<PaidMemberBenefitDO> list);
}

View File

@ -8,6 +8,9 @@ import org.mapstruct.factory.Mappers;
import java.util.List; import java.util.List;
/**
* 会员卡类型 Convert
*/
@Mapper @Mapper
public interface MemberCardTypeConvert { public interface MemberCardTypeConvert {

View File

@ -29,4 +29,8 @@ public interface PaidMemberBenefitMapper extends BaseMapperX<PaidMemberBenefitDO
.orderByDesc(PaidMemberBenefitDO::getId)); .orderByDesc(PaidMemberBenefitDO::getId));
} }
default List<PaidMemberBenefitDO> selectListByStatus(Integer status){
return selectList(PaidMemberBenefitDO::getStatus, status);
}
} }

View File

@ -59,4 +59,6 @@ public interface PaidMemberBenefitService {
* @return void * @return void
*/ */
void updatePaidMemberBenefitStatus(PaidMemberBenefitStatusReqVO req); void updatePaidMemberBenefitStatus(PaidMemberBenefitStatusReqVO req);
List<PaidMemberBenefitDO> getMemberBenefitList(Integer status);
} }

View File

@ -82,4 +82,10 @@ public class PaidMemberBenefitServiceImpl implements PaidMemberBenefitService {
paidMemberBenefitMapper.updateById(new PaidMemberBenefitDO().setId(req.getId()).setStatus(req.getStatus())); paidMemberBenefitMapper.updateById(new PaidMemberBenefitDO().setId(req.getId()).setStatus(req.getStatus()));
} }
@Override
public List<PaidMemberBenefitDO> getMemberBenefitList(Integer status) {
List<PaidMemberBenefitDO> list = paidMemberBenefitMapper.selectListByStatus(status);
return list;
}
} }