Conversation
5nam
left a comment
There was a problem hiding this comment.
전적 로직이 복잡한데, 구현하시느라 고생 많으셨습니다! :)
| import lombok.AllArgsConstructor; | ||
| import lombok.Data; | ||
|
|
||
| public class StatisticDTO { |
There was a problem hiding this comment.
StatisticDTO에 Request, Response 모아서 구현하신 이유가 궁금합니다!
There was a problem hiding this comment.
DTO들이 많아지면 관리하기가 힘들어진다고 생각이 들어서 이너 클래스로 관련된 DTO들을 모아서 구현했습니다!
| int homeRankLevel = homeStatistic.getTier().getLevel(); | ||
| int awayRankLevel = awayStatistic.getTier().getLevel(); | ||
|
|
||
| StatisticDTO.mvpDTO homeMVPResult = statisticRepository.findTopScorerByClubAndSportsType(match.getHomeClub(), currentSeason, SportsType.OVERALL).get(0); |
There was a problem hiding this comment.
전적 데이터가 있는지 확인하는 orElseThrow 등의 로직이 있으면 좋을 것 같습니다!(.get(0) 이 NullPointException 가능성이 있어 보입니다)
There was a problem hiding this comment.
엇 그걸 생각하지 못했네요! 피드백 감사합니다!!
y3binchoi
left a comment
There was a problem hiding this comment.
매치 전적 부분이 취합할게 많아 고민이 많으셨을텐데 수고하셨습니다! 확실히 이 부분은 테스트를 넣어서 반드시 흐름을 확인해보고 배포해야 할 것 같아요!
| public class StatisticDTO { | ||
| @Data | ||
| @AllArgsConstructor | ||
| public static class StatisticRequest { |
There was a problem hiding this comment.
기존 코드 규칙에 따라 RequestBody, ResponseBody가 되는 DTO를 모두 XxxInput, XxxOutput으로 통일하는 게 좋을 것 같아요!
| public StatisticControllerAdvice(ResponseCode responseCode) { | ||
| super(responseCode); | ||
| } | ||
| // @ExceptionHandler |
There was a problem hiding this comment.
거의 확실하게 안쓰이는 코드라면 삭제해도 좋을 것 같습니다! 버전 관리 기록에 남아있을테니까요 :)
매치 전적 구현
📌 변경 사항 (What’s changed?)
⚙️ 변경 이유 (Why?)
✅ 테스트 방법 (How to test?)
🤔 기타 참고 사항