失效 修改状态

This commit is contained in:
2025-12-03 14:50:31 +08:00
parent 5aded8c6c1
commit 7bbd4d441a
4 changed files with 7 additions and 8 deletions

View File

@@ -55,10 +55,9 @@ public class AChatCouponController {
*/
@DeleteMapping("/expired/{id}")
@SaAdminCheckPermission(value = "chat:coupon:expired", name = "群聊优惠券活动-失效")
public CzgResult<Void> expiredChatCoupon(@PathVariable Long id) {
public CzgResult<Boolean> expiredChatCoupon(@PathVariable Long id) {
Long shopId = StpKit.USER.getShopId();
chatCouponService.expiredChatCoupon(shopId, id);
return CzgResult.success();
return CzgResult.success(chatCouponService.expiredChatCoupon(shopId, id));
}
/**

View File

@@ -23,8 +23,8 @@ public class UChatCouponController {
* 群聊优惠券活动-发放优惠券
*/
@PostMapping("/grant")
public CzgResult<Void> grantChatCoupon(@RequestBody ChatCouponGrantDTO chatCouponGrant) {
public CzgResult<Boolean> grantChatCoupon(@RequestBody ChatCouponGrantDTO chatCouponGrant) {
chatCouponService.grantChatCoupon(chatCouponGrant.getId(), chatCouponGrant.getShopUserId(), chatCouponGrant.getUserId());
return CzgResult.success();
return CzgResult.success(true);
}
}

View File

@@ -28,7 +28,7 @@ public interface ChatCouponService extends IService<ChatCoupon> {
/**
* 失效
*/
void expiredChatCoupon(Long shopId, Long id);
boolean expiredChatCoupon(Long shopId, Long id);
/**
* 发放优惠券

View File

@@ -82,10 +82,10 @@ public class ChatCouponServiceImpl extends ServiceImpl<ChatCouponMapper, ChatCou
* 失效
*/
@Override
public void expiredChatCoupon(Long shopId, Long id) {
public boolean expiredChatCoupon(Long shopId, Long id) {
ChatCoupon coupon = new ChatCoupon();
coupon.setStatus(3);
update(coupon, QueryWrapper.create()
return update(coupon, QueryWrapper.create()
.eq(ChatCoupon::getId, id)
.eq(ChatCoupon::getShopId, shopId)
);