Skip to content

Commit

Permalink
✨ :: self study use case 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
ImGaram committed Sep 18, 2023
1 parent 033ead4 commit 1938f2d
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 0 deletions.
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)
}
}
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
)
}
}
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
)
}
}
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)
}
}
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)
}
}
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

)
}
}
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)
}
}

0 comments on commit 1938f2d

Please sign in to comment.