-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Refactor] 시간표 학기 API 마이그레이션 #557
Open
nodobi
wants to merge
8
commits into
develop
Choose a base branch
from
refactor/timetable_api_v3
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9289ed7
feat: add semester api v3
nodobi cbae8f2
feat: add semester model and mapper
nodobi affcbe3
refactor: migrate semester api v1 to v3
nodobi f97dbc1
fix: remove semester api v1 on repository
nodobi 6f8c201
fix: change semester responses name
nodobi d42ff03
fix: change semester responses and models name
nodobi a1cb24e
fix: remove V3 postfix on semester api
nodobi 6c263db
fix: add local.properties on lint workflow
nodobi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
6 changes: 3 additions & 3 deletions
6
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
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
17 changes: 0 additions & 17 deletions
17
data/src/main/java/in/koreatech/koin/data/response/timetable/SemesterCheckResponse.kt
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
data/src/main/java/in/koreatech/koin/data/response/timetable/SemesterResponse.kt
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
data/src/main/java/in/koreatech/koin/data/response/timetable/v3/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,29 @@ | ||
package `in`.koreatech.koin.data.response.timetable.v3 | ||
|
||
import com.google.gson.annotations.SerializedName | ||
import `in`.koreatech.koin.domain.model.timetable.Season | ||
import `in`.koreatech.koin.domain.model.timetable.Semester | ||
import timber.log.Timber | ||
|
||
data class SemesterResponse( | ||
@SerializedName("year") | ||
val year: Int, | ||
@SerializedName("term") | ||
val term: String, | ||
) | ||
|
||
internal fun SemesterResponse.toSemester(): Semester = | ||
Semester( | ||
year = this.year, | ||
season = | ||
when (this.term) { | ||
"1학기" -> Season.Spring | ||
"여름학기" -> Season.Summer | ||
"2학기" -> Season.Fall | ||
"겨울학기" -> Season.Winter | ||
else -> { | ||
Timber.e("알 수 없는 학기 응답 : $term") | ||
Season.Spring | ||
} | ||
}, | ||
) |
11 changes: 11 additions & 0 deletions
11
data/src/main/java/in/koreatech/koin/data/response/timetable/v3/UserSemestersResponse.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,11 @@ | ||
package `in`.koreatech.koin.data.response.timetable.v3 | ||
|
||
import com.google.gson.annotations.SerializedName | ||
import `in`.koreatech.koin.domain.model.timetable.Semester | ||
|
||
data class UserSemestersResponse( | ||
@SerializedName("semesters") | ||
val semesters: List<SemesterResponse>, | ||
) | ||
|
||
internal fun UserSemestersResponse.toSemesters(): List<Semester> = this.semesters.map { it.toSemester() } |
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
domain/src/main/java/in/koreatech/koin/domain/model/timetable/Season.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.domain.model.timetable | ||
|
||
enum class Season { | ||
Spring, | ||
Summer, | ||
Fall, | ||
Winter | ||
} |
14 changes: 14 additions & 0 deletions
14
domain/src/main/java/in/koreatech/koin/domain/model/timetable/Semester.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,14 @@ | ||
package `in`.koreatech.koin.domain.model.timetable | ||
|
||
data class Semester( | ||
val year: Int, | ||
val season: Season, | ||
) | ||
|
||
internal fun Semester.toLegacySemester(): String = | ||
when (this.season) { | ||
Season.Spring -> "${this.year}1" | ||
kongwoojin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Season.Summer -> "${this.year}-여름" | ||
Season.Fall -> "${this.year}2" | ||
Season.Winter -> "${this.year}-겨울" | ||
} |
6 changes: 0 additions & 6 deletions
6
domain/src/main/java/in/koreatech/koin/domain/model/timetable/response/Semester.kt
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
domain/src/main/java/in/koreatech/koin/domain/model/timetable/response/SemesterCheck.kt
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
요런 느낌으로 줄여서 사용할 수도 있을거같아용