fix: fix&refactor

This commit is contained in:
Vyacheslav1557 2025-03-29 03:28:30 +05:00
parent 5536c086e0
commit 318599cfea
5 changed files with 84 additions and 52 deletions

View file

@ -46,16 +46,16 @@ func (uc *ContestUseCase) DeleteParticipant(ctx context.Context, participantId i
return uc.contestRepo.DeleteParticipant(ctx, participantId)
}
func (uc *ContestUseCase) ReadRichTasks(ctx context.Context, contestId int32) ([]*models.TasksListItem, error) {
return uc.contestRepo.ReadRichTasks(ctx, contestId)
func (uc *ContestUseCase) ReadTasks(ctx context.Context, contestId int32) ([]*models.TasksListItem, error) {
return uc.contestRepo.ReadTasks(ctx, contestId)
}
func (uc *ContestUseCase) ListContests(ctx context.Context, page int32, pageSize int32) ([]*models.ContestsListItem, int32, error) {
return uc.contestRepo.ListContests(ctx, page, pageSize)
func (uc *ContestUseCase) ListContests(ctx context.Context, filter models.ContestsFilter) (*models.ContestsList, error) {
return uc.contestRepo.ListContests(ctx, filter)
}
func (uc *ContestUseCase) ListParticipants(ctx context.Context, contestId int32, page int32, pageSize int32) ([]*models.ParticipantsListItem, int32, error) {
return uc.contestRepo.ListParticipants(ctx, contestId, page, pageSize)
func (uc *ContestUseCase) ListParticipants(ctx context.Context, filter models.ParticipantsFilter) (*models.ParticipantsList, error) {
return uc.contestRepo.ListParticipants(ctx, filter)
}
func (uc *ContestUseCase) UpdateContest(ctx context.Context, id int32, contestUpdate models.ContestUpdate) error {
@ -74,8 +74,8 @@ func (uc *ContestUseCase) CreateSolution(ctx context.Context, creation *models.S
return uc.contestRepo.CreateSolution(ctx, creation)
}
func (uc *ContestUseCase) ListSolutions(ctx context.Context, filters models.SolutionsFilter) ([]*models.SolutionsListItem, int32, error) {
return uc.contestRepo.ListSolutions(ctx, filters)
func (uc *ContestUseCase) ListSolutions(ctx context.Context, filter models.SolutionsFilter) (*models.SolutionsList, error) {
return uc.contestRepo.ListSolutions(ctx, filter)
}
func (uc *ContestUseCase) ReadTask(ctx context.Context, id int32) (*models.Task, error) {

View file

@ -38,8 +38,8 @@ func (u *ProblemUseCase) DeleteProblem(ctx context.Context, id int32) error {
return u.problemRepo.DeleteProblem(ctx, u.problemRepo.DB(), id)
}
func (u *ProblemUseCase) ListProblems(ctx context.Context, page int32, pageSize int32) ([]*models.ProblemsListItem, int32, error) {
return u.problemRepo.ListProblems(ctx, u.problemRepo.DB(), page, pageSize)
func (u *ProblemUseCase) ListProblems(ctx context.Context, filter models.ProblemsFilter) (*models.ProblemsList, error) {
return u.problemRepo.ListProblems(ctx, u.problemRepo.DB(), filter)
}
func (u *ProblemUseCase) UpdateProblem(ctx context.Context, id int32, problemUpdate models.ProblemUpdate) error {