package shop.alien.lawyer.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import shop.alien.entity.result.R;
import shop.alien.entity.store.LawyerChatMessage;

import java.util.List;

/**
 * 聊天消息 服务类
 *
 * @author system
 * @since 2025-01-XX
 */
public interface LawyerChatMessageService extends IService<LawyerChatMessage> {

    /**
     * 分页查询聊天消息列表
     *
     * @param pageNum             页码
     * @param pageSize            页容
     * @param chatSessionId       聊天会话ID
     * @param consultationOrderId 咨询订单ID
     * @param senderType          发送者类型
     * @return IPage<LawyerChatMessage>
     */
    R<IPage<LawyerChatMessage>> getChatMessageList(int pageNum, int pageSize, Integer chatSessionId,
                                             Integer consultationOrderId, Integer senderType);

    /**
     * 根据会话ID查询消息列表
     *
     * @param chatSessionId 聊天会话ID
     * @return List<LawyerChatMessage>
     */
    List<LawyerChatMessage> getListBySessionId(Integer chatSessionId);

    /**
     * 新增聊天消息
     *
     * @param chatMessage 聊天消息
     * @return R<LawyerChatMessage>
     */
    R<LawyerChatMessage> addChatMessage(LawyerChatMessage chatMessage);

    /**
     * 编辑聊天消息
     *
     * @param chatMessage 聊天消息
     * @return R<LawyerChatMessage>
     */
    R<LawyerChatMessage> editChatMessage(LawyerChatMessage chatMessage);

    /**
     * 删除聊天消息
     *
     * @param id 主键
     * @return R<Boolean>
     */
    R<Boolean> deleteChatMessage(Integer id);
}

