-
Notifications
You must be signed in to change notification settings - Fork 2
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
[OING-379] feat: 알림 목록 조회 기능 추가 #280
base: dev
Are you sure you want to change the base?
Conversation
… and MissionUnlocked
Quality Gate passedIssues Measures |
Test Results 54 files 54 suites 12s ⏱️ Results for commit ef42eea. |
Code Coverage
|
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.
추가 논의되어야 하는 부분들이 많아 스타일적인 거에 대해서만 코멘트 남겼습니다! 복잡한 기능이라 구현할 부분이 많았는데 수고하셨어요~~
@Index(name = "user_notification_history_idx1", columnList = "sender_member_id"), | ||
@Index(name = "user_notification_history_idx2", columnList = "receiver_member_id") | ||
}) | ||
public class UserNotificationHistory extends BaseEntity { |
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.
저희 플젝에서 회원은 Member로 나타내고 있어서 통일성을 위해 User 대신 MemberNotificationHistory
로 바꾸는 건 어떠신가요??
@Schema(description = "알림 스타일", example = "BIRTHDAY") | ||
NotificationStyle style, | ||
@Schema(description = "발송자 프로필 스타일", example = "BIRTHDAY") | ||
ProfileStyle sencerProfileStyle, |
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.
오타가 있어요! senderProfileStyle
로 바꿔주세요~
@Scheduled(cron = "0 0 13 * * *", zone = "Asia/Seoul") // 1:00 PM | ||
@SchedulerLock(name = "NextWeekBirthdayNotificationSchedule", lockAtMostFor = "PT30S", lockAtLeastFor = "PT30S") | ||
public void sendNextWeekBirthdayNotification() { | ||
LocalDate nextWeek = LocalDate.now().plusWeeks(1); | ||
List<Member> birthdayMembers = memberService.findBirthdayMembersByDate(nextWeek); | ||
|
||
birthdayMembers.forEach(sender -> { | ||
List<String> receiverMemberIds = memberService.getFamilyMembersIdsByFamilyId(sender.getFamilyId()); | ||
receiverMemberIds.remove(sender.getId()); | ||
|
||
userNotificationHistoryService.appendNextWeekBirthdayNotiHistory(sender.getName(), sender.getId(), receiverMemberIds); | ||
}); | ||
} |
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.
아래 기능들과 내부 로직이 비슷한데 아래처럼 공통 로직을 추출하는 건 어떠신가요??
@Scheduled(cron = "0 0 13 * * *", zone = "Asia/Seoul")
@SchedulerLock(name = "NextWeekBirthdayNotificationSchedule", lockAtMostFor = "PT30S", lockAtLeastFor = "PT30S")
public void sendNextWeekBirthdayNotification() {
sendBirthdayNotification(LocalDate.now().plusWeeks(1), "nextWeek");
}
@Scheduled(cron = "0 0 13 * * *", zone = "Asia/Seoul")
@SchedulerLock(name = "TomorrowBirthdayNotificationSchedule", lockAtMostFor = "PT30S", lockAtLeastFor = "PT30S")
public void sendTomorrowBirthdayNotification() {
sendBirthdayNotification(LocalDate.now().plusDays(1), "tomorrow");
}
@Scheduled(cron = "0 0 13 * * *", zone = "Asia/Seoul")
@SchedulerLock(name = "TodayBirthdayNotificationSchedule", lockAtMostFor = "PT30S", lockAtLeastFor = "PT30S")
public void sendTodayBirthdayNotification() {
sendBirthdayNotification(LocalDate.now(), "today");
}
private void sendBirthdayNotification(LocalDate targetDate, String notificationType) {
List<Member> birthdayMembers = memberService.findBirthdayMembersByDate(targetDate);
birthdayMembers.forEach(sender -> {
List<String> receiverMemberIds = memberService.getFamilyMembersIdsByFamilyId(sender.getFamilyId());
receiverMemberIds.remove(sender.getId());
if (notificationType.equals("nextWeek")) {
userNotificationHistoryService.appendNextWeekBirthdayNotiHistory(sender.getName(), sender.getId(), receiverMemberIds);
} else if (notificationType.equals("tomorrow")) {
userNotificationHistoryService.appendTomorrowBirthdayNotiHistory(sender.getName(), sender.getId(), receiverMemberIds);
} else if (notificationType.equals("today")) {
userNotificationHistoryService.appendTodayBirthdayNotiHistory(sender.getName(), sender.getId(), receiverMemberIds);
}
});
}
❓ 기능 추가 배경
�알림 이력 화면에서 최근 한 달간 발생한 알림을 조회하기 위해, 관련 서버 기능을 추가했습니다.
➕ 추가/변경된 기능
🥺 리뷰어에게 하고싶은 말
알림 이력 기능에 대해 기획적으로 논의해야할 부분이 있어, 우선 필수적인 코드들을 우선 작성하고 PR을 올립니다.
전체 회의에서 추가 논의되어야 할 부분들은 다음과 같습니다.
🔗 참조 or 관련된 이슈
https://no5ing.atlassian.net/browse/OING-379