| | |
| | | import com.ruoyi.system.api.domain.dto.MgtBaseGetDto; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | |
| | | * @Date 2023/6/13 9:15 |
| | | * @Version 1.0 |
| | | */ |
| | | @Api(value = "平台端优惠券相关接口", tags = "平台端优惠券相关接口", description = "平台端优惠券相关接口") |
| | | @Api(value = "管理后台优惠券相关接口", tags = "管理后台优惠券相关接口", description = "管理后台优惠券相关接口") |
| | | @RestController |
| | | @RequestMapping("/mgt/coupon") |
| | | public class MgtCouponController { |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/getMgtCouponVo", method = RequestMethod.POST) |
| | | @ApiOperation(value = "平台获取优惠券编辑信息") |
| | | @ApiOperation(value = "平台获取优惠券编辑信息【2.0】") |
| | | public R<MgtCouponGetVo> getMgtCouponVo(@RequestBody MgtBaseGetDto mgtBaseGetDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | mgtBaseGetDto.setUserId(userId); |
| | |
| | | |
| | | @RequestMapping(value = "/editMgtCoupon", method = RequestMethod.POST) |
| | | @Log(title = "优惠券管理", businessType = BusinessType.UPDATE,operContent = "编辑优惠券") |
| | | @ApiOperation(value = "平台编辑优惠券") |
| | | public R editMgtCoupon(@RequestBody MgtCouponEditDto mgtCouponEditDto) { |
| | | @ApiOperation(value = "平台编辑优惠券【2.0】") |
| | | public R editMgtCoupon(@Validated @RequestBody MgtCouponEditDto mgtCouponEditDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | mgtCouponEditDto.setUserId(userId); |
| | | couponService.editMgtCoupon(mgtCouponEditDto); |
| | |
| | | couponService.auditMgtCoupon(mgtCouponAuditDto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/endImmediately", method = RequestMethod.POST) |
| | | @Log(title = "优惠券管理", businessType = BusinessType.UPDATE,operContent = "立即结束") |
| | | @ApiOperation(value = "立即结束【2.0】") |
| | | public R endImmediately(@RequestBody MgtBaseGetDto mgtBaseGetDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | mgtBaseGetDto.setUserId(userId); |
| | | return couponService.endImmediately(mgtBaseGetDto); |
| | | } |
| | | |
| | | //获取抽奖类型优惠券列表 |
| | | @RequestMapping(value = "/getLotteryEventCouponList", method = RequestMethod.POST) |
| | | @ApiOperation(value = "平台获取抽奖类型优惠券列表【2.0】") |
| | | public R<List<LotteryEventCouponListVO>> getLotteryEventCouponList() { |
| | | return R.ok( couponService.getLotteryEventCouponList()); |
| | | } |
| | | |
| | | } |