| package com.mzl.flower.web.customer; | 
|   | 
| import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | 
| import com.mzl.flower.base.BaseController; | 
| import com.mzl.flower.base.R; | 
| import com.mzl.flower.base.ReturnDataDTO; | 
| import com.mzl.flower.config.security.SecurityUtils; | 
| import com.mzl.flower.constant.Constants; | 
| import com.mzl.flower.dto.request.point.*; | 
| import com.mzl.flower.dto.response.point.CustomerPointDetailDTO; | 
| import com.mzl.flower.dto.response.point.PointGoodsDTO; | 
| import com.mzl.flower.dto.response.point.PointGoodsListDTO; | 
| import com.mzl.flower.dto.response.point.PointGoodsRecordDTO; | 
| import com.mzl.flower.entity.point.PointGoodsRecord; | 
| import com.mzl.flower.service.point.PointGoodsService; | 
| import io.swagger.annotations.Api; | 
| import io.swagger.annotations.ApiImplicitParam; | 
| import io.swagger.annotations.ApiImplicitParams; | 
| import io.swagger.annotations.ApiOperation; | 
| import lombok.extern.slf4j.Slf4j; | 
| import org.springframework.beans.factory.annotation.Autowired; | 
| import org.springframework.http.ResponseEntity; | 
| import org.springframework.validation.annotation.Validated; | 
| import org.springframework.web.bind.annotation.*; | 
|   | 
| @RestController | 
| @RequestMapping("/api/customer/point/goods") | 
| @Api(value = "积分商品-花店", tags = "积分商品-花店") | 
| @Validated | 
| @Slf4j | 
| public class PointGoodsCustomerController extends BaseController { | 
|   | 
|     @Autowired | 
|     private PointGoodsService pointGoodsService; | 
|   | 
|     @GetMapping("/list") | 
|     @ApiOperation(value = "商品列表") | 
|     public ResponseEntity<ReturnDataDTO<Page<PointGoodsListDTO>>> selectGoodsList(Page page, PointGoodsQueryDTO dto){ | 
|         dto.setStatus(Constants.POINT_GOODS_STATUS.A.name()); | 
|         return returnData(R.SUCCESS.getCode(), pointGoodsService.selectGoodsList(page, dto)); | 
|     } | 
|   | 
|     @GetMapping("/list/view") | 
|     @ApiOperation(value = "商品详情") | 
|     @ApiImplicitParams({ | 
|             @ApiImplicitParam(name = "id", value = "商品id", required = true, dataType = "Long", paramType = "query") | 
|     }) | 
|     public ResponseEntity<ReturnDataDTO<PointGoodsDTO>> getGoodsInfo(Long id) { | 
|         return returnData(R.SUCCESS.getCode(), pointGoodsService.getGoodsInfo(id)); | 
|     } | 
|   | 
|   | 
|     @PostMapping("/exchange") | 
|     @ApiOperation(value = "积分商品兑换", notes = "积分商品兑换") | 
|     public ResponseEntity<ReturnDataDTO> exchangeGoods(@Validated @RequestBody ExchangeGoodsDTO dto) { | 
|         pointGoodsService.exchangeGoods(dto); | 
|         return returnData(R.SUCCESS.getCode(),null); | 
|     } | 
|   | 
|   | 
|     @GetMapping("/exchange/list") | 
|     @ApiOperation(value = "积分商品兑换券列表", notes = "积分商品兑换券列表") | 
|     public ResponseEntity<ReturnDataDTO<Page<PointGoodsRecordDTO>>> myExchangeGoods(QueryExchangeGoodsDTO dto, Page page) { | 
|         return returnData(R.SUCCESS.getCode(), pointGoodsService.myExchangeGoods(dto,page)); | 
|     } | 
|   | 
|   | 
|   | 
|   | 
| } |