xiaoqiang před 4 roky
rodič
revize
f9aedceb2e

+ 1 - 1
src/main/java/org/springblade/gateway/point_gateway/controller/PointGoodsByAIdController.java

@@ -28,7 +28,7 @@ public class PointGoodsByAIdController {
 	private IPointGoodsService pointGoodsService;
 
 	@GetMapping("/queryList")
-	public R<IPage<PointGoodsVO>> orderList(@ApiParam(value = "活动id",required = true) @RequestParam Long activeId, Query query){
+	public R<IPage<PointGoodsVO>> orderList(@ApiParam(value = "活动id",required = true) @RequestParam Long activeId, Query query) throws IllegalAccessException {
 		IPage<PointGoods> pages = pointGoodsService.queryList(activeId, query);
 		return R.data(PointGoodsWrapper.build().pageVO(pages));
 	}

+ 1 - 1
src/main/java/org/springblade/sing/goods/service/IPointGoodsService.java

@@ -47,5 +47,5 @@ public interface IPointGoodsService extends BaseService<PointGoods> {
 	 * @param activeId 活动id
 	 * @return
 	 */
-    IPage<PointGoods> queryList(Long activeId, Query query);
+    IPage<PointGoods> queryList(Long activeId, Query query) throws IllegalAccessException;
 }

+ 4 - 3
src/main/java/org/springblade/sing/goods/service/impl/PointGoodsServiceImpl.java

@@ -48,15 +48,16 @@ public class PointGoodsServiceImpl extends BaseServiceImpl<PointGoodsMapper, Poi
 	}
 
     @Override
-    public IPage<PointGoods> queryList(Long activeId,Query query) {
+    public IPage<PointGoods> queryList(Long activeId,Query query) throws IllegalAccessException {
 		LambdaQueryWrapper<PointGoods> wrapper = new LambdaQueryWrapper<PointGoods>().eq(PointGoods::getActiveId, activeId);
 
 		List<PointGoods> goods = baseMapper.selectList(wrapper);
-		Assert.isNull(goods,"此活动没有可兑换商品");
+		if (goods.size() == 0){
+			throw new IllegalAccessException("此活动没有可兑换商品");
+		}
 
 		IPage<PointGoods> pointGoodsIpage = new Page<>(query.getCurrent(),query.getSize());
 
-
 		return super.page(pointGoodsIpage,wrapper);
 
     }