17 lines
429 B
Go
17 lines
429 B
Go
|
|
package repository
|
||
|
|
|
||
|
|
import (
|
||
|
|
"chat/internal/domain/entity"
|
||
|
|
"context"
|
||
|
|
)
|
||
|
|
|
||
|
|
// MessageRepository 定義訊息相關的資料存取介面
|
||
|
|
type MessageRepository interface {
|
||
|
|
// Insert 插入訊息
|
||
|
|
Insert(ctx context.Context, msg *entity.Message) error
|
||
|
|
|
||
|
|
// ListByRoom 查詢房間訊息(分頁)
|
||
|
|
ListByRoom(ctx context.Context, roomID string, bucketDay string, pageSize int, pageIndex int) ([]entity.Message, int64, error)
|
||
|
|
}
|
||
|
|
|