Fix/panel npe 버그 수정#121
Hidden character warning
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughHomeService now retrieves today’s diary and quiz via date-scoped repository queries and uses stream().findFirst().orElse(null) instead of list.get(0). DiaryRepository adds a JPQL method findTodayDiaryByUser(User, LocalDateTime, LocalDateTime) using createdAt and BETWEEN for filtering. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor U as User
participant HS as HomeService
participant DR as DiaryRepository
participant QR as QuizRepository
U->>HS: getHomeData()
HS->>DR: findTodayDiaryByUser(user, startOfDay, endOfDay)
DR-->>HS: List<Diary>
HS->>HS: diary = list.stream().findFirst().orElse(null)
HS->>QR: findAllTodayUserQuizByUser(user, startOfDay, endOfDay)
QR-->>HS: List<UserQuiz>
HS->>HS: quiz = list.stream().findFirst().orElse(null)
alt diary or quiz is null
HS->>HS: handle nulls in completion logic
else both present
HS->>HS: proceed with existing logic
end
HS-->>U: Home data response
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Suggested labels
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (2)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Fix/panel npe 버그 수정
UserQuiz out of bound 문제 해결
Summary by CodeRabbit