package com.ruoyi.post.frequency.postcomment.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.page.PageResult;
import com.ruoyi.controller.req.DialoguePageReq;
import com.ruoyi.post.controller.req.DeleteCommentReq;
import com.ruoyi.post.controller.req.PostCommentPageReq;
import com.ruoyi.post.controller.req.PostCommentReq;
import com.ruoyi.post.controller.resp.PostCommentPageResp;
import com.ruoyi.post.controller.resp.PostCommentResp;
import com.ruoyi.post.controller.vo.SelectedComment;
import com.ruoyi.post.frequency.postcomment.entity.PostComment;
import com.ruoyi.response.ResponseData;
import com.ruoyi.vo.UserVo;

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

/**
 * 帖子评论Service接口
 *
 * @author liwenlong
 * @date 2023-10-09
 */
public interface PostCommentService extends IService<PostComment>
{
    /**
     * 查询帖子评论
     *
     * @param id 帖子评论主键
     * @return 帖子评论
     */
    public PostComment selectPostCommentById(Long id);

    /**
     * 查询帖子评论列表
     *
     * @param postComment 帖子评论
     * @return 帖子评论集合
     */
    public List<PostComment> selectPostCommentList(PostComment postComment);

    /**
     * 新增帖子评论
     *
     * @param postComment 帖子评论
     * @return 结果
     */
    public int insertPostComment(PostComment postComment);

    /**
     * 修改帖子评论
     *
     * @param postComment 帖子评论
     * @return 结果
     */
    public int updatePostComment(PostComment postComment);

    int updatePostCommentBatch(List<PostComment> postCommentList);

    int updatePostCommentLikeNum(PostComment postComment, Integer num);

    /**
     * 批量删除帖子评论
     *
     * @param ids 需要删除的帖子评论主键集合
     * @return 结果
     */
    public int deletePostCommentByIds(Long[] ids);

    /**
     * 删除帖子评论信息
     *
     * @param id 帖子评论主键
     * @return 结果
     */
    public int deletePostCommentById(Long id);


    /**
     * 帖子评论
     * @param req
     * @param userVo 登入用户
     * @return
     */
    ResponseData postComment(PostCommentReq req, UserVo userVo);


    /**
     * 帖子评论列表
     * @param req
     * @param userVo 登入用户
     * @return
     */
    ResponseData postCommentPage(PostCommentPageReq req, UserVo userVo);

    /**
     * 删除评论
     * @param req
     * @param userVo 登入用户
     * @return
     */
    ResponseData deleteComment(DeleteCommentReq req, UserVo userVo);


    /**
     * 查询精选评论
     * @param commentIds 精彩评论ids
     * @param userVo
     * @return
     */
    Map<Long, SelectedComment> getSelectedCommentMap(List<Long> commentIds, UserVo userVo);

    /**
     * 查询最新评论
     * @param userVo
     * @return
     */
    Map<Long, SelectedComment> getSelectedNewCommentMap(List<Long> postIds, UserVo userVo);

    ResponseData<PostCommentResp> postCommentDetail(Long id, UserVo userVo);

    ResponseData<PageResult<Page<PostCommentPageResp>>> postCommentDialoguePage(DialoguePageReq req, UserVo userVo);

    int deleteCommentByIds(Long[] ids, Integer delFlag);
}
