diff --git a/src/main/java/zipdabang/server/converter/MemberConverter.java b/src/main/java/zipdabang/server/converter/MemberConverter.java index caf12fe..3563049 100644 --- a/src/main/java/zipdabang/server/converter/MemberConverter.java +++ b/src/main/java/zipdabang/server/converter/MemberConverter.java @@ -107,6 +107,7 @@ public static Member toSocialMember(MemberRequestDto.MemberInfoDto request, Stri .name(request.getName()) .phoneNum(request.getPhoneNum()) .termsAgree(new ArrayList<>()) + .fcmTokenList(new ArrayList<>()) .build(); return staticMemberRepository.save(member); } diff --git a/src/main/java/zipdabang/server/domain/member/FcmToken.java b/src/main/java/zipdabang/server/domain/member/FcmToken.java index 43aa8ba..a72eb4f 100644 --- a/src/main/java/zipdabang/server/domain/member/FcmToken.java +++ b/src/main/java/zipdabang/server/domain/member/FcmToken.java @@ -30,7 +30,7 @@ public class FcmToken { public void setMember(Member member){ if(this.member != null) - member.getFcmTokenList().remove(this); + this.member.getFcmTokenList().remove(this); this.member = member; member.getFcmTokenList().add(this); } diff --git a/src/main/java/zipdabang/server/service/serviceImpl/MemberServiceImpl.java b/src/main/java/zipdabang/server/service/serviceImpl/MemberServiceImpl.java index 14cc72b..578be35 100644 --- a/src/main/java/zipdabang/server/service/serviceImpl/MemberServiceImpl.java +++ b/src/main/java/zipdabang/server/service/serviceImpl/MemberServiceImpl.java @@ -285,6 +285,15 @@ public OAuthJoin.OAuthJoinDto joinInfoComplete(MemberRequestDto.MemberInfoDto re return savedTermsAgree; }).collect(Collectors.toList()); + FcmToken fcmToken = FcmToken.builder() + .token(request.getFcmToken()) + .serialNumber(request.getSerialNumber()) + .build(); + + fcmToken.setMember(joinUser); + + fcmTokenRepository.save(fcmToken); + return OAuthJoin.OAuthJoinDto.builder() .refreshToken(redisService.generateRefreshToken(request.getEmail()).getToken()) .accessToken(redisService.saveLoginStatus(joinUser.getMemberId(), tokenProvider.createAccessToken(joinUser.getMemberId(), type.equals("kakao") ? SocialType.KAKAO.toString() : SocialType.GOOGLE.toString(),request.getEmail(),Arrays.asList(new SimpleGrantedAuthority("USER"))))) diff --git a/src/main/java/zipdabang/server/web/dto/requestDto/MemberRequestDto.java b/src/main/java/zipdabang/server/web/dto/requestDto/MemberRequestDto.java index 968905f..2152def 100644 --- a/src/main/java/zipdabang/server/web/dto/requestDto/MemberRequestDto.java +++ b/src/main/java/zipdabang/server/web/dto/requestDto/MemberRequestDto.java @@ -80,6 +80,12 @@ public static class MemberInfoDto { @NotBlank private String phoneNum; + @NotBlank + private String fcmToken; + + @NotBlank + private String serialNumber; + private List agreeTermsIdList; private List preferBeverages; diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 032d138..0972f87 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -27,8 +27,8 @@ spring: properties: hibernate: dialect: org.hibernate.dialect.MySQL8Dialect -# show_sql: true -# format_sql: true + show_sql: true + format_sql: true use_sql_comments: true hbm2ddl: auto: update