Skip to content

Commit

Permalink
Merge pull request #147 from kookmin-sw/backend/develop/v3
Browse files Browse the repository at this point in the history
✅ fcm test api 추가
  • Loading branch information
J-Yong99 authored May 14, 2024
2 parents b63c859 + 4d54e9b commit 360e829
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ spring:
filters:
- RemoveRequestHeader=Cookie
- AuthorizedUserJwtFilter
- id: noti-service
uri: lb://noti-service
predicates:
- Path=/noti/**


application:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand All @@ -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)
Expand Down

0 comments on commit 360e829

Please sign in to comment.