Skip to content

Commit 8deb784

Browse files
committed
hotfix: domain,infra - 회원탈퇴 후 회원가입 제대로 안되는 문제 해결
1 parent 4865b60 commit 8deb784

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

domain/src/main/kotlin/org/yapp/domain/user/UserDomainService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class UserDomainService(
6969
}
7070

7171
fun restoreDeletedUser(userId: UUID): UserAuthVO {
72-
val deletedUser = userRepository.findById(userId)
72+
val deletedUser = userRepository.findByIdIncludingDeleted(userId)
7373
?: throw UserNotFoundException(UserErrorCode.USER_NOT_FOUND)
7474

7575
val restoredUser = userRepository.save(deletedUser.restore())

domain/src/main/kotlin/org/yapp/domain/user/UserRepository.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ interface UserRepository {
66

77
fun findById(id: UUID): User?
88

9+
fun findByIdIncludingDeleted(id: UUID): User?
10+
911
fun findByProviderTypeAndProviderId(providerType: ProviderType, providerId: String): User?
1012

1113
fun findByProviderTypeAndProviderIdIncludingDeleted(providerType: ProviderType, providerId: String): User?

infra/src/main/kotlin/org/yapp/infra/user/repository/JpaUserRepository.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,10 @@ interface JpaUserRepository : JpaRepository<UserEntity, UUID> {
2424
@Param("providerType") providerType: ProviderType,
2525
@Param("providerId") providerId: String
2626
): UserEntity?
27+
28+
@Query(
29+
value = "SELECT u.* FROM users u WHERE u.id = :id",
30+
nativeQuery = true
31+
)
32+
fun findByIdIncludingDeleted(@Param("id") id: UUID): UserEntity?
2733
}

infra/src/main/kotlin/org/yapp/infra/user/repository/impl/UserRepositoryImpl.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ class UserRepositoryImpl(
2727
return jpaUserRepository.findByIdOrNull(id)?.toDomain()
2828
}
2929

30+
override fun findByIdIncludingDeleted(id: UUID): User? {
31+
return jpaUserRepository.findByIdIncludingDeleted(id)?.toDomain()
32+
}
33+
3034
override fun existsById(id: UUID): Boolean {
3135
return jpaUserRepository.existsById(id)
3236
}

0 commit comments

Comments
 (0)