-
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.
- RemoteConfig에 존재하는 공통의 출석코드가 아닌 각 세션에 존재하는 Code를 Input과 비교하여 출석하도록 수정
- Loading branch information
1 parent
7ee1f37
commit 9f5c282
Showing
6 changed files
with
18 additions
and
11 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
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
12 changes: 7 additions & 5 deletions
12
domain/src/main/java/com/yapp/domain/usecases/CheckSessionPasswordUseCase.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,14 +1,16 @@ | ||
package com.yapp.domain.usecases | ||
|
||
import com.yapp.domain.repository.RemoteConfigRepository | ||
import com.yapp.domain.repository.SessionRepository | ||
import javax.inject.Inject | ||
|
||
class CheckSessionPasswordUseCase @Inject constructor( | ||
private val remoteConfigRepository: RemoteConfigRepository, | ||
private val sessionRepository: SessionRepository | ||
) { | ||
suspend operator fun invoke(inputPassword: String): Result<Boolean> { | ||
return remoteConfigRepository.getSessionPassword().mapCatching { sessionPassword: String -> | ||
inputPassword == sessionPassword | ||
suspend operator fun invoke(sessionId: Int, inputPassword: String): Result<Boolean> { | ||
return sessionRepository.getSession(id = sessionId).mapCatching { session -> | ||
check(session != null) { "${sessionId}에 해당하는 Session이 존재하지 않습니다" } | ||
|
||
inputPassword == session.code | ||
} | ||
} | ||
} |
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