-
Notifications
You must be signed in to change notification settings - Fork 1
refactor/KD-68 : graduation User Response Type Add #325
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
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the
개요졸업생 사용자 API가 일정 정보를 통합하도록 수정되었습니다. GraduationUserFacade에 일정 조회 기능이 추가되었고, MyGraduationUserResponse의 응답 구조가 상태 필드에서 제목과 설명 필드로 리팩토링되었으며 제출 유형별 마감일 형식이 추가되었습니다. 변경사항
예상 코드 리뷰 소요 시간🎯 4 (복잡함) | ⏱️ ~45분 관련 가능성이 있는 PR
추천 레이블
추천 리뷰어
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In
`@aics-api/src/main/java/kgu/developers/api/graduationUser/application/GraduationUserFacade.java`:
- Around line 31-35: getMyGraduationUser currently only guards against
submissionType == null but calls
scheduleQueryService.getBySubmissionType(submissionType) which throws
ScheduleNotFoundException when no schedule exists; update getMyGraduationUser to
either use
scheduleQueryService.findBySubmissionType(submissionType).orElse(null) or wrap
the getBySubmissionType call in a try/catch for ScheduleNotFoundException and
set schedule to null so MyGraduationUserResponse.from(graduationUser, schedule)
receives a null schedule instead of letting the exception propagate.
| public MyGraduationUserResponse getMyGraduationUser() { | ||
| GraduationUser graduationUser = graduationUserQueryService.me(); | ||
| return MyGraduationUserResponse.from(graduationUser); | ||
| SubmissionType submissionType = MyGraduationUserResponse.requiredSubmissionType(graduationUser); | ||
| Schedule schedule = (submissionType == null) ? null : scheduleQueryService.getBySubmissionType(submissionType); | ||
| return MyGraduationUserResponse.from(graduationUser, schedule); |
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.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Find and examine ScheduleQueryService
fd -type f -name "*.java" | xargs rg -l "ScheduleQueryService" | head -20Repository: kgu-developers/aics-server
Length of output: 1407
🏁 Script executed:
#!/bin/bash
# Look for ScheduleQueryService class definition
rg -n "class ScheduleQueryService" -A 20Repository: kgu-developers/aics-server
Length of output: 5508
🏁 Script executed:
#!/bin/bash
# Search for getBySubmissionType method definition
rg -n "getBySubmissionType" -B 2 -A 5Repository: kgu-developers/aics-server
Length of output: 9292
🏁 Script executed:
#!/bin/bash
# Find MyGraduationUserResponse class and from() method
rg -n "class MyGraduationUserResponse" -A 30Repository: kgu-developers/aics-server
Length of output: 52
🏁 Script executed:
#!/bin/bash
# Search for MyGraduationUserResponse.from() method
rg -n "from\(" -B 2 -A 10 | grep -A 10 "MyGraduationUserResponse"Repository: kgu-developers/aics-server
Length of output: 4763
🏁 Script executed:
#!/bin/bash
# Find ScheduleNotFoundException to understand exception type
rg -n "ScheduleNotFoundException" -B 2 -A 5Repository: kgu-developers/aics-server
Length of output: 14587
스케줄 미존재 시 예외 처리 필요
getBySubmissionType()은 스케줄이 없을 때 ScheduleNotFoundException을 던지도록 구현되어 있습니다. 현재 코드에서는 submissionType == null인 경우만 방어하고 있어서, submissionType이 non-null이지만 해당 스케줄이 존재하지 않으면 예외가 처리되지 않아 500 에러로 응답하게 됩니다. 이는 MyGraduationUserResponse.from()의 null 스케줄 fallback 로직이 동작할 수 없음을 의미합니다.
Optional을 활용하거나 예외를 캐치하여 schedule을 null 처리하는 방식으로 개선해주세요:
// 방법 1: Optional 활용
Schedule schedule = (submissionType == null) ? null : scheduleQueryService.findBySubmissionType(submissionType).orElse(null);
// 방법 2: 예외 캐치
Schedule schedule = null;
if (submissionType != null) {
try {
schedule = scheduleQueryService.getBySubmissionType(submissionType);
} catch (ScheduleNotFoundException e) {
// schedule은 null로 유지
}
}🤖 Prompt for AI Agents
In
`@aics-api/src/main/java/kgu/developers/api/graduationUser/application/GraduationUserFacade.java`
around lines 31 - 35, getMyGraduationUser currently only guards against
submissionType == null but calls
scheduleQueryService.getBySubmissionType(submissionType) which throws
ScheduleNotFoundException when no schedule exists; update getMyGraduationUser to
either use
scheduleQueryService.findBySubmissionType(submissionType).orElse(null) or wrap
the getBySubmissionType call in a try/catch for ScheduleNotFoundException and
set schedule to null so MyGraduationUserResponse.from(graduationUser, schedule)
receives a null schedule instead of letting the exception propagate.
Test Coverage Report
Files
|
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## develop #325 +/- ##
=============================================
- Coverage 87.25% 86.97% -0.29%
Complexity 67 67
=============================================
Files 24 24
Lines 259 261 +2
Branches 14 15 +1
=============================================
+ Hits 226 227 +1
Misses 21 21
- Partials 12 13 +1
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
dkdltm221
left a comment
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.
LGTM! 문제없어보입니다.
리뷰 하나만 확인해주세요
...n/java/kgu/developers/api/graduationUser/presentation/response/MyGraduationUserResponse.java
Outdated
Show resolved
Hide resolved
JangYeongHu
left a comment
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.
LGTM! 리뷰만 반영부탁드립니다
Summary
해당 PR에 대한 요약을 작성해주세요.
Tasks