-
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] 테마 별 데일리 루틴 리스트 조회 #23
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.
수고하셨습니다~ 저도 이제 소셜로그인 폭풍 pr 모드 on.
|
||
private DailyTheme getTheme(Long id) { | ||
return dailyThemeRepository.findById(id) | ||
.orElseThrow(() -> new EntityNotFoundException(INVALID_THEME.getMessage())); |
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.
세미나에서는 repository에서 에러를 던지는 코드로 배웠는데 두 방법 중 service에서 에러를 던지는 코드로 작성하신 이유가 혹시 있다면 궁금합니다!
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.
오 이건 저도 궁금해요!
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.
좋은 질문입니다. 구두 회의로 의논 나눴으니 넘어가도록 하겠습니다!
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.
@csb9427 찬이와 구두로 논의했는데, Repository에서 예외를 던지면 데이터가 존재하지 않을 경우의 추가적인 처리가 한정적이라고 생각해서 서비스 예외 처리로 판단했어요. 서비스에서 Optional로 받아오면 데이터가 비어있을 때의 추가 처리가 좀 더 확장적으로 이루어질 수 있다고 생각합니다.
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.
자극받고 갑니다!! 고생하셨어요
@@ -22,6 +22,7 @@ public List<DailyRoutine> findAllByThemes(List<Long> themeIds) { | |||
return queryFactory | |||
.selectFrom(dailyRoutine) | |||
.where(dailyRoutine.theme.id.in(themeIds)) | |||
.orderBy(dailyRoutine.content.asc()) |
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.
asc는 생략 불가능한가요? 단순 궁금
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.
@csb9427 생략하면 컴파일 오류가 뜨더라구요 😅
|
||
private DailyTheme getTheme(Long id) { | ||
return dailyThemeRepository.findById(id) | ||
.orElseThrow(() -> new EntityNotFoundException(INVALID_THEME.getMessage())); |
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.
오 이건 저도 궁금해요!
✨ Related Issue
📝 기능 구현 명세
🐥 추가적인 언급 사항