diff --git a/backend/src/main/java/com/festago/entryalert/application/EntryAlertFcmClient.java b/backend/src/main/java/com/festago/entryalert/application/EntryAlertFcmClient.java index 21e81ab14..920086a9e 100644 --- a/backend/src/main/java/com/festago/entryalert/application/EntryAlertFcmClient.java +++ b/backend/src/main/java/com/festago/entryalert/application/EntryAlertFcmClient.java @@ -11,16 +11,16 @@ public class EntryAlertFcmClient { private final FcmClient fcmClient; - private final EntryAlertStatusService entryAlertStatusService; + private final EntryAlertResultHandler entryAlertResultHandler; - public EntryAlertFcmClient(FcmClient fcmClient, EntryAlertStatusService entryAlertStatusService) { + public EntryAlertFcmClient(FcmClient fcmClient, EntryAlertResultHandler entryAlertResultHandler) { this.fcmClient = fcmClient; - this.entryAlertStatusService = entryAlertStatusService; + this.entryAlertResultHandler = entryAlertResultHandler; } @Async public void sendAll(Long entryAlertId, List tokens, FCMChannel channel, FcmPayload fcmPayload) { boolean isSuccess = fcmClient.sendAll(tokens, channel, fcmPayload); - entryAlertStatusService.updateRequestedEntryAlertStatus(entryAlertId, isSuccess); + entryAlertResultHandler.handle(entryAlertId, isSuccess); } } diff --git a/backend/src/main/java/com/festago/entryalert/application/EntryAlertStatusService.java b/backend/src/main/java/com/festago/entryalert/application/EntryAlertResultHandler.java similarity index 81% rename from backend/src/main/java/com/festago/entryalert/application/EntryAlertStatusService.java rename to backend/src/main/java/com/festago/entryalert/application/EntryAlertResultHandler.java index 8a4a71267..9500f6bed 100644 --- a/backend/src/main/java/com/festago/entryalert/application/EntryAlertStatusService.java +++ b/backend/src/main/java/com/festago/entryalert/application/EntryAlertResultHandler.java @@ -8,16 +8,16 @@ import org.springframework.transaction.annotation.Transactional; @Service -public class EntryAlertStatusService { +public class EntryAlertResultHandler { private final EntryAlertRepository entryAlertRepository; - public EntryAlertStatusService(EntryAlertRepository entryAlertRepository) { + public EntryAlertResultHandler(EntryAlertRepository entryAlertRepository) { this.entryAlertRepository = entryAlertRepository; } @Transactional - public void updateRequestedEntryAlertStatus(Long entryAlertId, boolean isSuccess) { + public void handle(Long entryAlertId, boolean isSuccess) { EntryAlert entryAlert = entryAlertRepository.findById(entryAlertId) .orElseThrow(() -> new NotFoundException(ErrorCode.ENTRY_ALERT_NOT_FOUND)); if (isSuccess) {