diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/auth/service/MessageVerificationService.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/auth/service/MessageVerificationService.java index 9992f9e6a..178bf62e0 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/auth/service/MessageVerificationService.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/auth/service/MessageVerificationService.java @@ -14,6 +14,7 @@ import site.timecapsulearchive.core.infra.sms.dto.SmsApiResponse; @Service +@Transactional @RequiredArgsConstructor public class MessageVerificationService { @@ -42,6 +43,8 @@ public VerificationMessageSendResponse sendVerificationMessage( final SmsApiResponse apiResponse = smsApiService.sendMessage(receiver, message); + Member findMember = memberService.findMemberByMemberId(memberId); + findMember.updatePhoneNumber(receiver); messageAuthenticationCacheRepository.save(memberId, code); return VerificationMessageSendResponse.success(apiResponse.resultCode(), @@ -63,7 +66,6 @@ private String generateMessage(final String code, final String appHashKey) { + appHashKey; } - @Transactional public MemberRandomNicknameResponse getRandomNickname( final Long memberId, final Integer certificationNumber diff --git a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member/entity/Member.java b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member/entity/Member.java index 5a57c3483..d2c9d4bce 100644 --- a/backend/core/src/main/java/site/timecapsulearchive/core/domain/member/entity/Member.java +++ b/backend/core/src/main/java/site/timecapsulearchive/core/domain/member/entity/Member.java @@ -100,4 +100,9 @@ private Member(String profileUrl, SocialType socialType, String email, String au public void updateVerification() { this.isVerified = true; } + + public void updatePhoneNumber(String phone) { + this.phone = phone; + } + }