Skip to content

Commit

Permalink
♻️ :: method로 분리
Browse files Browse the repository at this point in the history
  • Loading branch information
jyk1029 committed Sep 28, 2023
1 parent 22e61c3 commit 2d9c0b4
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,7 @@ class UserApiImpl(
}

override suspend fun updateProfileFileName(userId: UUID, profileFileName: String?) {
val user = userRepositorySpi.findByIdAndStateWithCreated(userId)
?: throw UserNotFoundException(UserNotFoundException.USER_ID_NOT_FOUND)
val user = getUserById(userId)
val updatedUser = user.updateProfileFileName(profileFileName)
userRepositorySpi.applyChanges(updatedUser)
}
Expand Down Expand Up @@ -188,8 +187,7 @@ class UserApiImpl(

refreshTokenSpi.delete(refreshTokenEntity)

val user = userRepositorySpi.findByIdAndStateWithCreated(refreshTokenEntity.userId)
?: throw UserNotFoundException(UserNotFoundException.USER_ID_NOT_FOUND)
val user = getUserById(refreshTokenEntity.userId)
refreshTokenSpi.delete(refreshTokenEntity)

val params = buildAccessTokenParams(user)
Expand Down Expand Up @@ -220,9 +218,7 @@ class UserApiImpl(
}

override suspend fun setEmptyDeviceToken(userId: UUID) {
val user = userRepositorySpi.findByIdAndStateWithCreated(userId)
?: throw UserNotFoundException(UserNotFoundException.USER_ID_NOT_FOUND)

val user = getUserById(userId)
user.setDeviceToken("")
}

Expand All @@ -238,8 +234,7 @@ class UserApiImpl(
}

override suspend fun getUserPointInformation(userId: UUID): PointDomainResponse {
val user = userRepositorySpi.findByIdAndStateWithCreated(userId)
?: throw UserNotFoundException(UserNotFoundException.USER_ID_NOT_FOUND)
val user = getUserById(userId)

val userPoint = pointSpi.getUserPoint(userId)

Expand Down

0 comments on commit 2d9c0b4

Please sign in to comment.