Skip to content

Commit

Permalink
Merge pull request #123 from IoTeaTime/feature/122-group-master-fcm-t…
Browse files Browse the repository at this point in the history
…opic-sub

feat: 방장 FCM Topic 구독 구현
  • Loading branch information
ywonchae1 authored Nov 14, 2024
2 parents 47edf8c + b00323f commit a92a84e
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit a92a84e

Please sign in to comment.