feat(backend.domain): lab2 add new errors and new session repo

This commit is contained in:
Голиков Maximillian Антон
2026-10-01 09:10:14 +03:00
parent 3d9e944c9a
commit 99df603bd4
2 changed files with 26 additions and 7 deletions
+7
View File
@@ -12,9 +12,16 @@ type ChatRepository interface {
Create(ctx context.Context, chat *Chat) error
GetByID(ctx context.Context, id string) (*Chat, error)
ListByMember(ctx context.Context, userID string, limit int, cursor *string) ([]Chat, *string, error)
IsMember(ctx context.Context, chatID, userID string) (bool, error)
}
type MessageRepository interface {
Create(ctx context.Context, message *Message) error
ListByChat(ctx context.Context, chatID string, limit int, cursor *string) ([]Message, *string, error)
}
type SessionRepository interface {
Create(ctx context.Context, session *Session) error
GetByTokenHash(ctx context.Context, tokenHash []byte) (*Session, error)
DeleteByTokenHash(ctx context.Context, tokenHash []byte) error
}