From b00323fca96ec8ffbc2cff315dca6068254e6c16 Mon Sep 17 00:00:00 2001 From: ywonchae1 Date: Thu, 14 Nov 2024 17:47:51 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=B0=A9=EC=9E=A5=20FCM=20Topic=20?= =?UTF-8?q?=EA=B5=AC=EB=8F=85=20=EA=B5=AC=ED=98=84=20(#122)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../meonghanyangserver/group/service/GroupService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/org/ioteatime/meonghanyangserver/group/service/GroupService.java b/src/main/java/org/ioteatime/meonghanyangserver/group/service/GroupService.java index 5c34013e..83504db5 100644 --- a/src/main/java/org/ioteatime/meonghanyangserver/group/service/GroupService.java +++ b/src/main/java/org/ioteatime/meonghanyangserver/group/service/GroupService.java @@ -3,6 +3,7 @@ import jakarta.transaction.Transactional; import java.util.Optional; import lombok.RequiredArgsConstructor; +import org.ioteatime.meonghanyangserver.clients.google.FcmClient; import org.ioteatime.meonghanyangserver.common.exception.BadRequestException; import org.ioteatime.meonghanyangserver.common.exception.NotFoundException; import org.ioteatime.meonghanyangserver.common.type.AuthErrorType; @@ -24,6 +25,7 @@ @Service @RequiredArgsConstructor public class GroupService { + private final FcmClient fcmClient; private final GroupRepository groupRepository; private final MemberRepository memberRepository; private final GroupMemberService groupMemberService; @@ -56,6 +58,9 @@ public CreateGroupResponse createGroup(Long memberId) { groupMemberService.createGroupMember( newGroupEntity, memberEntity, GroupMemberRole.ROLE_MASTER, "thing id"); + // FCM 토픽 구독 + fcmClient.subTopic(memberEntity.getFcmToken(), fcmTopic); + return GroupResponseMapper.from(newGroupEntity); }