From 1123266f5acfa6fcdd0d9f105446c338e9906c7d Mon Sep 17 00:00:00 2001 From: Hong0329 Date: Mon, 27 May 2024 15:00:41 +0900 Subject: [PATCH] =?UTF-8?q?[FIX]=ED=85=8C=EC=8A=A4=ED=8A=B8=EB=A5=BC=20?= =?UTF-8?q?=EC=9C=84=ED=95=B4=20=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/ContentCommandService.java | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/DontBeServer/src/main/java/com/dontbe/www/DontBeServer/api/content/service/ContentCommandService.java b/DontBeServer/src/main/java/com/dontbe/www/DontBeServer/api/content/service/ContentCommandService.java index 955deaf..706884f 100644 --- a/DontBeServer/src/main/java/com/dontbe/www/DontBeServer/api/content/service/ContentCommandService.java +++ b/DontBeServer/src/main/java/com/dontbe/www/DontBeServer/api/content/service/ContentCommandService.java @@ -113,29 +113,29 @@ public void likeContent(Long memberId, Long contentId, ContentLikedRequestDto co .notificationText("") .build(); Notification savedNotification = notificationRepository.save(notification); + } + + if (Boolean.TRUE.equals(targetMember.getIsPushAlarmAllowed())) { + String FcmMessageTitle = triggerMember.getNickname() + "님이 " + targetMember.getNickname() + "님의 글을 좋아합니다."; + + FcmMessageDto contentLikeFcmMessage = FcmMessageDto.builder() + .validateOnly(false) + .message(FcmMessageDto.Message.builder() + .notificationDetails(FcmMessageDto.NotificationDetails.builder() + .title(FcmMessageTitle) + .body("") + .build()) + .token(targetMember.getFcmToken()) + .data(FcmMessageDto.Data.builder() + .name("contentLike") + .description("게시글 좋아요 푸시 알림") + .relateContentId(String.valueOf(contentId)) + .build()) + .build()) + .build(); + fcmService.sendMessage(contentLikeFcmMessage); - if (Boolean.TRUE.equals(targetMember.getIsPushAlarmAllowed())) { - String FcmMessageTitle = triggerMember.getNickname() + "님이 " + targetMember.getNickname() + "님의 글을 좋아합니다."; - - FcmMessageDto contentLikeFcmMessage = FcmMessageDto.builder() - .validateOnly(false) - .message(FcmMessageDto.Message.builder() - .notificationDetails(FcmMessageDto.NotificationDetails.builder() - .title(FcmMessageTitle) - .body("") - .build()) - .token(targetMember.getFcmToken()) - .data(FcmMessageDto.Data.builder() - .name("contentLike") - .description("게시글 좋아요 푸시 알림") - .relateContentId(String.valueOf(contentId)) - .build()) - .build()) - .build(); - - fcmService.sendMessage(contentLikeFcmMessage); - } } }