package com.yaoyuan.jiscuss.service;

import com.yaoyuan.jiscuss.entity.Message;

import java.util.List;

public interface IMessageService {

    /** Send a message from sender to receiver. */
    Message send(Integer senderId, Integer receiverId, String content);

    /** All messages in a conversation (ordered oldest→newest). */
    List<Message> getConversation(Integer userId, Integer otherId);

    /** Inbox: latest message per conversation, sorted by latest activity (max 50). */
    List<Message> getInbox(Integer userId);

    /** Unread message count for a user. */
    long countUnread(Integer userId);

    /** Mark an entire conversation as read for the current user. */
    void markConversationRead(Integer userId, Integer otherId);
}
