-
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.
Merge pull request #62 from Team-Ampersand/feature/61_self_study_domain
🔀 :: (#61) self study domain
- Loading branch information
Showing
13 changed files
with
229 additions
and
1 deletion.
There are no files selected for viewing
10 changes: 9 additions & 1 deletion
10
data/src/main/java/com/msg/data/remote/dto/self_study/SelfStudyInfoResponse.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,7 +1,15 @@ | ||
package com.msg.data.remote.dto.self_study | ||
|
||
import com.msg.domain.model.self_study.SelfStudyInfoResponseModel | ||
|
||
data class SelfStudyInfoResponse( | ||
val count: Int, | ||
val limit: Int, | ||
val selfStudyStatus: String, | ||
val selfStudyStatus: String | ||
) | ||
|
||
fun SelfStudyInfoResponse.asSelfStudyInfoResponseModel() = SelfStudyInfoResponseModel( | ||
count = count, | ||
limit = limit, | ||
selfStudyStatus = selfStudyStatus | ||
) |
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: 7 additions & 0 deletions
7
domain/src/main/java/com/msg/domain/model/self_study/SelfStudyInfoResponseModel.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,7 @@ | ||
package com.msg.domain.model.self_study | ||
|
||
data class SelfStudyInfoResponseModel( | ||
val count: Int, | ||
val limit: Int, | ||
val selfStudyStatus: String | ||
) |
10 changes: 10 additions & 0 deletions
10
domain/src/main/java/com/msg/domain/model/self_study/SelfStudyListResponseModel.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,10 @@ | ||
package com.msg.domain.model.self_study | ||
|
||
data class SelfStudyListResponseModel( | ||
val rank: Int, | ||
val id: Int, | ||
val stuNum: String, | ||
val memberName: String, | ||
val gender: String, | ||
val selfStudyCheck: Boolean | ||
) |
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: 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) | ||
} | ||
} |