Skip to content

Commit

Permalink
refactor: 출발 알림 타입을 가진 알림만 상태를 DONE으로 변경하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
hyeon0208 committed Sep 10, 2024
1 parent 72e97e0 commit 5d8259d
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,17 @@ public void sendNudgeMessage(Notification notification, NudgeMessage nudgeMessag
private void sendMessage(Message message, Notification notification) {
try {
FirebaseMessaging.getInstance().send(message);
notification.updateStatusToDone();
log.info("알림 상태 업데이트 : {}", notification);
updateDepartureReminderToDone(notification);
} catch (FirebaseMessagingException exception) {
log.error("Fcm 메시지 전송 실패 : {}", exception.getMessage());
throw new OdyServerErrorException(exception.getMessage());
}
}

private void updateDepartureReminderToDone(Notification notification) {
if (notification.isDepartureReminder()) {
notification.updateStatusToDone();
log.info("출발 알림 상태 업데이트 : {}", notification);
}
}
}

0 comments on commit 5d8259d

Please sign in to comment.