-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cd49eb3
commit 56d674f
Showing
20 changed files
with
228 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
core/domain/src/main/java/com/withpeace/withpeace/core/domain/model/SignUpInfo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.withpeace.withpeace.core.domain.model | ||
|
||
data class SignUpInfo( | ||
val nickname: String, | ||
val profileImage: String?, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 8 additions & 7 deletions
15
core/domain/src/main/java/com/withpeace/withpeace/core/domain/usecase/SignUpUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
package com.withpeace.withpeace.core.domain.usecase | ||
|
||
import com.withpeace.withpeace.core.domain.model.SignUpInfo | ||
import com.withpeace.withpeace.core.domain.model.WithPeaceError | ||
import com.withpeace.withpeace.core.domain.repository.TokenRepository | ||
import com.withpeace.withpeace.core.domain.repository.UserRepository | ||
import javax.inject.Inject | ||
|
||
class SignUpUseCase @Inject constructor( | ||
private val tokenRepository: TokenRepository, | ||
private val userRepository: UserRepository, | ||
) { | ||
suspend operator fun invoke( | ||
email: String, | ||
nickname: String, | ||
onError: (String) -> Unit, | ||
) = tokenRepository.signUp( | ||
email = email, | ||
nickname = nickname, | ||
signUpInfo: SignUpInfo, | ||
onError: suspend (WithPeaceError) -> Unit, | ||
) = userRepository.signUp( | ||
signUpInfo, | ||
onError = onError, | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
core/network/src/main/java/com/withpeace/withpeace/core/network/di/request/SignUpRequest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,3 @@ | ||
package com.withpeace.withpeace.core.network.di.request | ||
|
||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class SignUpRequest( | ||
val email: String, | ||
val nickname: String, | ||
val deviceToken: String?, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.