package usecase

import (
	"context"
)

// MessageUseCase 定義訊息相關的業務邏輯介面
type MessageUseCase interface {
	// SendMessage 發送訊息
	SendMessage(ctx context.Context, param SendMessageReq) error
	// ListMessages 查詢訊息列表（分頁）
	ListMessages(ctx context.Context, req ListMessagesReq) ([]Message, int64, error)
}

type SendMessageReq struct {
	RoomID  string
	UID     string
	Content string
}

type ListMessagesReq struct {
	RoomID    string
	UID       string
	BucketDay string
	PageSize  int64
	LastTS    int64
}

type Message struct {
	RoomID    string `json:"room_id"`
	BucketDay string `json:"bucket_day"` // yyyyMMdd
	TS        int64  `json:"ts"`         // timestamp
	UID       string `json:"uid"`
	Content   string `json:"content"`
}
