Skip to content
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

[Feat]: 푸시알림 에러시 로그만찍도록 변경 (#100) #101

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public ResponseEntity<ApiResponse<Void>> 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(
Expand Down
Loading