|
|
@@ -363,4 +363,21 @@ public class CouponFrontController {
|
|
|
CouponUserView couponUserView = couponFontService.getNewUserWelfareCoupons(userId, now);
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(couponUserView);
|
|
|
}
|
|
|
+
|
|
|
+ @GetMapping("/get/coupon/detail/{couponId}")
|
|
|
+ public Result<CouponUserView> getCouponDetailById(@PathVariable Long couponId) {
|
|
|
+ long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
+ CouponUserView couponUserView = couponFontService.getCouponDetailById(userId, couponId);
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(couponUserView);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 领取优惠券
|
|
|
+ */
|
|
|
+ @PostMapping("/receive/coupon/{couponId}")
|
|
|
+ public Result<CouponUserView> receiveCoupon(@PathVariable Long couponId) {
|
|
|
+ long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
+ CouponUserView couponUserView = couponFontService.receiveCoupon(userId, couponId);
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(couponUserView);
|
|
|
+ }
|
|
|
}
|