-
Notifications
You must be signed in to change notification settings - Fork 0
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] 매니저가 관리하는 리그 전체 조회 기능 구현(대회 관리 페이지) #226
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다. 리뷰 남긴거 확인해주세요~
Map<String, Integer> orderMap = new HashMap<>(); | ||
orderMap.put(LeagueProgress.IN_PROGRESS.getDescription(), 1); | ||
orderMap.put(LeagueProgress.BEFORE_START.getDescription(), 2); | ||
orderMap.put(LeagueProgress.FINISHED.getDescription(), 3); | ||
|
||
Comparator<League> comparator = Comparator.comparing( | ||
league -> orderMap.get(LeagueProgress.getProgressDescription(LocalDateTime.now(), league))); | ||
|
||
return leagues.stream() | ||
.sorted(comparator) | ||
.map(LeagueResponseToManage::new) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 정렬 순서에 대한 요구사항이 변경된다면 어떻게 될까요? (시작 전, 진행 중, 완료)
- Map의 정적 팩토리 메서드를 사용하면 어떤 식으로 코드를 바꿀 수 있을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1의 경우 맵을 static으로 구현하지 않아 정렬 순서 변경 시 서비스단, 서비스 테스트단 두 군데에서 변경해야 한다는 의미에서 주신 질문인가요?-?
src/test/java/com/sports/server/query/application/LeagueQueryServiceTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저도 DTO 가 좀 많은 것 같아서 살펴보니 LeagueDetailResponse 와 id 빼고 전부 일치하네요..!
LeagueDetailResponse 에 id 를 추가하거나 하는 방식으로 DTO 개수를 줄이는 건 어떨까요?
src/main/java/com/sports/server/query/dto/response/LeagueResponseToManage.java
Show resolved
Hide resolved
e3bef92
to
d0f03f2
Compare
요렇게 승희님과 대면으로 논의했습니당 |
🌍 이슈 번호
📝 구현 내용
🍀 확인해야 할 부분