refactor(tester): refactor api

This commit is contained in:
Vyacheslav1557 2025-03-29 00:36:23 +05:00
parent 3396746d60
commit 5536c086e0
11 changed files with 257 additions and 231 deletions

View file

@ -27,7 +27,7 @@ type ProblemPostgresRepository interface {
CreateProblem(ctx context.Context, q Querier, title string) (int32, error)
ReadProblemById(ctx context.Context, q Querier, id int32) (*models.Problem, error)
DeleteProblem(ctx context.Context, q Querier, id int32) error
ListProblems(ctx context.Context, q Querier, page int32, pageSize int32) ([]*models.ProblemListItem, int32, error)
ListProblems(ctx context.Context, q Querier, filter models.ProblemsFilter) (*models.ProblemsList, error)
UpdateProblem(ctx context.Context, q Querier, id int32, heading models.ProblemUpdate) error
}
@ -39,14 +39,14 @@ type ContestRepository interface {
DeleteTask(ctx context.Context, taskId int32) error
AddParticipant(ctx context.Context, contestId int32, userId int32) (int32, error)
DeleteParticipant(ctx context.Context, participantId int32) error
ReadRichTasks(ctx context.Context, contestId int32) ([]*models.TasksListItem, error)
ListContests(ctx context.Context, page int32, pageSize int32) ([]*models.ContestsListItem, int32, error)
ListParticipants(ctx context.Context, contestId int32, page int32, pageSize int32) ([]*models.ParticipantsListItem, int32, error)
ReadTasks(ctx context.Context, contestId int32) ([]*models.TasksListItem, error)
ListContests(ctx context.Context, filter models.ContestsFilter) (*models.ContestsList, error)
ListParticipants(ctx context.Context, filter models.ParticipantsFilter) (*models.ParticipantsList, error)
UpdateContest(ctx context.Context, id int32, contestUpdate models.ContestUpdate) error
UpdateParticipant(ctx context.Context, id int32, participantUpdate models.ParticipantUpdate) error
ReadSolution(ctx context.Context, id int32) (*models.Solution, error)
CreateSolution(ctx context.Context, creation *models.SolutionCreation) (int32, error)
ListSolutions(ctx context.Context, filters models.SolutionsFilter) ([]*models.SolutionsListItem, int32, error)
ListSolutions(ctx context.Context, filter models.SolutionsFilter) (*models.SolutionsList, error)
ReadTask(ctx context.Context, id int32) (*models.Task, error)
ReadMonitor(ctx context.Context, id int32) (*models.Monitor, error)
}