diff --git a/backend/moment/moment-server/gateway/src/main/resources/application.yml b/backend/moment/moment-server/gateway/src/main/resources/application.yml index 49f1ea3007..4f3bf6e58a 100644 --- a/backend/moment/moment-server/gateway/src/main/resources/application.yml +++ b/backend/moment/moment-server/gateway/src/main/resources/application.yml @@ -65,6 +65,10 @@ spring: filters: - RemoveRequestHeader=Cookie - AuthorizedUserJwtFilter + - id: noti-service + uri: lb://noti-service + predicates: + - Path=/noti/** application: diff --git a/backend/moment/moment-server/notification/src/main/java/com/moment/notification/DTO/FcmMessageDto.java b/backend/moment/moment-server/notification/src/main/java/com/moment/notification/DTO/FcmMessageDto.java index bea77c42e2..fbe65d1500 100644 --- a/backend/moment/moment-server/notification/src/main/java/com/moment/notification/DTO/FcmMessageDto.java +++ b/backend/moment/moment-server/notification/src/main/java/com/moment/notification/DTO/FcmMessageDto.java @@ -16,14 +16,14 @@ public class FcmMessageDto { @AllArgsConstructor @Getter public static class Message { - private Notification notification; + private Data data; private String token; } @Builder @AllArgsConstructor @Getter - public static class Notification { + public static class Data { private String title; private String body; private String image; diff --git a/backend/moment/moment-server/notification/src/main/java/com/moment/notification/service/FcmService.java b/backend/moment/moment-server/notification/src/main/java/com/moment/notification/service/FcmService.java index 3cdb96b9ab..e01d331fe4 100644 --- a/backend/moment/moment-server/notification/src/main/java/com/moment/notification/service/FcmService.java +++ b/backend/moment/moment-server/notification/src/main/java/com/moment/notification/service/FcmService.java @@ -54,7 +54,7 @@ public int sendMessageTo(FcmSendDto fcmSendDto) throws IOException { .build(); Response response = client.newCall(request).execute(); - log.info("response : {}", response.body().string()); + log.info("fcm response : {}", response.body().string()); return response.code(); } @@ -64,7 +64,7 @@ private String makeMessage(FcmSendDto fcmSendDto) throws JsonProcessingException FcmMessageDto fcmMessageDto = FcmMessageDto.builder() .message(FcmMessageDto.Message.builder() .token(fcmSendDto.getToken()) - .notification(FcmMessageDto.Notification.builder() + .data(FcmMessageDto.Data.builder() .title(fcmSendDto.getTitle()) .body(fcmSendDto.getBody()) .image(null)