Skip to content

Commit

Permalink
Merge pull request #101 from TeamSobokSobok/develop
Browse files Browse the repository at this point in the history
[Feat]: 푸시알림 에러시 로그만찍도록 변경 (#100)
  • Loading branch information
dev-Crayon authored Mar 5, 2024
2 parents 6fa1f08 + 1bfab41 commit e32abd9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
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

0 comments on commit e32abd9

Please sign in to comment.