-
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 #430 from BCSDLab/feature/timetable-setting
[Feature] 시간표 모듈 구현 및 패키지 구조화
- Loading branch information
Showing
42 changed files
with
790 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
data/src/main/java/in/koreatech/koin/data/api/TimetableApi.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,16 @@ | ||
package `in`.koreatech.koin.data.api | ||
|
||
import `in`.koreatech.koin.data.response.timetable.LectureResponse | ||
import `in`.koreatech.koin.data.response.timetable.SemesterResponse | ||
import retrofit2.http.GET | ||
import retrofit2.http.Query | ||
|
||
interface TimetableApi { | ||
@GET("/semesters") | ||
suspend fun getSemesters(): List<SemesterResponse> | ||
|
||
@GET("/lectures") | ||
suspend fun getLectures( | ||
@Query("semester_date") semesterDate: String | ||
): List<LectureResponse> | ||
} |
56 changes: 56 additions & 0 deletions
56
data/src/main/java/in/koreatech/koin/data/api/auth/TimetableAuthApi.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,56 @@ | ||
package `in`.koreatech.koin.data.api.auth | ||
|
||
import `in`.koreatech.koin.data.request.timetable.TimetableFrameCreateQueryRequest | ||
import `in`.koreatech.koin.data.request.timetable.TimetableFrameQueryRequest | ||
import `in`.koreatech.koin.data.request.timetable.TimetableLecturesQueryRequest | ||
import `in`.koreatech.koin.data.response.timetable.TimetableFrameResponse | ||
import `in`.koreatech.koin.data.response.timetable.TimetableLecturesResponse | ||
import retrofit2.http.Body | ||
import retrofit2.http.DELETE | ||
import retrofit2.http.GET | ||
import retrofit2.http.POST | ||
import retrofit2.http.PUT | ||
import retrofit2.http.Path | ||
import retrofit2.http.Query | ||
|
||
interface TimetableAuthApi { | ||
@GET("/v2/timetables/lecture") | ||
suspend fun getTimetableLectures(): TimetableLecturesResponse | ||
|
||
@PUT("/v2/timetables/lecture") | ||
suspend fun putTimetableLectures( | ||
@Body lectures: TimetableLecturesQueryRequest | ||
): TimetableLecturesResponse | ||
|
||
@POST("/v2/timetables/lecture") | ||
suspend fun postTimetableLectures( | ||
@Body lectures: TimetableLecturesQueryRequest | ||
): TimetableLecturesResponse | ||
|
||
@PUT("/v2/timetables/frame/{id}") | ||
suspend fun putTimetableFrame( | ||
@Path("id") id: Int, | ||
@Body frame: TimetableFrameQueryRequest | ||
): TimetableFrameResponse | ||
|
||
@POST("/v2/timetables/frame") | ||
suspend fun postTimetableFrame( | ||
@Body frame: TimetableFrameCreateQueryRequest | ||
): TimetableFrameResponse | ||
|
||
@DELETE("/v2/timetables/frame") | ||
suspend fun deleteTimetableFrame() | ||
|
||
@GET("/v2/timetables/frame") | ||
suspend fun getTimetableFrames( | ||
@Query("semester") semester: String | ||
): List<TimetableFrameResponse> | ||
|
||
@DELETE("/v2/timetables/lecture/{id}") | ||
suspend fun deleteTimetableLecture( | ||
@Path("id") id: Int | ||
) | ||
|
||
@DELETE("/v2/all/timetables/frame") | ||
suspend fun deleteAllTimetableFrame() | ||
} |
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
60 changes: 60 additions & 0 deletions
60
data/src/main/java/in/koreatech/koin/data/repository/TimetableRepositoryImpl.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,60 @@ | ||
package `in`.koreatech.koin.data.repository | ||
|
||
import `in`.koreatech.koin.data.source.remote.TimetableRemoteDataSource | ||
import `in`.koreatech.koin.domain.model.timetable.request.TimetableFrameCreateQuery | ||
import `in`.koreatech.koin.domain.model.timetable.request.TimetableFrameQuery | ||
import `in`.koreatech.koin.domain.model.timetable.request.TimetableLecturesQuery | ||
import `in`.koreatech.koin.domain.model.timetable.response.Lecture | ||
import `in`.koreatech.koin.domain.model.timetable.response.Semester | ||
import `in`.koreatech.koin.domain.model.timetable.response.TimetableFrame | ||
import `in`.koreatech.koin.domain.model.timetable.response.TimetableLectures | ||
import `in`.koreatech.koin.domain.repository.TimetableRepository | ||
import javax.inject.Inject | ||
|
||
class TimetableRepositoryImpl @Inject constructor( | ||
private val timetableRemoteDataSource: TimetableRemoteDataSource | ||
): TimetableRepository { | ||
override suspend fun getSemesters(): List<Semester> { | ||
TODO("Not yet implemented") | ||
} | ||
|
||
override suspend fun getLectures(semesterDate: String): List<Lecture> { | ||
TODO("Not yet implemented") | ||
} | ||
|
||
override suspend fun getTimetableLectures(): TimetableLectures { | ||
TODO("Not yet implemented") | ||
} | ||
|
||
override suspend fun putTimetableLectures(lectures: TimetableLecturesQuery): TimetableLectures { | ||
TODO("Not yet implemented") | ||
} | ||
|
||
override suspend fun postTimetableLectures(lectures: TimetableLecturesQuery): TimetableLectures { | ||
TODO("Not yet implemented") | ||
} | ||
|
||
override suspend fun putTimetableFrame(id: Int, frame: TimetableFrameQuery): TimetableFrame { | ||
TODO("Not yet implemented") | ||
} | ||
|
||
override suspend fun postTimetableFrame(frame: TimetableFrameCreateQuery): TimetableFrame { | ||
TODO("Not yet implemented") | ||
} | ||
|
||
override suspend fun deleteTimetableFrame() { | ||
TODO("Not yet implemented") | ||
} | ||
|
||
override suspend fun getTimetableFrames(semester: String): List<TimetableFrame> { | ||
TODO("Not yet implemented") | ||
} | ||
|
||
override suspend fun deleteTimetableLecture(id: Int) { | ||
TODO("Not yet implemented") | ||
} | ||
|
||
override suspend fun deleteAllTimetableFrame() { | ||
TODO("Not yet implemented") | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
data/src/main/java/in/koreatech/koin/data/request/timetable/TimetableFrameQueryRequest.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,17 @@ | ||
package `in`.koreatech.koin.data.request.timetable | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class TimetableFrameQueryRequest( | ||
@SerializedName("timetable_name") | ||
val timetableName: String, | ||
@SerializedName("is_main") | ||
val isMain: Boolean, | ||
) | ||
|
||
data class TimetableFrameCreateQueryRequest( | ||
@SerializedName("semester") | ||
val semester: String, | ||
@SerializedName("timetable_name") | ||
val timetableName: Boolean, | ||
) |
29 changes: 29 additions & 0 deletions
29
data/src/main/java/in/koreatech/koin/data/request/timetable/TimetableLecturesQueryRequest.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,29 @@ | ||
package `in`.koreatech.koin.data.request.timetable | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class TimetableLecturesQueryRequest( | ||
@SerializedName("timetable_frame_id") | ||
val timetableFrameId: Int, | ||
@SerializedName("timetable_lecture") | ||
val timetableLecture: List<TimetableLectureQueryRequest>, | ||
) | ||
|
||
data class TimetableLectureQueryRequest( | ||
@SerializedName("id") | ||
val id: Int, | ||
@SerializedName("lecture_id") | ||
val lectureId: Int, | ||
@SerializedName("class_title") | ||
val classTitle: String, | ||
@SerializedName("class_time") | ||
val classTime: List<Int>, | ||
@SerializedName("class_place") | ||
val classPlace: String, | ||
@SerializedName("professor") | ||
val professor: String, | ||
@SerializedName("grades") | ||
val grades: String, | ||
@SerializedName("memo") | ||
val memo: String, | ||
) |
27 changes: 27 additions & 0 deletions
27
...main/java/in/koreatech/koin/data/request/timetable/TimetableLecturesUpdateQueryRequest.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 `in`.koreatech.koin.data.request.timetable | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class TimetableLecturesUpdateQueryRequest( | ||
@SerializedName("timetable_frame_id") | ||
val timetableFrameId: Int, | ||
@SerializedName("timetable_lecture") | ||
val timetableLecture: List<TimetableLectureUpdateQueryRequest>, | ||
) | ||
|
||
data class TimetableLectureUpdateQueryRequest( | ||
@SerializedName("lecture_id") | ||
val lectureId: Int, | ||
@SerializedName("class_title") | ||
val classTitle: String, | ||
@SerializedName("class_time") | ||
val classTime: List<Int>, | ||
@SerializedName("class_place") | ||
val classPlace: String?, | ||
@SerializedName("professor") | ||
val professor: String, | ||
@SerializedName("grades") | ||
val grades: String, | ||
@SerializedName("memo") | ||
val memo: String, | ||
) |
32 changes: 32 additions & 0 deletions
32
data/src/main/java/in/koreatech/koin/data/response/timetable/LectureResponse.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,32 @@ | ||
package `in`.koreatech.koin.data.response.timetable | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class LectureResponse( | ||
@SerializedName("id") | ||
val id: Int, | ||
@SerializedName("code") // "HRD011" | ||
val code: String?, | ||
@SerializedName("name") // "직업능력개발훈련평가" | ||
val name: String?, | ||
@SerializedName("grades") // "2" | ||
val grades: String?, | ||
@SerializedName("lecture_class") // "01" | ||
val lectureClass: String?, | ||
@SerializedName("regular_number") // "40" | ||
val regularNumber: String?, | ||
@SerializedName("department") // "HRD학과" | ||
val department: String?, | ||
@SerializedName("target") // "기공3" | ||
val target: String?, | ||
@SerializedName("professor") // "홍길동" | ||
val professor: String?, | ||
@SerializedName("is_english") // "0" : fasle / "1" : true | ||
val isEnglish: String?, | ||
@SerializedName("design_score") // "0" | ||
val designScore: String?, | ||
@SerializedName("is_elearning") // | ||
val isElearning: String?, | ||
@SerializedName("class_time") | ||
val classTime: List<Int>, | ||
) |
10 changes: 10 additions & 0 deletions
10
data/src/main/java/in/koreatech/koin/data/response/timetable/SemesterResponse.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 `in`.koreatech.koin.data.response.timetable | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class SemesterResponse( | ||
@SerializedName("id") | ||
val id :Int, | ||
@SerializedName("semester") | ||
val semester: String? | ||
) |
12 changes: 12 additions & 0 deletions
12
data/src/main/java/in/koreatech/koin/data/response/timetable/TimetableFrameResponse.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 `in`.koreatech.koin.data.response.timetable | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class TimetableFrameResponse( | ||
@SerializedName("id") | ||
val id: Int, | ||
@SerializedName("timetable_name") | ||
val timetableName: String?, | ||
@SerializedName("is_main") | ||
val isMain: Boolean, | ||
) |
34 changes: 34 additions & 0 deletions
34
data/src/main/java/in/koreatech/koin/data/response/timetable/TimetableLectureResponse.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,34 @@ | ||
package `in`.koreatech.koin.data.response.timetable | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class TimetableLectureResponse( | ||
@SerializedName("id") | ||
val id: Int, | ||
@SerializedName("lecture_id") | ||
val lectureId: Int, | ||
@SerializedName("regular_number") // "38" | ||
val regularNumber: String?, | ||
@SerializedName("code") // "ARB244" | ||
val code: String?, | ||
@SerializedName("design_score") // "0" | ||
val designScore: String?, | ||
@SerializedName("class_time") | ||
val classTime: List<Int>, | ||
@SerializedName("class_place") // "2공학관" | ||
val classPlace: String?, | ||
@SerializedName("memo") | ||
val memo: String?, | ||
@SerializedName("grades") // "3" | ||
val grades: String?, | ||
@SerializedName("class_title") // "한국사" | ||
val classTitle: String?, | ||
@SerializedName("lecture_class") // "01" | ||
val lectureClass: String?, | ||
@SerializedName("target") // "디자 1 건축" | ||
val target: String?, | ||
@SerializedName("professor") // "이돈우" | ||
val professor: String?, | ||
@SerializedName("department") // "디자인ㆍ건축공학부" | ||
val department: String?, | ||
) |
15 changes: 15 additions & 0 deletions
15
data/src/main/java/in/koreatech/koin/data/response/timetable/TimetableLecturesResponse.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,15 @@ | ||
package `in`.koreatech.koin.data.response.timetable | ||
|
||
import com.google.gson.annotations.SerializedName | ||
|
||
data class TimetableLecturesResponse( | ||
@SerializedName("timetable_frame_id") | ||
val timetableFrameId: Int, | ||
@SerializedName("timetable") | ||
val timetable: List<TimetableLectureResponse>, | ||
@SerializedName("grades") | ||
val grades: Int?, | ||
@SerializedName("total_grades") | ||
val totalGrades: Int?, | ||
) | ||
|
Oops, something went wrong.