失效 修改状态
This commit is contained in:
@@ -55,10 +55,9 @@ public class AChatCouponController {
|
|||||||
*/
|
*/
|
||||||
@DeleteMapping("/expired/{id}")
|
@DeleteMapping("/expired/{id}")
|
||||||
@SaAdminCheckPermission(value = "chat:coupon:expired", name = "群聊优惠券活动-失效")
|
@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();
|
Long shopId = StpKit.USER.getShopId();
|
||||||
chatCouponService.expiredChatCoupon(shopId, id);
|
return CzgResult.success(chatCouponService.expiredChatCoupon(shopId, id));
|
||||||
return CzgResult.success();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -23,8 +23,8 @@ public class UChatCouponController {
|
|||||||
* 群聊优惠券活动-发放优惠券
|
* 群聊优惠券活动-发放优惠券
|
||||||
*/
|
*/
|
||||||
@PostMapping("/grant")
|
@PostMapping("/grant")
|
||||||
public CzgResult<Void> grantChatCoupon(@RequestBody ChatCouponGrantDTO chatCouponGrant) {
|
public CzgResult<Boolean> grantChatCoupon(@RequestBody ChatCouponGrantDTO chatCouponGrant) {
|
||||||
chatCouponService.grantChatCoupon(chatCouponGrant.getId(), chatCouponGrant.getShopUserId(), chatCouponGrant.getUserId());
|
chatCouponService.grantChatCoupon(chatCouponGrant.getId(), chatCouponGrant.getShopUserId(), chatCouponGrant.getUserId());
|
||||||
return CzgResult.success();
|
return CzgResult.success(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public interface ChatCouponService extends IService<ChatCoupon> {
|
|||||||
/**
|
/**
|
||||||
* 失效
|
* 失效
|
||||||
*/
|
*/
|
||||||
void expiredChatCoupon(Long shopId, Long id);
|
boolean expiredChatCoupon(Long shopId, Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发放优惠券
|
* 发放优惠券
|
||||||
|
|||||||
@@ -82,10 +82,10 @@ public class ChatCouponServiceImpl extends ServiceImpl<ChatCouponMapper, ChatCou
|
|||||||
* 失效
|
* 失效
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void expiredChatCoupon(Long shopId, Long id) {
|
public boolean expiredChatCoupon(Long shopId, Long id) {
|
||||||
ChatCoupon coupon = new ChatCoupon();
|
ChatCoupon coupon = new ChatCoupon();
|
||||||
coupon.setStatus(3);
|
coupon.setStatus(3);
|
||||||
update(coupon, QueryWrapper.create()
|
return update(coupon, QueryWrapper.create()
|
||||||
.eq(ChatCoupon::getId, id)
|
.eq(ChatCoupon::getId, id)
|
||||||
.eq(ChatCoupon::getShopId, shopId)
|
.eq(ChatCoupon::getShopId, shopId)
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user