34 lines
1.8 KiB
Go
34 lines
1.8 KiB
Go
package contests
|
|
|
|
import (
|
|
"context"
|
|
"git.sch9.ru/new_gate/ms-tester/internal/models"
|
|
)
|
|
|
|
type UseCase interface {
|
|
CreateContest(ctx context.Context, title string) (int32, error)
|
|
GetContest(ctx context.Context, id int32) (*models.Contest, error)
|
|
DeleteContest(ctx context.Context, id int32) error
|
|
ListContests(ctx context.Context, filter models.ContestsFilter) (*models.ContestsList, error)
|
|
UpdateContest(ctx context.Context, id int32, contestUpdate models.ContestUpdate) error
|
|
|
|
CreateTask(ctx context.Context, contestId int32, taskId int32) (int32, error)
|
|
DeleteTask(ctx context.Context, taskId int32) error
|
|
GetTasks(ctx context.Context, contestId int32) ([]*models.TasksListItem, error)
|
|
GetTask(ctx context.Context, id int32) (*models.Task, error)
|
|
|
|
CreateParticipant(ctx context.Context, contestId int32, userId int32) (int32, error)
|
|
GetParticipantId(ctx context.Context, contestId int32, userId int32) (int32, error)
|
|
GetParticipantId2(ctx context.Context, taskId, userId int32) (int32, error)
|
|
GetParticipantId3(ctx context.Context, solutionId int32) (int32, error)
|
|
UpdateParticipant(ctx context.Context, id int32, participantUpdate models.ParticipantUpdate) error
|
|
DeleteParticipant(ctx context.Context, participantId int32) error
|
|
ListParticipants(ctx context.Context, filter models.ParticipantsFilter) (*models.ParticipantsList, error)
|
|
|
|
GetSolution(ctx context.Context, id int32) (*models.Solution, error)
|
|
CreateSolution(ctx context.Context, creation *models.SolutionCreation) (int32, error)
|
|
ListSolutions(ctx context.Context, filter models.SolutionsFilter) (*models.SolutionsList, error)
|
|
GetBestSolutions(ctx context.Context, contestId int32, participantId int32) ([]*models.SolutionsListItem, error)
|
|
|
|
GetMonitor(ctx context.Context, id int32) (*models.Monitor, error)
|
|
}
|