package org.dromara.main.service;

import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.main.domain.bo.CsMessageBo;
import org.dromara.main.domain.bo.CsSessionBo;
import org.dromara.main.domain.vo.CsMessageVo;
import org.dromara.main.domain.vo.CsSessionVo;

public interface ICsSessionService {

    /**
     * 创建或获取会话
     */
    CsSessionVo createOrGetSession(Integer sessionType, Long fromUserId,
                                   String fromUserName, String fromUserAvatar);

    /**
     * 查询会话列表
     */
    TableDataInfo<CsSessionVo> queryPageList(CsSessionBo bo, PageQuery pageQuery);

    /**
     * 查询会话详情
     */
    CsSessionVo queryById(Long sessionId);

    /**
     * 结束会话
     */
    Boolean endSession(Long sessionId);

    /**
     * 更新会话最后消息
     */
    Boolean updateLastMessage(Long sessionId, String lastMsg);

    /**
     * 增加未读数
     */
    Boolean incrementUnreadCount(Long sessionId);

    /**
     * 清空未读数
     */
    Boolean clearUnreadCount(Long sessionId);

}
