-
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
a190b5c
commit 15534bc
Showing
3 changed files
with
23 additions
and
6 deletions.
There are no files selected for viewing
14 changes: 9 additions & 5 deletions
14
core/domain/src/commonMain/kotlin/club/nito/core/domain/SignInUseCase.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,19 +1,23 @@ | ||
package club.nito.core.domain | ||
|
||
import club.nito.core.data.AuthRepository | ||
import club.nito.core.model.ExecuteResult | ||
import club.nito.core.model.runExecuting | ||
|
||
/** | ||
* 直近のスケジュールを取得するユースケース | ||
*/ | ||
sealed interface SignInUseCase { | ||
suspend operator fun invoke(email: String, password: String) | ||
suspend operator fun invoke(email: String, password: String): ExecuteResult<Unit> | ||
} | ||
|
||
class SignInExecutor( | ||
private val authRepository: AuthRepository, | ||
) : SignInUseCase { | ||
override suspend fun invoke(email: String, password: String) = authRepository.signIn( | ||
email = email, | ||
password = password, | ||
) | ||
override suspend fun invoke(email: String, password: String): ExecuteResult<Unit> = runExecuting { | ||
authRepository.signIn( | ||
email = email, | ||
password = password, | ||
) | ||
} | ||
} |
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