package com.ruoyi.frequency.votecomment.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.controller.req.VoteCommentPageReq;
import com.ruoyi.controller.req.VoteCommentReq;
import com.ruoyi.controller.resp.VoteCommentPageResp;
import com.ruoyi.controller.resp.VoteCommentResp;
import com.ruoyi.frequency.votecomment.entity.VoteComment;
import com.ruoyi.post.controller.req.DeleteCommentReq;
import com.ruoyi.post.controller.vo.SelectedComment;
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 VoteCommentService extends IService<VoteComment>
{
    /**
     * 查询帖子评论
     *
     * @param id 帖子评论主键
     * @return 帖子评论
     */
    public VoteComment selectVoteCommentById(Long id);

    /**
     * 查询帖子评论列表
     *
     * @param voteComment 帖子评论
     * @return 帖子评论集合
     */
    public List<VoteComment> selectVoteCommentList(VoteComment voteComment);

    /**
     * 新增帖子评论
     *
     * @param voteComment 帖子评论
     * @return 结果
     */
    public int insertVoteComment(VoteComment voteComment);

    /**
     * 修改帖子评论
     *
     * @param voteComment 帖子评论
     * @return 结果
     */
    public int updateVoteComment(VoteComment voteComment);

    int updateVoteCommentLikeNum(VoteComment voteComment, Integer num);

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

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


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


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

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


    Map<Long, Integer> commentNumMap(List<Long> voteIds, List<UserVo> userVoList, Long parentId);

    ResponseData<VoteCommentResp> voteCommentDetail(Long id, UserVo userVo);

    ResponseData<PageResult<Page<VoteCommentPageResp>>> voteCommentDialoguePage(DialoguePageReq req, UserVo userVo);

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