|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import cc.mrbird.febs.common.controller.BaseController; | 
|---|
|  |  |  | import cc.mrbird.febs.common.entity.FebsResponse; | 
|---|
|  |  |  | import cc.mrbird.febs.mall.mapper.DataDictionaryCustomMapper; | 
|---|
|  |  |  | import cc.mrbird.febs.vip.entity.MallVipBenefits; | 
|---|
|  |  |  | import cc.mrbird.febs.vip.entity.MallVipConfig; | 
|---|
|  |  |  | import cc.mrbird.febs.vip.service.IMallVipBenefitsService; | 
|---|
|  |  |  | import cc.mrbird.febs.vip.service.IMallVipConfigService; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import io.swagger.annotations.ApiResponse; | 
|---|
|  |  |  | import io.swagger.annotations.ApiResponses; | 
|---|
|  |  |  | import lombok.RequiredArgsConstructor; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | 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 org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Slf4j | 
|---|
|  |  |  | 
|---|
|  |  |  | public class ApiMallVipConfigController extends BaseController { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | private final IMallVipConfigService mallVipConfigService; | 
|---|
|  |  |  | private final IMallVipBenefitsService mallVipBenefitsService; | 
|---|
|  |  |  | private final DataDictionaryCustomMapper dataDictionaryCustomMapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "获取会员等级列表") | 
|---|
|  |  |  | @ApiResponses({ | 
|---|
|  |  |  | @ApiResponse(code = 200, message = "success", response = MallVipConfig.class) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | @GetMapping(value = "/findVipList") | 
|---|
|  |  |  | public FebsResponse findVipList() { | 
|---|
|  |  |  | return new FebsResponse().success().data(mallVipConfigService.findConfigList()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "获取权益详情") | 
|---|
|  |  |  | @ApiResponses({ | 
|---|
|  |  |  | @ApiResponse(code = 200, message = "success", response = MallVipBenefits.class) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | @GetMapping(value = "/findBenefitsDetailList/{id}") | 
|---|
|  |  |  | public FebsResponse findVipDetailList(@PathVariable("id") Long id) { | 
|---|
|  |  |  | MallVipBenefits vipBenefits = mallVipBenefitsService.findVipBenefitsById(id); | 
|---|
|  |  |  | return new FebsResponse().success().data(vipBenefits); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "领取权益") | 
|---|
|  |  |  | @PostMapping(value = "/getBenefitsData/{id}") | 
|---|
|  |  |  | public FebsResponse getBenefitsData(@PathVariable("id") Long id) { | 
|---|
|  |  |  | mallVipBenefitsService.getBenefits(id); | 
|---|
|  |  |  | return new FebsResponse().success().message("领取成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "获取会员中心背景图片") | 
|---|
|  |  |  | @GetMapping(value = "/findVipCenterBg") | 
|---|
|  |  |  | public FebsResponse findVipCenterBg() { | 
|---|
|  |  |  | return new FebsResponse().success().data(dataDictionaryCustomMapper.selectDicByType("VIP_CENTER_BACKGROUND")); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|