forked from mtusi2026/mtusi2026lab2
22 lines
1010 B
Go
22 lines
1010 B
Go
package chat
|
|
|
|
import (
|
|
"context"
|
|
|
|
"gitflic.ru/akselbant/mtusi2026lab1-fork/internal/pkg/domain"
|
|
)
|
|
|
|
// UseCase is the application boundary required by the HTTP handler.
|
|
type UseCase interface {
|
|
Ready(context.Context) error
|
|
CreateSession(context.Context, string, string) (domain.Login, error)
|
|
DeleteSession(context.Context, string) error
|
|
Authenticate(ctx context.Context, token string) (domain.User, error)
|
|
CreateUser(ctx context.Context, user domain.User, password string) (domain.User, error)
|
|
CreateChat(ctx context.Context, callerID string, chat domain.Chat) (domain.Chat, error)
|
|
GetChat(ctx context.Context, callerID string, chat domain.Chat) (domain.Chat, error)
|
|
ListChats(ctx context.Context, callerID string, pagination domain.Pagination) (domain.ChatPage, error)
|
|
CreateMessage(ctx context.Context, callerID string, message domain.Message) (domain.Message, error)
|
|
ListMessages(ctx context.Context, callerID string, chat domain.Chat, pagination domain.Pagination) (domain.MessagePage, error)
|
|
}
|