-
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
Showing
7 changed files
with
111 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
domain/src/main/java/com/msg/domain/usecase/self_study/CancelSelfStudyUseCase.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,12 @@ | ||
package com.msg.domain.usecase.self_study | ||
|
||
import com.msg.domain.repository.SelfStudyRepository | ||
import javax.inject.Inject | ||
|
||
class CancelSelfStudyUseCase @Inject constructor( | ||
private val selfStudyRepository: SelfStudyRepository | ||
) { | ||
suspend operator fun invoke(role: String) = kotlin.runCatching { | ||
selfStudyRepository.cancelSelfStudy(role = role) | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
domain/src/main/java/com/msg/domain/usecase/self_study/ChangeSelfStudyLimitUseCase.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,18 @@ | ||
package com.msg.domain.usecase.self_study | ||
|
||
import com.msg.domain.repository.SelfStudyRepository | ||
import javax.inject.Inject | ||
|
||
class ChangeSelfStudyLimitUseCase @Inject constructor( | ||
private val selfStudyRepository: SelfStudyRepository | ||
) { | ||
suspend operator fun invoke( | ||
role: String, | ||
limit: Int | ||
) = kotlin.runCatching { | ||
selfStudyRepository.changeSelfStudyLimit( | ||
role = role, | ||
limit = limit | ||
) | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
domain/src/main/java/com/msg/domain/usecase/self_study/CheckSelfStudyUseCase.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,20 @@ | ||
package com.msg.domain.usecase.self_study | ||
|
||
import com.msg.domain.repository.SelfStudyRepository | ||
import javax.inject.Inject | ||
|
||
class CheckSelfStudyUseCase @Inject constructor( | ||
private val selfStudyRepository: SelfStudyRepository | ||
) { | ||
suspend operator fun invoke( | ||
role: String, | ||
memberId: Long, | ||
selfStudyCheck: Boolean | ||
) = kotlin.runCatching { | ||
selfStudyRepository.checkSelfStudy( | ||
role = role, | ||
memberId = memberId, | ||
selfStudyCheck = selfStudyCheck | ||
) | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
domain/src/main/java/com/msg/domain/usecase/self_study/GetSelfStudyInfoUseCase.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,12 @@ | ||
package com.msg.domain.usecase.self_study | ||
|
||
import com.msg.domain.repository.SelfStudyRepository | ||
import javax.inject.Inject | ||
|
||
class GetSelfStudyInfoUseCase @Inject constructor( | ||
private val selfStudyRepository: SelfStudyRepository | ||
) { | ||
suspend operator fun invoke(role: String) = kotlin.runCatching { | ||
selfStudyRepository.getSelfStudyInfo(role = role) | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
domain/src/main/java/com/msg/domain/usecase/self_study/GetSelfStudyListUseCase.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,12 @@ | ||
package com.msg.domain.usecase.self_study | ||
|
||
import com.msg.domain.repository.SelfStudyRepository | ||
import javax.inject.Inject | ||
|
||
class GetSelfStudyListUseCase @Inject constructor( | ||
private val selfStudyRepository: SelfStudyRepository | ||
) { | ||
suspend operator fun invoke(role: String) = kotlin.runCatching { | ||
selfStudyRepository.getSelfStudyList(role = role) | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
domain/src/main/java/com/msg/domain/usecase/self_study/SearchSelfStudyStudentUseCase.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,25 @@ | ||
package com.msg.domain.usecase.self_study | ||
|
||
import com.msg.domain.repository.SelfStudyRepository | ||
import javax.inject.Inject | ||
|
||
class SearchSelfStudyStudentUseCase @Inject constructor( | ||
private val selfStudyRepository: SelfStudyRepository | ||
) { | ||
suspend operator fun invoke( | ||
role: String, | ||
name: String?, | ||
gender: String?, | ||
classNum: String?, | ||
grade: Int? | ||
) = kotlin.runCatching { | ||
selfStudyRepository.searchSelfStudyStudent( | ||
role = role, | ||
name = name, | ||
gender = gender, | ||
classNum = classNum, | ||
grade = grade | ||
|
||
) | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
domain/src/main/java/com/msg/domain/usecase/self_study/SelfStudyUseCase.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,12 @@ | ||
package com.msg.domain.usecase.self_study | ||
|
||
import com.msg.domain.repository.SelfStudyRepository | ||
import javax.inject.Inject | ||
|
||
class SelfStudyUseCase @Inject constructor( | ||
private val selfStudyRepository: SelfStudyRepository | ||
) { | ||
suspend operator fun invoke(role: String) = kotlin.runCatching { | ||
selfStudyRepository.selfStudy(role = role) | ||
} | ||
} |