-
Notifications
You must be signed in to change notification settings - Fork 2
refactor(notification): 알림 api 로직 및 메시지 수정, 읽음 처리 기능 구현 #356
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
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.
코드 확인했습니다!
알림 기능이 확장되어서 서비스가 더욱 풍부해진것 같아 좋네요!
| List<Notification> unreadNotifications = notificationRepository.findUnreadNotificationsByUserId(userId); | ||
| unreadNotifications.forEach(Notification::markAsRead); | ||
| notificationRepository.saveAll(unreadNotifications); | ||
| } |
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.
읽지 않은 모든 알람들의 is_read값을 true로 바꾸시려는 의도라면,
현재(조회 -> 수정 -> 저장) 방법도 좋지만, Update 쿼리(수정)를 사용하는 방법도 추천드려봅니다!
제가 루틴 완료를 매일 초기화하는 로직과 유사한 것 같아서 생각났습니다!
Update notifications n SET n.isRead = TRUE WHERE n.userId = :userId AND n.isRead IS FALSE
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.
오 추천감사합니당!
jeeehdev
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.
코드 확인했습니다! 고생하셨습니당!
Pull requests
작업한 내용
PR Point
📸 스크린샷
논의 사항 (선택)
closed #355