style: reformatted all files
This commit is contained in:
@@ -52,7 +52,16 @@ func (s *Service) DeleteResult(ctx context.Context, id uuid.UUID) error {
|
||||
return s.repo.Delete(ctx, id)
|
||||
}
|
||||
|
||||
func (s *Service) ListResults(ctx context.Context, pageSize int32, pageToken int32, competitionID *uuid.UUID, userID *uuid.UUID, status *domain.ResultStatus, minScore *float64, maxScore *float64) ([]domain.Result, int32, int32, error) {
|
||||
func (s *Service) ListResults(
|
||||
ctx context.Context,
|
||||
pageSize int32,
|
||||
pageToken int32,
|
||||
competitionID *uuid.UUID,
|
||||
userID *uuid.UUID,
|
||||
status *domain.ResultStatus,
|
||||
minScore *float64,
|
||||
maxScore *float64,
|
||||
) ([]domain.Result, int32, int32, error) {
|
||||
opts := repository.ListResultsOptions{
|
||||
Page: int(pageToken),
|
||||
PageSize: int(pageSize),
|
||||
@@ -76,11 +85,20 @@ func (s *Service) ListResults(ctx context.Context, pageSize int32, pageToken int
|
||||
return results, int32(total), nextPageToken, nil
|
||||
}
|
||||
|
||||
func (s *Service) GetByCompetitionAndUser(ctx context.Context, competitionID uuid.UUID, userID uuid.UUID) (*domain.Result, error) {
|
||||
func (s *Service) GetByCompetitionAndUser(
|
||||
ctx context.Context,
|
||||
competitionID uuid.UUID,
|
||||
userID uuid.UUID,
|
||||
) (*domain.Result, error) {
|
||||
return s.repo.GetByCompetitionAndUser(ctx, competitionID, userID)
|
||||
}
|
||||
|
||||
func (s *Service) GetLeaderboard(ctx context.Context, competitionID uuid.UUID, limit int32, offset int32) ([]domain.Result, int32, error) {
|
||||
func (s *Service) GetLeaderboard(
|
||||
ctx context.Context,
|
||||
competitionID uuid.UUID,
|
||||
limit int32,
|
||||
offset int32,
|
||||
) ([]domain.Result, int32, error) {
|
||||
results, total, err := s.repo.GetLeaderboard(ctx, competitionID, int(limit), int(offset))
|
||||
if err != nil {
|
||||
return nil, 0, err
|
||||
@@ -94,4 +112,4 @@ func (s *Service) UpdateStatus(ctx context.Context, id uuid.UUID, status domain.
|
||||
|
||||
func (s *Service) RecalculateRanks(ctx context.Context, competitionID uuid.UUID) error {
|
||||
return s.repo.RecalculateRanks(ctx, competitionID)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user