|
|
@ -13,9 +13,11 @@ import co.yixiang.modules.activity.domain.YxStoreCoupon; |
|
|
|
import co.yixiang.modules.activity.service.YxStoreCouponService; |
|
|
|
import co.yixiang.modules.activity.service.YxStoreCouponUserService; |
|
|
|
import co.yixiang.modules.activity.service.dto.YxStoreCouponQueryCriteria; |
|
|
|
import co.yixiang.modules.activity.vo.StoreCouponUserVo; |
|
|
|
import co.yixiang.modules.activity.vo.YxStoreCouponUserQueryVo; |
|
|
|
import co.yixiang.modules.aop.ForbidSubmit; |
|
|
|
import co.yixiang.modules.shop.service.dto.YxMaterialDto; |
|
|
|
import co.yixiang.modules.user.param.UsableCouponParam; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import org.springframework.data.domain.Pageable; |
|
|
@ -25,6 +27,7 @@ import org.springframework.security.access.prepost.PreAuthorize; |
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
@ -106,4 +109,15 @@ public class StoreCouponController { |
|
|
|
yxStoreCouponService.removeById(id); |
|
|
|
return new ResponseEntity(HttpStatus.OK); |
|
|
|
} |
|
|
|
|
|
|
|
@Log("获取可用的优惠券列表") |
|
|
|
@ApiOperation(value = "获取优惠券") |
|
|
|
@PostMapping(value = "/getUsableCouponList") |
|
|
|
// @PreAuthorize("@el.check('admin','YXSTORECOUPON_ALL','YXSTORECOUPON_SELECT')") |
|
|
|
public ResponseEntity getUsableCouponList(@Validated @RequestBody UsableCouponParam param){ |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
List<StoreCouponUserVo> list = storeCouponUserService.getUsableCouponList(param.getUid(),param.getPrice(),param.getProductIds()); |
|
|
|
map.put("content", list); |
|
|
|
return new ResponseEntity<>(map,HttpStatus.OK); |
|
|
|
} |
|
|
|
} |