| | |
| | | package com.ruoyi.integration.barrierGate.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.ruoyi.integration.barrierGate.model.BaseResponse; |
| | | import com.ruoyi.integration.barrierGate.model.GetCouponReq; |
| | | import com.ruoyi.integration.barrierGate.model.GetCouponResp; |
| | | import com.ruoyi.integration.barrierGate.model.UsedCoupon; |
| | | import com.ruoyi.integration.barrierGate.server.CouponService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | * @author zhibing.pu |
| | | * @Date 2024/9/5 11:10 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/coupon") |
| | | public class CouponController { |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/getCoupon") |
| | | public BaseResponse<GetCouponResp> getCoupon(@RequestBody GetCouponReq req){ |
| | | public BaseResponse<GetCouponResp> getCoupon(GetCouponReq req){ |
| | | log.info("停车获取优惠券请求参数:{}", JSON.toJSONString(req)); |
| | | GetCouponResp coupon = couponService.getCoupon(req); |
| | | log.info("停车获取优惠券结果:{}", JSON.toJSONString(coupon)); |
| | | return BaseResponse.ok(coupon); |
| | | } |
| | | |
| | |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/usedCoupon") |
| | | public BaseResponse usedCoupon(@RequestBody UsedCoupon req){ |
| | | public BaseResponse usedCoupon(UsedCoupon req){ |
| | | log.info("停车使用优惠券请求参数:{}", JSON.toJSONString(req)); |
| | | couponService.usedCoupon(req); |
| | | return BaseResponse.ok(); |
| | | } |