Skip to content

Commit

Permalink
chore/#8: domain SignUpResponse 이름 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
kangyein9892 committed Nov 15, 2024
1 parent ad8364e commit 1f87147
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import org.sopt.and.data.di.UserSharedPreference
import org.sopt.and.data.dto.request.SignUpRequestDto
import org.sopt.and.data.service.UserService
import org.sopt.and.domain.exception.Result
import org.sopt.and.domain.model.SignUpRequest
import org.sopt.and.domain.model.SignUpResponse

internal class UserDataSource @Inject constructor(
@UserSharedPreference private val userSharedPreference: SharedPreferences,
Expand All @@ -28,7 +28,7 @@ internal class UserDataSource @Inject constructor(
userSharedPreference.edit().clear().apply()
}

suspend fun signUp(request: SignUpRequestDto): Result<SignUpRequest> = execute {
suspend fun signUp(request: SignUpRequestDto): Result<SignUpResponse> = execute {
userService.signUp(request).result.toDomainModel()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ package org.sopt.and.data.dto.response

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import org.sopt.and.domain.model.SignUpRequest
import org.sopt.and.domain.model.SignUpResponse

@Serializable
internal data class SignUpResponseDto(
@SerialName("no")
val userNumber: Int
){
fun toDomainModel(): SignUpRequest {
return SignUpRequest(
fun toDomainModel(): SignUpResponse {
return SignUpResponse(
userNumber = userNumber
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package org.sopt.and.data.repository
import jakarta.inject.Inject
import org.sopt.and.data.datasource.UserDataSource
import org.sopt.and.data.dto.request.toRequestBody
import org.sopt.and.domain.model.SignUpRequest
import org.sopt.and.domain.model.SignUpResponse
import org.sopt.and.domain.model.User
import org.sopt.and.domain.repository.UserRepository
import org.sopt.and.domain.exception.Result
Expand All @@ -24,7 +24,7 @@ internal class UserRepositoryImpl @Inject constructor(
return userDataSource.id
}

override suspend fun signUp(user: User): Result<SignUpRequest> {
override suspend fun signUp(user: User): Result<SignUpResponse> {
return userDataSource.signUp(user.toRequestBody())
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package org.sopt.and.domain.model

data class SignUpRequest(
data class SignUpResponse(
val userNumber: Int
)
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.sopt.and.domain.repository

import org.sopt.and.domain.model.SignUpRequest
import org.sopt.and.domain.model.SignUpResponse
import org.sopt.and.domain.model.User
import org.sopt.and.domain.exception.Result

interface UserRepository {
fun saveUser(id: String, password: String)
fun clearIdPassword()
fun getId(): String
suspend fun signUp(user: User): Result<SignUpRequest>
suspend fun signUp(user: User): Result<SignUpResponse>
}

0 comments on commit 1f87147

Please sign in to comment.