Skip to content

Commit

Permalink
Add UserApi
Browse files Browse the repository at this point in the history
  • Loading branch information
rudeh2926 committed Jan 11, 2024
1 parent 97115f6 commit 88d14b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ import com.xquare.v1userservice.user.api.dtos.PointDomainResponse
import com.xquare.v1userservice.user.api.dtos.SignInDomainRequest
import com.xquare.v1userservice.user.api.dtos.TokenResponse
import com.xquare.v1userservice.user.api.dtos.UserDeviceTokenResponse
import java.io.File
import java.util.UUID

interface UserApi {
suspend fun registerUser(file: File)

suspend fun saveUser(creatUserDomainRequest: CreatUserDomainRequest): User
suspend fun getUserById(userId: UUID): User
suspend fun getUsersByIdsIn(userIds: List<UUID>): List<User>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import com.xquare.v1userservice.user.spi.UserRepositorySpi
import com.xquare.v1userservice.user.verificationcode.VerificationCode
import com.xquare.v1userservice.user.verificationcode.exceptions.VerificationCodeNotFoundException
import com.xquare.v1userservice.user.verificationcode.spi.VerificationCodeSpi
import java.io.File
import java.time.LocalDateTime
import java.util.UUID

Expand All @@ -56,6 +57,10 @@ class UserApiImpl(
private val passwordMatcherSpi: PasswordMatcherSpi,
private val pointSpi: PointSpi
) : UserApi {
override suspend fun registerUser(file: File) {
//userRepositorySpi.saveAll()
}

override suspend fun saveUser(creatUserDomainRequest: CreatUserDomainRequest): User {
val verificationCode: VerificationCode = verificationCodeSpi.getByCode(creatUserDomainRequest.verificationCode)
?: throw VerificationCodeNotFoundException("Verification Code Not Found")
Expand Down

0 comments on commit 88d14b4

Please sign in to comment.