Compare commits
No commits in common. "2d17eac19951fef38f6c907105a4f31e1a51c42a" and "e482bc3aad18eed38a83acbd9e673e7b0235e899" have entirely different histories.
2d17eac199
...
e482bc3aad
|
@ -11,7 +11,6 @@ import org.springframework.beans.factory.annotation.Value
|
||||||
import org.springframework.data.repository.findByIdOrNull
|
import org.springframework.data.repository.findByIdOrNull
|
||||||
import org.springframework.stereotype.Service
|
import org.springframework.stereotype.Service
|
||||||
import org.springframework.transaction.annotation.Transactional
|
import org.springframework.transaction.annotation.Transactional
|
||||||
import java.time.LocalDate
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
class AuthService(
|
class AuthService(
|
||||||
|
@ -83,9 +82,6 @@ class AuthService(
|
||||||
}
|
}
|
||||||
|
|
||||||
val member = memberRepository.findByIdOrNull(memberId) ?: throw SodaException("로그인 정보를 확인해주세요.")
|
val member = memberRepository.findByIdOrNull(memberId) ?: throw SodaException("로그인 정보를 확인해주세요.")
|
||||||
val nowYear = LocalDate.now().year
|
|
||||||
val certificateYear = certificate.birth.substring(0, 4).toInt()
|
|
||||||
if (nowYear - certificateYear >= 19) {
|
|
||||||
val auth = Auth(
|
val auth = Auth(
|
||||||
name = certificate.name,
|
name = certificate.name,
|
||||||
birth = certificate.birth,
|
birth = certificate.birth,
|
||||||
|
@ -96,8 +92,5 @@ class AuthService(
|
||||||
auth.member = member
|
auth.member = member
|
||||||
|
|
||||||
repository.save(auth)
|
repository.save(auth)
|
||||||
} else {
|
|
||||||
throw SodaException("19세 미만 인증 오류")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue