-
Notifications
You must be signed in to change notification settings - Fork 2
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 #519 from BCSDLab/refactor/timetable_semester
[Refactor] 시간표 학기 페이지 리팩토링 1차
- Loading branch information
Showing
12 changed files
with
260 additions
and
300 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
8 changes: 8 additions & 0 deletions
8
data/src/main/java/in/koreatech/koin/data/response/timetable/TimetableFramesResponse.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,8 @@ | ||
package `in`.koreatech.koin.data.response.timetable | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class TimetableFramesResponse( | ||
@SerializedName("semesters") | ||
val semesterFrames: Map<String, List<TimetableFrameResponse>> | ||
) |
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
domain/src/main/java/in/koreatech/koin/domain/usecase/timetable/GetAllFramesUseCase.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 `in`.koreatech.koin.domain.usecase.timetable | ||
|
||
import `in`.koreatech.koin.domain.model.timetable.response.TimetableFrame | ||
import `in`.koreatech.koin.domain.repository.TimetableRepository | ||
import kotlinx.coroutines.flow.Flow | ||
import javax.inject.Inject | ||
|
||
class GetAllFramesUseCase @Inject constructor( | ||
private val timetableRepository: TimetableRepository | ||
) { | ||
suspend operator fun invoke(): Flow<Map<String, List<TimetableFrame>>> = | ||
timetableRepository.getAllFrames() | ||
} |
39 changes: 0 additions & 39 deletions
39
...main/java/in/koreatech/koin/domain/usecase/timetable/GetSemesterTimetableFramesUseCase.kt
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
domain/src/main/java/in/koreatech/koin/domain/usecase/timetable/RollbackFrameUseCase.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 `in`.koreatech.koin.domain.usecase.timetable | ||
|
||
import `in`.koreatech.koin.domain.model.timetable.response.TimetableLectures | ||
import `in`.koreatech.koin.domain.repository.TimetableRepository | ||
import javax.inject.Inject | ||
|
||
/** | ||
* 시간표 프레임과 담긴 강의들을 복구하는 유즈케이스 | ||
* 학기가 함께 삭제된 경우, 학기도 같이 추가한다 | ||
*/ | ||
class RollbackFrameUseCase @Inject constructor( | ||
private val timetableRepository: TimetableRepository | ||
) { | ||
|
||
suspend operator fun invoke(frameId: Int): Result<TimetableLectures> { | ||
return timetableRepository.postRollbackFrame(frameId) | ||
} | ||
} |
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.