From bff5dd57583a95c1fa35031d8d8d08362a673aad Mon Sep 17 00:00:00 2001 From: BGuga Date: Fri, 15 Sep 2023 22:45:47 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=9C=A0=EC=A0=80=20=ED=83=88=ED=87=B4?= =?UTF-8?q?=EC=8B=9C=20=EC=9C=A0=EC=A0=80=EC=9D=98=20FCM=20=EC=9D=84=20?= =?UTF-8?q?=EB=AA=A8=EB=91=90=20=EC=82=AD=EC=A0=9C=ED=95=9C=EB=8B=A4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/festago/auth/application/AuthService.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/backend/src/main/java/com/festago/auth/application/AuthService.java b/backend/src/main/java/com/festago/auth/application/AuthService.java index 7a7cfc6a4..1c1e7721a 100644 --- a/backend/src/main/java/com/festago/auth/application/AuthService.java +++ b/backend/src/main/java/com/festago/auth/application/AuthService.java @@ -39,9 +39,13 @@ public LoginMemberDto login(UserInfo userInfo, String fcmToken) { private void enrollFcm(Member member, String fcmToken) { // TODO : 멤버의 모든 FCM 을 지우지 않기 위해서는 멤버의 디바이스에 대한 식별자가 필요합니다. + deleteFCM(member); + memberFCMRepository.save(new MemberFCM(member, fcmToken)); + } + + private void deleteFCM(Member member) { List originFCMs = memberFCMRepository.findByMemberId(member.getId()); memberFCMRepository.deleteAll(originFCMs); - memberFCMRepository.save(new MemberFCM(member, fcmToken)); } private Member signUp(UserInfo userInfo) { @@ -52,5 +56,6 @@ public void deleteMember(Long memberId) { Member member = memberRepository.findById(memberId) .orElseThrow(() -> new NotFoundException(ErrorCode.MEMBER_NOT_FOUND)); memberRepository.delete(member); + deleteFCM(member); } }