package co.yixiang.yshop.module.product.service.storeproductrelation;

import co.yixiang.yshop.module.product.controller.app.relation.vo.AppStoreProductRelationQueryVo;
import co.yixiang.yshop.module.product.dal.dataobject.storeproductrelation.StoreProductRelationDO;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * 商品点赞和收藏 Service 接口
 *
 * @author yshop
 */
public interface AppStoreProductRelationService extends IService<StoreProductRelationDO> {

    /**
     * 是否收藏
     *
     * @param productId 商品ID
     * @param uid       用户ID
     * @return Boolean
     */
    Boolean isProductRelation(Long productId, Long uid, String category);

    /**
     * 添加收藏
     *
     * @param productId 商品id
     * @param uid       用户id
     */
    void addProductRelation(Long productId, Long uid, String category);

    /**
     * 取消收藏
     *
     * @param id  收藏id
     * @param uid 用户id
     */
    void delProductRelation(Long id, Long uid, String category, String type);

    /**
     * 批量取消收藏/足迹
     *
     * @param idList 收藏id列表
     * @param uid    用户id
     */
    void batchDelProductRelation(List<Long> idList, Long uid, String category, String type);

    /**
     * 获取用户收藏/足迹
     *
     * @param page  page
     * @param limit limit
     * @param uid   用户id
     * @return list
     */
    List<AppStoreProductRelationQueryVo> userCollectRootProductList(Integer page, Integer limit, Long uid, String type);


}
