| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.xiaopeng.api.feignClient.account.XpAppUserCouponClient; |
| | | import com.xiaopeng.api.model.operation.XpCoupon; |
| | | import com.xiaopeng.common.core.domain.R; |
| | | import com.xiaopeng.operation.query.XpCouponListQuery; |
| | | import com.xiaopeng.operation.service.IXpCouponService; |
| | | import com.xiaopeng.operation.vo.XpBannerListVo; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.stereotype.Controller; |
| | | |
| | | import java.util.List; |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @Resource XpAppUserCouponClient xpAppUserCouponClient; |
| | | |
| | | /** |
| | | * 删除优惠券 |
| | | */ |
| | | @DeleteMapping("/v1/api/xp-coupon/deleteById") |
| | | @ApiOperation(value = "删除优惠券",tags = {"管理后台-优惠券"},response = XpCoupon.class) |
| | | public R<?> deleteById(@RequestParam Long id){ |
| | | xpCouponService.removeById(id); |
| | | return R.ok(); |
| | | |
| | | if (!xpAppUserCouponClient.isHolding(id)){ |
| | | xpCouponService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | else{ |
| | | return R.fail("该优惠券已有用户使用,无法作废 / 删除"); |
| | | } |
| | | } |
| | | |
| | | } |