Browse Source

商品数据添加收藏id

multiwx
dy-hu 10 months ago
parent
commit
b459418189
  1. 12
      cereshop-app/src/main/java/com/shop/cereshop/app/page/index/Product.java
  2. 6
      cereshop-app/src/main/java/com/shop/cereshop/app/service/shop/impl/CerePlatformShopServiceImpl.java

12
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")

6
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<Product> pageInfo=new PageInfo<>(list);

Loading…
Cancel
Save