Skip to content

Commit

Permalink
refactor: MemberService 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
axhtl committed Aug 11, 2024
1 parent 3cb9653 commit c67d7f8
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,6 @@ class AddressServiceImpl(
}
}

@Transactional(readOnly = true)
override fun getAddressById(addressId: Long): Address {
return addressRepository.findByAddressId(addressId)
?: throw ResponseStatusException(HttpStatus.NOT_FOUND, "배송지 정보를 찾을 수 없습니다.")
}

@Transactional
override fun addrSave(memberId: Long, createAddressRequest: CreateAddressRequest): Long {
memberRepository.findByMemberId(memberId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ interface MemberService {

fun modifyName(memberId: Long, modifyNameRequest: ModifyNameRequest)

fun signUp(createMemberDTO: CreateMemberRequest): Long

fun signupCertifyNumEmailSend(email: String)
fun saveMember(createMemberDTO: CreateMemberRequest): Long

fun getMemberByMemberId(memberId: Long): Member
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,6 @@ class MemberServiceImpl(
}
}

@Transactional(readOnly = true)
override fun getMemberByMemberId(memberId: Long): Member {
return memberRepository.findByIdOrNull(memberId)
?: throw NotFoundMemberException(ErrorCode.NOT_FOUND_MEMBER)
}

@Transactional
override fun modifyName(memberId: Long, modifyNameRequest: ModifyNameRequest) {
log.info { "회원 이름 수정 memberId = ${memberId}, name = ${modifyNameRequest.name}" }
Expand Down Expand Up @@ -151,24 +145,4 @@ class MemberServiceImpl(
return memberRepository.findByIdOrNull(memberId)
?: throw NotFoundMemberException(ErrorCode.NOT_FOUND_MEMBER)
}

private fun sendEmailAuthentication(toEmail: String): String {
val certifyNum = redisUtil.createdCertifyNum()
val message = mailContentBuilder.build(certifyNum)
val mailSendDTO = MailSendDTO(toEmail, "clothstar 회원가입 인증 메일 입니다.", message)

mailService.sendMail(mailSendDTO)

//메일 전송에 성공하면 redis에 key = email, value = 인증번호를 생성한다.
//지속시간은 10분
redisUtil.createRedisData(toEmail, certifyNum)

return certifyNum
}

fun verifyEmailCertifyNum(email: String, certifyNum: String): Boolean {
val certifyNumFoundByRedis = redisUtil.getData(email) ?: return false

return certifyNumFoundByRedis == certifyNum
}
}

0 comments on commit c67d7f8

Please sign in to comment.