|
@@ -136,6 +136,13 @@ public class FavController {
|
|
|
}*/
|
|
}*/
|
|
|
// 保持原生顺序。使用jpa的findAll总是会自动排序
|
|
// 保持原生顺序。使用jpa的findAll总是会自动排序
|
|
|
List<GoodsBean> goodsBeanList = goodsRepository.findByIdsIn(email, pageNum*pageSize, pageSize);
|
|
List<GoodsBean> goodsBeanList = goodsRepository.findByIdsIn(email, pageNum*pageSize, pageSize);
|
|
|
|
|
+ List<Long> favBeanList = favRepository.findFavListByEmail(email);
|
|
|
|
|
+ // 当前商品是否已收藏
|
|
|
|
|
+ for (GoodsBean goodsBean : goodsBeanList) {
|
|
|
|
|
+ if (favBeanList.contains(goodsBean.id)) {
|
|
|
|
|
+ goodsBean.isFavorite = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
responseResult.setContent(goodsBeanList);
|
|
responseResult.setContent(goodsBeanList);
|
|
|
|
|
|
|
|
responseResult.setCode(ResultCode.SUCCESS);
|
|
responseResult.setCode(ResultCode.SUCCESS);
|