18 lines
401 B
Go
18 lines
401 B
Go
package repository
|
|
|
|
import (
|
|
"context"
|
|
"highload/internal/model"
|
|
"time"
|
|
)
|
|
|
|
type MessageRepository interface {
|
|
CreateMessage(ctx context.Context, chatID, senderID, text, key string) (*model.Message, error)
|
|
GetMessagesByChatID(ctx context.Context, chatID string, limit int, after *MessagePosition) ([]*model.Message, error)
|
|
}
|
|
|
|
type MessagePosition struct {
|
|
CreatedAt time.Time
|
|
ID string
|
|
}
|