-
Notifications
You must be signed in to change notification settings - Fork 0
♻️ Refactor: 실시간 알림기능 수정 #52
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
eb6bfcc
:recycle:Refactor: getLeaderMember() 접근 제어자 private으로 변경->클래스 내부에서만 사용
imjuyongp 1ca41c8
:recycle:Refactor: 알림 메세지 레코드 제거(별도 DB저장X)
imjuyongp 690f5cf
:recycle:Refactor: 알림 응답 dto에 동호회, 수신자 정보 추가
imjuyongp 8eb7065
:sparkles:Feat: 게시글 댓글 알람 생성
imjuyongp 5e857f0
:recycle:Refactor: 알람 기능 메서드 반환타입 void로 변경
imjuyongp e36f591
:spakrles:Feat: 대댓글 알림 기능 구현
imjuyongp 38d4233
:sparkles:Feat: 쪽지 알람 기능 구현
imjuyongp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
joinRequest.getClub()또는joinRequest.getUser()가 null일 경우 NPE 발생 가능joinRequest != null검사만으로는 체이닝된.getClub().getName(),.getUser().getNickname()호출의 안전성을 보장하지 못합니다. 연관 엔티티가 null이면NullPointerException이 발생합니다.Optional을 사용하면 null 체크 반복도 줄이고 체이닝 안전성도 확보할 수 있습니다.🛡️ Optional을 활용한 수정 제안
public static NotificationResponse from(Notification notification) { - var joinRequest = notification.getJoinClubRequest(); - + var joinRequest = Optional.ofNullable(notification.getJoinClubRequest()); + return NotificationResponse.builder() .id(notification.getId()) .type(notification.getType()) .isRead(notification.getIsRead()) - .joinRequestId(joinRequest != null ? joinRequest.getId() : null) - .clubName(joinRequest != null ? joinRequest.getClub().getName() : null) - .applicantNickname(joinRequest != null ? joinRequest.getUser().getNickname() : null) + .joinRequestId(joinRequest.map(jr -> jr.getId()).orElse(null)) + .clubName(joinRequest.map(jr -> jr.getClub()).map(club -> club.getName()).orElse(null)) + .applicantNickname(joinRequest.map(jr -> jr.getUser()).map(user -> user.getNickname()).orElse(null)) .targetId(notification.getTargetId()) .createdAt(notification.getCreatedAt()) .build(); }java.util.Optionalimport도 추가해야 합니다:📝 Committable suggestion
🤖 Prompt for AI Agents