package com.yida.data.school.letter.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yida.data.common.core.entity.CurrentUser;
import com.yida.data.common.core.entity.letter.EduLetterBox;
import com.yida.data.common.core.vo.NameValueVO;
import com.yida.data.school.dto.letterbox.LetterBoxDTO;

import com.yida.data.school.vo.letterbox.StaLetterVO;
import java.time.LocalDate;
import java.util.Collection;
import java.util.List;

/**
 * 信箱表（仅查看） Service接口
 *
 * @author zhanghaijun
 * @date 2021-07-20 10:55:41
 */
public interface EduLetterBoxService extends IService<EduLetterBox> {
    List<EduLetterBox> findListViewLetter(EduLetterBox letterBox);

    IPage<EduLetterBox> findList(Page page, String title, Long schoolId, String contentType, String appPhone, Integer reply);

    IPage<EduLetterBox> findViewList(Page page, String title, Long schoolId, Long identityId, Integer viewsNum);

    void listReplyLetter(LetterBoxDTO letterBoxDTO, Collection<EduLetterBox> eduLetterBoxes, CurrentUser currentUser);

    void submitReplyLetter(EduLetterBox eduLetterBox);

    /**
     * 点赞接口
     * @param letterId 信箱id
     * @param status 0为有用，1为没用
     * @param userId 用户id
     */
    void upOrDownLetter(Integer letterId, Integer status, Long userId,Integer type);

    /**
     * 查询详情
     * @param id 信件id
     * @param userId 用户id
     * @return 信箱
     */
    EduLetterBox getLetter(Integer id,Long userId);

    void addLetter(EduLetterBox eduLetterBox,CurrentUser currentUser);



    /**
     * 查询信箱统计数据
     * @return
     */
    StaLetterVO getStaData(LocalDate startDate,LocalDate endDate,List<Long> schoolIds);

    /**
     * 标题词云
     * @param startDate
     * @param endDate
     * @return
     */
    List<NameValueVO<String,Integer>> titleCloud(String startDate,String endDate,List<Long> schoolIds);
}
