package shop.alien.store.service;

import com.baomidou.mybatisplus.extension.service.IService;
import shop.alien.entity.store.CommonComment;
import shop.alien.entity.store.vo.CommonCommentVo;
import shop.alien.entity.store.vo.CommonRatingVo;

import java.util.List;
import java.util.Map;

/**
 * 评论表 服务类
 *
 * @author  lyx
 * @since 2025-01-XX
 */
public interface CommonCommentService extends IService<CommonComment> {
    /**
     * 新增评论
     * @param commonComment
     * @return
     */
    Integer addComment(CommonComment commonComment);

    /**
     * 根据动态类型和动态id查询评论列表
     * @param sourceType
     * @param sourceId
     * @param pageNum
     * @param pageSize
     * @param userId
     * @return
     */
    List<CommonCommentVo> getListBySourceType(Integer sourceType, Integer sourceId, Integer pageNum, Integer pageSize, Long userId);


    /**
     *
     * @param sourceType
     * @param sourceId
     * @param pageNum
     * @param pageSize
     * @param userId
     * @param likeType
     * @return
     */
    List<CommonCommentVo> getFirstLevelComment(Integer sourceType, Integer sourceId, Integer pageNum, Integer pageSize, Long userId, String likeType);

    void getAllChildComment(Long userId, CommonRatingVo commonRatingVo, List<CommonCommentVo> commonComments, String likeType);

    Map<String,Object> getCommitCount(Integer sourceId, Integer sourceType, String userId, String userType);

    boolean deleteComment(Long commentId);
}

