-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#219 SignDataSource 에서 로그인, 회원가입 기능을 클래스로 분리
- Loading branch information
Showing
17 changed files
with
139 additions
and
217 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
7 changes: 0 additions & 7 deletions
7
...k/src/main/java/com/android/mediproject/core/network/datasource/sign/AWSAccountManager.kt
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
...ork/src/main/java/com/android/mediproject/core/network/datasource/sign/LoginDataSource.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,19 @@ | ||
package com.android.mediproject.core.network.datasource.sign | ||
|
||
import com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoDevice | ||
import com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserSession | ||
|
||
interface LoginDataSource { | ||
suspend fun login(request: LoginRequest): Result<LoginResponse> | ||
suspend fun logout() | ||
} | ||
|
||
class LoginRequest( | ||
val email: String, | ||
val password: ByteArray, | ||
) | ||
|
||
class LoginResponse( | ||
val userSession: CognitoUserSession, | ||
val newDevice: CognitoDevice?, | ||
) |
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
11 changes: 0 additions & 11 deletions
11
...work/src/main/java/com/android/mediproject/core/network/datasource/sign/SignDataSource.kt
This file was deleted.
Oops, something went wrong.
37 changes: 0 additions & 37 deletions
37
.../src/main/java/com/android/mediproject/core/network/datasource/sign/SignDataSourceImpl.kt
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
...rk/src/main/java/com/android/mediproject/core/network/datasource/sign/SignupDataSource.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,30 @@ | ||
package com.android.mediproject.core.network.datasource.sign | ||
|
||
import com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUser | ||
import com.amazonaws.mobileconnectors.cognitoidentityprovider.CognitoUserAttributes | ||
import com.amazonaws.services.cognitoidentityprovider.model.SignUpResult | ||
|
||
interface SignupDataSource { | ||
suspend fun signUp(signUpParameter: SignUpRequest): Result<SignUpResponse> | ||
suspend fun confirmEmail(email: String, code: String): Result<Unit> | ||
suspend fun resendConfirmationCode(cognitoUser: CognitoUser): Result<ConfirmationCodeDeliveryDetails> | ||
} | ||
|
||
class SignUpRequest( | ||
val email: String, | ||
private val password: ByteArray, | ||
val cognitoUserAttributes: CognitoUserAttributes, | ||
) { | ||
val passwordString: String get() = password.decodeToString() | ||
} | ||
|
||
data class SignUpResponse( | ||
val cognitoUser: CognitoUser, | ||
val signUpResult: SignUpResult, | ||
) | ||
|
||
data class ConfirmationCodeDeliveryDetails( | ||
val destination: String, | ||
val deliveryMedium: String, | ||
val attributeName: 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
28 changes: 0 additions & 28 deletions
28
...work/src/main/java/com/android/mediproject/core/network/datasource/sign/VerifyEmailAWS.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.