-
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 #47 from team-haribo/feature/46-write-the-logic-st…
…udent-management 🔀 :: (#46) - write the logic student management
- Loading branch information
Showing
24 changed files
with
719 additions
and
116 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
core/data/src/main/java/com/goms/data/repository/council/CouncilRepository.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
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
13 changes: 13 additions & 0 deletions
13
core/domain/src/main/java/com/goms/domain/council/ChangeAuthorityUseCase.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,13 @@ | ||
package com.goms.domain.council | ||
|
||
import com.goms.data.repository.council.CouncilRepository | ||
import com.goms.model.request.council.AuthorityRequest | ||
import javax.inject.Inject | ||
|
||
class ChangeAuthorityUseCase @Inject constructor( | ||
private val councilRepository: CouncilRepository | ||
) { | ||
suspend operator fun invoke(body: AuthorityRequest) = kotlin.runCatching { | ||
councilRepository.changeAuthority(body = body) | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
core/domain/src/main/java/com/goms/domain/council/DeleteBlackListUseCase.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,13 @@ | ||
package com.goms.domain.council | ||
|
||
import com.goms.data.repository.council.CouncilRepository | ||
import java.util.UUID | ||
import javax.inject.Inject | ||
|
||
class DeleteBlackListUseCase @Inject constructor( | ||
private val councilRepository: CouncilRepository | ||
) { | ||
suspend operator fun invoke(accountIdx: UUID) = kotlin.runCatching { | ||
councilRepository.deleteBlackList(accountIdx = accountIdx) | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
core/domain/src/main/java/com/goms/domain/council/GetStudentListUseCase.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,13 @@ | ||
package com.goms.domain.council | ||
|
||
import com.goms.data.repository.council.CouncilRepository | ||
import com.goms.model.response.council.StudentResponse | ||
import kotlinx.coroutines.flow.Flow | ||
import javax.inject.Inject | ||
|
||
class GetStudentListUseCase @Inject constructor( | ||
private val councilRepository: CouncilRepository | ||
) { | ||
suspend operator fun invoke(): Flow<List<StudentResponse>> = | ||
councilRepository.getStudentList() | ||
} |
13 changes: 13 additions & 0 deletions
13
core/domain/src/main/java/com/goms/domain/council/SetBlackListUseCase.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,13 @@ | ||
package com.goms.domain.council | ||
|
||
import com.goms.data.repository.council.CouncilRepository | ||
import java.util.UUID | ||
import javax.inject.Inject | ||
|
||
class SetBlackListUseCase @Inject constructor( | ||
private val councilRepository: CouncilRepository | ||
) { | ||
suspend operator fun invoke(accountIdx: UUID) = kotlin.runCatching { | ||
councilRepository.setBlackList(accountIdx = accountIdx) | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
core/domain/src/main/java/com/goms/domain/council/StudentSearchUseCase.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,27 @@ | ||
package com.goms.domain.council | ||
|
||
import com.goms.data.repository.council.CouncilRepository | ||
import com.goms.model.response.council.StudentResponse | ||
import kotlinx.coroutines.flow.Flow | ||
import javax.inject.Inject | ||
|
||
class StudentSearchUseCase @Inject constructor( | ||
private val councilRepository: CouncilRepository | ||
) { | ||
suspend operator fun invoke( | ||
grade: Int?, | ||
gender: String?, | ||
major: String?, | ||
name: String?, | ||
isBlackList: Boolean?, | ||
authority: String? | ||
): Flow<List<StudentResponse>> = | ||
councilRepository.studentSearch( | ||
grade = grade, | ||
gender = gender, | ||
major = major, | ||
name = name, | ||
isBlackList = isBlackList, | ||
authority = authority | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
package com.goms.model.enum | ||
|
||
enum class Grade(val value: String, val enum: Int) { | ||
FIRST_GRADE("1학년", 1), | ||
SECOND_GRADE("2학년", 2), | ||
THIRD_GRADE("3학년", 3) | ||
FIRST_GRADE("1학년", 8), | ||
SECOND_GRADE("2학년", 7), | ||
THIRD_GRADE("3학년", 6) | ||
} |
10 changes: 10 additions & 0 deletions
10
core/model/src/main/java/com/goms/model/request/council/AuthorityRequest.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.goms.model.request.council | ||
|
||
import com.squareup.moshi.Json | ||
import com.squareup.moshi.JsonClass | ||
|
||
@JsonClass(generateAdapter = true) | ||
data class AuthorityRequest( | ||
@Json(name = "accountIdx") val accountIdx: String, | ||
@Json(name = "authority") val authority: String | ||
) |
19 changes: 19 additions & 0 deletions
19
core/model/src/main/java/com/goms/model/response/council/StudentResponse.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,19 @@ | ||
package com.goms.model.response.council | ||
|
||
import com.goms.model.enum.Authority | ||
import com.goms.model.enum.Gender | ||
import com.goms.model.enum.Major | ||
import com.squareup.moshi.Json | ||
import com.squareup.moshi.JsonClass | ||
|
||
@JsonClass(generateAdapter = true) | ||
data class StudentResponse( | ||
@Json(name = "accountIdx") val accountIdx: String, | ||
@Json(name = "name") val name: String, | ||
@Json(name = "grade") val grade: Int, | ||
@Json(name = "gender") val gender: Gender, | ||
@Json(name = "major") val major: Major, | ||
@Json(name = "profileUrl") val profileUrl: String?, | ||
@Json(name = "authority") val authority: Authority, | ||
@Json(name = "isBlackList") val isBlackList: Boolean | ||
) |
33 changes: 33 additions & 0 deletions
33
core/network/src/main/java/com/goms/network/api/CouncilAPI.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
19 changes: 19 additions & 0 deletions
19
core/network/src/main/java/com/goms/network/datasource/council/CouncilDataSource.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
Oops, something went wrong.