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

알림 전송 실패 시 로그 추가 #384

Merged
merged 2 commits into from
Sep 15, 2023
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 @@ -61,7 +61,12 @@ public Long create(final CreateMessageDto dto, final String baseUrl) {

private void sendNotification(final Message message, final String baseUrl) {
final Long profileImageId = ImageIdProcessor.process(message.getWriter().getProfileImage());
final String profileImageUrl = baseUrl.concat(String.valueOf(profileImageId));

// TODO: 2023/09/15 5차데모데이 이후 수정 예정
String profileImageUrl = null;
if (profileImageId != null) {
profileImageUrl = baseUrl.concat(String.valueOf(profileImageId));
}

final CreateNotificationDto dto = new CreateNotificationDto(
NotificationType.MESSAGE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.google.firebase.messaging.FirebaseMessagingException;
import com.google.firebase.messaging.Message;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

Expand All @@ -20,6 +21,7 @@
@Service
@Transactional(readOnly = true)
@RequiredArgsConstructor
@Slf4j
public class FcmNotificationService implements NotificationService {

private static final String NOTIFICATION_SEND_SUCCESS = "알림 전송 성공";
Expand Down Expand Up @@ -55,6 +57,7 @@ private String makeAndSendMessage(
firebaseMessaging.send(message);
return NOTIFICATION_SEND_SUCCESS;
} catch (FirebaseMessagingException ex) {
log.error("exception type : {}, ", ex.getClass().getSimpleName(), ex);
return NOTIFICATION_SEND_FAIL;
}
}
Expand Down