优惠券发放

This commit is contained in:
张松
2025-09-18 15:08:58 +08:00
parent 6756f35db6
commit 537aeb09a1
6 changed files with 51 additions and 3 deletions

View File

@@ -3,9 +3,7 @@ package com.czg.controller.admin;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.thread.ThreadUtil;
import com.czg.log.annotation.OperationLog;
import com.czg.market.dto.MkCouponGiftDTO;
import com.czg.market.dto.MkShopCouponRecordDTO;
import com.czg.market.dto.ShopCouponDTO;
import com.czg.market.dto.*;
import com.czg.market.service.MkCouponGiftService;
import com.czg.market.service.MkShopCouponRecordService;
import com.czg.market.service.ShopCouponService;
@@ -170,4 +168,13 @@ public class ACouponController {
});
}
/**
* 券发放
* @return 是否发放成功
*/
@PostMapping("/grant")
public CzgResult<Boolean> rewardCoupon(@Validated @RequestBody MkRewardCouponDTO rewardCouponDTO) {
return CzgResult.success(couponRecordService.grant(rewardCouponDTO.getShopId() != null ? rewardCouponDTO.getShopId() : StpKit.USER.getShopId(), rewardCouponDTO));
}
}