diff --git a/src/main/java/net/teumteum/alert/app/BeforeMeetingAlertHandler.java b/src/main/java/net/teumteum/alert/app/BeforeMeetingAlertHandler.java index 9723fb0..eb92855 100644 --- a/src/main/java/net/teumteum/alert/app/BeforeMeetingAlertHandler.java +++ b/src/main/java/net/teumteum/alert/app/BeforeMeetingAlertHandler.java @@ -24,7 +24,6 @@ public class BeforeMeetingAlertHandler { @Async(ALERT_EXECUTOR) @EventListener(MeetingAlerted.class) public void alert(MeetingAlerted alerted) { - System.out.println(">>> alert(" + alerted.userIds() + ")"); alertService.findAllByUserId(alerted.userIds()) .stream() .map(userAlert -> new BeforeMeetingAlert(userAlert.getUserId(), userAlert.getToken(), Instant.now())) diff --git a/src/main/java/net/teumteum/alert/domain/Alertable.java b/src/main/java/net/teumteum/alert/domain/Alertable.java index d2191a1..a0cf7e1 100644 --- a/src/main/java/net/teumteum/alert/domain/Alertable.java +++ b/src/main/java/net/teumteum/alert/domain/Alertable.java @@ -7,4 +7,6 @@ public interface Alertable { String title(); String body(); + + String type(); } diff --git a/src/main/java/net/teumteum/alert/domain/BeforeMeetingAlert.java b/src/main/java/net/teumteum/alert/domain/BeforeMeetingAlert.java index e81dffd..7f863fd 100644 --- a/src/main/java/net/teumteum/alert/domain/BeforeMeetingAlert.java +++ b/src/main/java/net/teumteum/alert/domain/BeforeMeetingAlert.java @@ -17,4 +17,9 @@ public String title() { public String body() { return "모임 장소로 가서 틈틈 모임을 준비해주세요."; } + + @Override + public String type() { + return "BEFORE_MEETING"; + } } diff --git a/src/main/java/net/teumteum/alert/infra/FcmAlertPublisher.java b/src/main/java/net/teumteum/alert/infra/FcmAlertPublisher.java index 6853283..aabf074 100644 --- a/src/main/java/net/teumteum/alert/infra/FcmAlertPublisher.java +++ b/src/main/java/net/teumteum/alert/infra/FcmAlertPublisher.java @@ -32,13 +32,11 @@ public class FcmAlertPublisher implements AlertPublisher { @Override @Async(FCM_ALERT_EXECUTOR) public void publish(BeforeMeetingAlert beforeMeetingAlert) { - System.out.println(">>> publish(" + beforeMeetingAlert + ")"); var message = buildMessage(beforeMeetingAlert); publishWithRetry(0, message, null); } private void publishWithRetry(int currentRetryCount, Message message, @Nullable ErrorCode errorCode) { - System.out.println(">>> publishWithRetry(" + currentRetryCount + ", " + message + ", " + errorCode + ")"); if (MAX_RETRY_COUNT == currentRetryCount) { return; } diff --git a/src/main/java/net/teumteum/meeting/service/MeetingAlertPublisher.java b/src/main/java/net/teumteum/meeting/service/MeetingAlertPublisher.java index bd6eafd..3d162de 100644 --- a/src/main/java/net/teumteum/meeting/service/MeetingAlertPublisher.java +++ b/src/main/java/net/teumteum/meeting/service/MeetingAlertPublisher.java @@ -21,13 +21,9 @@ public class MeetingAlertPublisher { @Scheduled(cron = EVERY_ONE_MINUTES) public void alertMeeting() { - System.out.println(">>> alertMeeting()"); var alertStart = LocalDateTime.now().plusMinutes(5).withNano(0).withSecond(0); - System.out.println(">>> alertStart " + alertStart); var alertEnd = alertStart.plusMinutes(1).withNano(0).withSecond(0); - System.out.println(">>> alertEnd " + alertEnd); var alertTargets = meetingRepository.findAlertMeetings(alertStart, alertEnd); - alertTargets.forEach(System.out::println); alertTargets.forEach(meeting -> eventPublisher.publishEvent( new MeetingAlerted(meeting.getParticipantUserIds()) )