| | |
| | | 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.dto.request.coupon.QueryActivityEffectCouponDTO; |
| | | import com.mzl.flower.dto.request.coupon.QueryMineCouponRecordDTO; |
| | | import com.mzl.flower.dto.response.coupon.CouponTemplateAppVO; |
| | | import com.mzl.flower.dto.response.coupon.CouponTemplateVO; |
| | | import com.mzl.flower.enums.CouponCategoryEnum; |
| | | import com.mzl.flower.enums.CouponGetTypeEnum; |
| | | import com.mzl.flower.enums.CouponStatusEnum; |
| | | import com.mzl.flower.enums.CouponUsedStatusEnum; |
| | | import com.mzl.flower.service.coupon.CouponRecordService; |
| | | import com.mzl.flower.service.coupon.CouponTemplateService2; |
| | | import com.mzl.flower.utils.ConverterUtil; |
| | | import io.swagger.annotations.Api; |
| | |
| | | |
| | | @Autowired |
| | | CouponTemplateService2 couponTemplateService; |
| | | |
| | | @Autowired |
| | | CouponRecordService couponRecordService; |
| | | |
| | | @GetMapping("/home/list") |
| | | @ApiOperation(value = "查询-首页弹框", notes = "查询-首页弹框") |
| | |
| | | |
| | | } |
| | | |
| | | @GetMapping("/mine/unused/list") |
| | | @ApiOperation(value = "我的优惠券-未使用", notes = "我的优惠券-未使用") |
| | | public ResponseEntity<ReturnDataDTO<Page<CouponTemplateVO>>> unusedList(QueryMineCouponRecordDTO dto) { |
| | | // 未使用 |
| | | dto.setStatus(CouponUsedStatusEnum.UNUSED.getType()); |
| | | dto.setUserId(SecurityUtils.getUserId()); |
| | | |
| | | return returnData(R.SUCCESS.getCode(), ConverterUtil.transList(couponRecordService.getMineCouponRecordList(dto), CouponTemplateAppVO.class)); |
| | | |
| | | } |
| | | @GetMapping("/mine/used/list") |
| | | @ApiOperation(value = "我的优惠券-已使用", notes = "我的优惠券-已使用") |
| | | public ResponseEntity<ReturnDataDTO<Page<CouponTemplateVO>>> usedList(QueryMineCouponRecordDTO dto) { |
| | | |
| | | // 已使用 |
| | | dto.setStatus(CouponUsedStatusEnum.USED.getType()); |
| | | dto.setUserId(SecurityUtils.getUserId()); |
| | | return returnData(R.SUCCESS.getCode(), ConverterUtil.transList(couponRecordService.getMineCouponRecordList(dto), CouponTemplateAppVO.class)); |
| | | |
| | | } |
| | | |
| | | @GetMapping("/mine/expired/list") |
| | | @ApiOperation(value = "我的优惠券-已过期", notes = "我的优惠券-已过期") |
| | | public ResponseEntity<ReturnDataDTO<Page<CouponTemplateVO>>> expiredList(QueryMineCouponRecordDTO dto) { |
| | | // 已过期 |
| | | dto.setStatus(CouponUsedStatusEnum.EXPIRED.getType()); |
| | | dto.setUserId(SecurityUtils.getUserId()); |
| | | return returnData(R.SUCCESS.getCode(), ConverterUtil.transList(couponRecordService.getMineCouponRecordList(dto), CouponTemplateAppVO.class)); |
| | | |
| | | } |
| | | |
| | | |
| | | } |