Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] 리그에 해당하는 경기 전체 조회 #202

Merged
merged 6 commits into from
Sep 9, 2024

Conversation

Jin409
Copy link
Contributor

@Jin409 Jin409 commented Aug 13, 2024

🌍 이슈 번호

📝 구현 내용

  • 리그에 해당하는 경기 전체 조회

🍀 확인해야 할 부분

게임의 상태를 분류하는 코드를 DTO 에 넣는 것이 적절할지 고민이 됩니당

 public static LeagueResponseWithGames of(League league, List<Game> games) {
        List<GameDetailResponse> playingGames = games.stream()
                .filter(g -> g.getState().equals(GameState.PLAYING)).map(GameDetailResponse::of).toList();

        List<GameDetailResponse> scheduledGames = games.stream()
                .filter(g -> g.getState().equals(GameState.SCHEDULED)).map(GameDetailResponse::of).toList();

        List<GameDetailResponse> finishedGames = games.stream()
                .filter(g -> g.getState().equals(GameState.FINISHED)).map(GameDetailResponse::of).toList();

        return new LeagueResponseWithGames(
                league.getId(), league.getName(), league.getLeagueTeams().size(),
                league.getMaxRound().getDescription(), league.getStartAt(), league.getEndAt(), playingGames,
                scheduledGames, finishedGames
        );
    }

@Jin409 Jin409 changed the base branch from main to feat/#192-league August 13, 2024 06:34
@Jin409 Jin409 self-assigned this Aug 13, 2024
Copy link
Member

@hodadako hodadako left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생했어~!

@Jin409 Jin409 merged commit 88ebb0e into feat/#192-league Sep 9, 2024
1 check passed
@Jin409 Jin409 deleted the feat/#200-league branch September 9, 2024 05:59
@Jin409 Jin409 restored the feat/#200-league branch September 9, 2024 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] 대회에 해당하는 경기 전체 조회
3 participants