diff --git a/src/main/java/io/sobok/SobokSobok/external/firebase/FCMPushService.java b/src/main/java/io/sobok/SobokSobok/external/firebase/FCMPushService.java index 5fa880b..6cd5bc3 100644 --- a/src/main/java/io/sobok/SobokSobok/external/firebase/FCMPushService.java +++ b/src/main/java/io/sobok/SobokSobok/external/firebase/FCMPushService.java @@ -9,10 +9,12 @@ import io.sobok.SobokSobok.auth.infrastructure.UserRepository; import io.sobok.SobokSobok.external.firebase.dto.PushNotificationRequest; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @Service @RequiredArgsConstructor +@Slf4j public class FCMPushService { private final FirebaseMessaging firebaseMessaging; @@ -36,7 +38,7 @@ public void sendNotificationByToken(PushNotificationRequest request) { try { firebaseMessaging.send(message); } catch (FirebaseMessagingException e) { - throw new IllegalArgumentException("푸시알림 전송에 실패했습니다. userId: " + request.userId() + "\n" + e.getMessage()); + log.error("푸시알림 전송에 실패했습니다. userId: " + request.userId() + "\n" + e.getMessage()); } } } diff --git a/src/main/java/io/sobok/SobokSobok/notice/ui/NoticeController.java b/src/main/java/io/sobok/SobokSobok/notice/ui/NoticeController.java index ee05074..0714284 100644 --- a/src/main/java/io/sobok/SobokSobok/notice/ui/NoticeController.java +++ b/src/main/java/io/sobok/SobokSobok/notice/ui/NoticeController.java @@ -69,7 +69,7 @@ public ResponseEntity> completePillNotice( @RequestBody @Valid final CompletePillNoticeRequest request ) { - noticeService.completePillNotice(5L, pillId, request.isOkay()); + noticeService.completePillNotice(user.getId(), pillId, request.isOkay()); return ResponseEntity .status(HttpStatus.OK) .body(ApiResponse.success(