This commit is contained in:
wangjinlei
2023-10-07 10:56:27 +08:00
parent fb7016d471
commit 880c412b19
5 changed files with 48 additions and 20 deletions

View File

@@ -59,6 +59,8 @@ public class BookController {
private ShopProductService shopProductService;
@Autowired
private ShopProudictBookService shopProudictBookService;
@Autowired
private ShopProductToLabelService shopProductToLabelService;
final ExecutorService fixedThreadPool = Executors.newFixedThreadPool(10);
/**
@@ -82,6 +84,21 @@ public class BookController {
return R.ok().put("page", page);
}
/**
* 获取精品图书
* @return
*/
@RequestMapping("/getJPBooks")
public R getJPBooks(){
LambdaQueryWrapper<ShopProductToLabelEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ShopProductToLabelEntity::getSplId,5);//精选图书
wrapper.eq(ShopProductToLabelEntity::getDelFlag,0);
List<Integer> pIds = shopProductToLabelService.getBaseMapper().selectList(wrapper).stream().map(ShopProductToLabelEntity::getProductId).collect(Collectors.toList());
List<ShopProductEntity> shopProductEntities = shopProductService.getBaseMapper().selectList(new LambdaQueryWrapper<ShopProductEntity>().in(ShopProductEntity::getProductId, pIds));
return R.ok().put("Products",shopProductEntities);
}
/**