diff --git a/cereshop-app/src/main/java/com/shop/cereshop/app/page/index/Product.java b/cereshop-app/src/main/java/com/shop/cereshop/app/page/index/Product.java index bb833df..9d84a4e 100644 --- a/cereshop-app/src/main/java/com/shop/cereshop/app/page/index/Product.java +++ b/cereshop-app/src/main/java/com/shop/cereshop/app/page/index/Product.java @@ -113,6 +113,18 @@ public class Product { private Integer total; /** + * 收藏id + */ + @ApiModelProperty(value = "收藏id") + private Long collectId; + + /** + * 是否收藏 1-是 0-否 + */ + @ApiModelProperty(value = "是否收藏 1-是 0-否") + private Integer ifCollect=0; + + /** * 名称Map */ @ApiModelProperty(value = "名称Map") diff --git a/cereshop-app/src/main/java/com/shop/cereshop/app/service/shop/impl/CerePlatformShopServiceImpl.java b/cereshop-app/src/main/java/com/shop/cereshop/app/service/shop/impl/CerePlatformShopServiceImpl.java index e017754..8a8af2f 100644 --- a/cereshop-app/src/main/java/com/shop/cereshop/app/service/shop/impl/CerePlatformShopServiceImpl.java +++ b/cereshop-app/src/main/java/com/shop/cereshop/app/service/shop/impl/CerePlatformShopServiceImpl.java @@ -137,6 +137,12 @@ public class CerePlatformShopServiceImpl implements CerePlatformShopService { product.setPrice(activityProduct.getPrice()); product.setUsers(activityProduct.getUsers()); } + + CereBuyerCollect collect = cereBuyerCollectService.findByUserProduct(user.getBuyerUserId(),product.getProductId()); + if(collect!=null){ + product.setCollectId(collect.getCollectId()); + product.setIfCollect(collect.getState()); + } } } PageInfo pageInfo=new PageInfo<>(list);