-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/161 알림 읽음 처리 #170
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
Feature/161 알림 읽음 처리 #170
Conversation
src/main/java/com/somemore/notification/controller/NotificationCommandController.java
Outdated
Show resolved
Hide resolved
| @Secured({"ROLE_VOLUNTEER", "ROLE_CENTER"}) | ||
| @Operation(summary = "알림(N개) 읽음 처리", description = "알림 N개를 읽음 처리합니다.") | ||
| @PostMapping("/read/multiple") | ||
| public ApiResponse<String> markMultipleNotifications( |
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.
프론트에서는 어떤식으로 처리가 되는건가요 한개와 N개의 호출을 어떻게 하는건지 궁금합니다
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.
- 모두 읽음 처리
- 프론트에서 lazy한 알림 읽음 처리 요청
- 체크박스를 통한 알림 읽음 처리
위 3가지 모두 프론트엔드에서 이뤄지는 로직입니다.
| notifications.forEach(notification -> | ||
| validateNotificationOwnership(userId, notification.getReceiverId())); | ||
|
|
||
| notifications.forEach(Notification::markAsRead); |
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.
리스트를 업데이트 해줬을때 트랜잭션 종료시 save로 저장이 되는건지 saveAll로 되는건지 궁금합니다
혹시 전자라면 saveAll을 명시해주는것도 좋을것 같아요
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.
성능 관점에서 saveAll이 좋을 것 같습니다. 더티체킹을 적극 활용하고 싶어서 의도적으로 save를 명시하지 않았습니다.
|
|
||
| for (int i = 0; i < 10; i++) { | ||
| for (long i = 1; i <= 10; i++) { | ||
| Notification unreadNotification = Notification.builder() |
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.
처리하겠습니다~
|
|
||
| // then | ||
| assertThat(notifications).isEmpty(); | ||
| assertThat(notifications).hasSize(10); |
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.
빈 리스트를 반환하는데 hasSize가 10인 이유가 궁금합니다
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.
beforeEach 때문에 설정해두고 까먹었네요 deleteAllInBatch로 테스트 가독성 확보하겠습니다!
c9a866d to
1b6b5c7
Compare
ayoung-dev
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.
고생하셨습니다
leebs0521
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.
고생하셨습니다.!!
- 1건, N건. - 쪽지 수신자와 읽음 요청 유저 아이디 검증 추가.
1b6b5c7 to
90d662b
Compare
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.
빌드에 실패했습니다.
|



resolved :
📌 과제 설명
알림 읽음 처리
👩💻 요구 사항과 구현 내용
✅ PR 포인트 & 궁금한 점