| | |
| | | package cc.mrbird.febs.mall.controller; |
| | | |
| | | import cc.mrbird.febs.common.annotation.Limit; |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.entity.LimitType; |
| | | import cc.mrbird.febs.mall.service.IApiMallActService; |
| | | import cc.mrbird.febs.mall.vo.ApiActivityVo; |
| | | import cc.mrbird.febs.mall.vo.ApiCouponVo; |
| | | 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.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | |
| | | public class ApiMallActController { |
| | | |
| | | private final IApiMallActService iApiMallActService; |
| | | @ApiOperation(value = "获取活动详情", notes = "获取活动详情") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = ApiActivityVo.class) |
| | | }) |
| | | @GetMapping(value = "/getActivity/{id}") |
| | | public FebsResponse getActivity(@PathVariable("id") Long id) { |
| | | return new FebsResponse().success().data(iApiMallActService.findApiMallActDetailsById(id)); |
| | | } |
| | | @ApiOperation(value = "优惠卷详情", notes = "优惠卷详情") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = ApiCouponVo.class) |
| | | }) |
| | | @GetMapping(value = "/getCoupon/{id}") |
| | | public FebsResponse getCoupon(@PathVariable("id") Long id) { |
| | | return new FebsResponse().success().data(iApiMallActService.findApiCouponById(id)); |
| | | } |
| | | @ApiOperation(value = "领取优惠卷", notes = "领取优惠卷") |
| | | @GetMapping(value = "/addCoupon/{id}") |
| | | @Limit(key = "addCoupon", period = 10, count = 1, name = "领取优惠卷", prefix = "limit",limitType = LimitType.IP) |
| | | public FebsResponse addCoupon(@PathVariable("id") Long id) { |
| | | return iApiMallActService.addCoupon(id); |
| | | } |
| | | |
| | | } |