用户获取优惠券

This commit is contained in:
wangw 2025-09-18 17:43:53 +08:00
parent ce2af8c5be
commit 39b37ea8bc
1 changed files with 12 additions and 0 deletions

View File

@ -2,6 +2,7 @@ package com.czg.controller.admin;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.thread.ThreadUtil; import cn.hutool.core.thread.ThreadUtil;
import com.czg.account.vo.UserCouponVo;
import com.czg.log.annotation.OperationLog; import com.czg.log.annotation.OperationLog;
import com.czg.market.dto.*; import com.czg.market.dto.*;
import com.czg.market.service.MkCouponGiftService; import com.czg.market.service.MkCouponGiftService;
@ -177,4 +178,15 @@ public class ACouponController {
return CzgResult.success(couponRecordService.grant(rewardCouponDTO.getShopId() != null ? rewardCouponDTO.getShopId() : StpKit.USER.getShopId(), rewardCouponDTO)); return CzgResult.success(couponRecordService.grant(rewardCouponDTO.getShopId() != null ? rewardCouponDTO.getShopId() : StpKit.USER.getShopId(), rewardCouponDTO));
} }
/**
* 生成订单后使用
* 通过用户Id 查找优惠券
*
* @param shopUserId 店铺用户Id
*/
@GetMapping("/findCoupon")
public CzgResult<List<UserCouponVo>> findCoupon(@RequestParam Long shopUserId, @RequestParam(required = false) Integer type) {
return CzgResult.success(shopCouponService.findCoupon(StpKit.USER.getShopId(), shopUserId, type));
}
} }