-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat/IPLC-23] 홈 api 연결 #199
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
Merged
The head ref may contain hidden characters: "feat/IPLC-23-\uD648-API-\uC5F0\uACB0"
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ddeb19a
[ADD] new logo for home
kimjw2003 02fe654
[Feat] pre cert api viewmodel
kimjw2003 7f08e43
[Feat] 서버연결 완료. 테스트 필요
kimjw2003 6bc7948
Merge remote-tracking branch 'origin/develop' into feat/IPLC-23-홈-API-연결
kimjw2003 2f8321b
[Feat] 캘린더 api 연결
kimjw2003 64db469
[Feat] navigate 연결
kimjw2003 1d6c0ae
[Chore] ktlint
kimjw2003 471aabf
[Chore] ktlint
kimjw2003 fe9c763
[Chore] 코드 리뷰
kimjw2003 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,9 @@ | ||
| package org.sopt.certi.core.util | ||
|
|
||
| fun Int.dateString() : String { | ||
| return if (this.toString().length == 1) { | ||
| "0$this" | ||
| } else { | ||
| this.toString() | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
46 changes: 46 additions & 0 deletions
46
app/src/main/java/org/sopt/certi/data/remote/dto/response/GetPreCertDayListResponseDto.kt
This file contains hidden or 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,46 @@ | ||
| package org.sopt.certi.data.remote.dto.response | ||
|
|
||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class GetPreCertDayListResponseDto( | ||
| @SerialName("date") | ||
| val date: String, | ||
| @SerialName("certifications") | ||
| val certifications: List<PreCertDayItemResponseDto>? | ||
| ) | ||
|
|
||
| @Serializable | ||
| data class PreCertDayItemResponseDto( | ||
| @SerialName("certificationId") | ||
| val certificationId: Long, | ||
| @SerialName("certificationName") | ||
| val certificationName: String, | ||
| @SerialName("tags") | ||
| val tags: List<String>, | ||
| @SerialName("averagePeriod") | ||
| val averagePeriod: String, | ||
| @SerialName("charge") | ||
| val charge: String, | ||
| @SerialName("agencyName") | ||
| val agencyName: String, | ||
| @SerialName("testType") | ||
| val testType: String, | ||
| @SerialName("description") | ||
| val description: String, | ||
| @SerialName("applicationMethod") | ||
| val applicationMethod: String, | ||
| @SerialName("applicationUrl") | ||
| val applicationUrl: String, | ||
| @SerialName("expirationPeriod") | ||
| val expirationPeriod: String, | ||
| @SerialName("city") | ||
| val city: String, | ||
| @SerialName("state") | ||
| val state: String, | ||
| @SerialName("testDate") | ||
| val testDate: String, | ||
| @SerialName("isAcquired") | ||
| val isAcquired: Boolean, | ||
| ) |
22 changes: 22 additions & 0 deletions
22
app/src/main/java/org/sopt/certi/data/remote/dto/response/GetPreCertMonthResponseDto.kt
This file contains hidden or 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,22 @@ | ||
| package org.sopt.certi.data.remote.dto.response | ||
|
|
||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class GetPreCertMonthResponseDto( | ||
| @SerialName("year") | ||
| val year: Int, | ||
| @SerialName("month") | ||
| val month: Int, | ||
| @SerialName("days") | ||
| val days: List<PreCertMonthDayItem> | ||
| ) | ||
|
|
||
| @Serializable | ||
| data class PreCertMonthDayItem( | ||
| @SerialName("day") | ||
| val day: Int, | ||
| @SerialName("count") | ||
| val count: Int | ||
| ) |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ import org.sopt.certi.domain.model.user.UserInfoData | |
| import org.sopt.certi.domain.repository.HomeRepository | ||
| import javax.inject.Inject | ||
| import org.sopt.certi.data.remote.util.HttpResponseHandler.handleNullableApiResponse | ||
| import org.sopt.certi.domain.model.certification.PreCertDayData | ||
|
|
||
| class HomeRepositoryImpl @Inject constructor( | ||
| private val homeRemoteDataSource: HomeRemoteDataSource, | ||
|
|
@@ -58,4 +59,22 @@ class HomeRepositoryImpl @Inject constructor( | |
| Unit | ||
| } | ||
| } | ||
|
|
||
| override suspend fun getPreCertMonth(year: Int, month: Int): Result<List<Int>> { | ||
| return runCatching { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [2]: 왜 safeApiCall 안 쓰고 runCatching 쓰셨나요 |
||
| homeRemoteDataSource.getPreCertMonth(year, month) | ||
| .handleApiResponse() | ||
| .getOrThrow() | ||
| .toDomain() | ||
| } | ||
| } | ||
|
|
||
| override suspend fun getPreCertDay(date: String): Result<PreCertDayData> { | ||
| return runCatching { | ||
| homeRemoteDataSource.getPreCertDay(date) | ||
| .handleApiResponse() | ||
| .getOrThrow() | ||
| .toDomain() | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or 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: 6 additions & 0 deletions
6
app/src/main/java/org/sopt/certi/domain/model/certification/PreCertData.kt
This file contains hidden or 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,6 @@ | ||
| package org.sopt.certi.domain.model.certification | ||
|
|
||
| data class PreCertDayData( | ||
| val date: String = "", | ||
| val certifications: List<CertificationData>? = emptyList() | ||
| ) |
This file contains hidden or 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
10 changes: 10 additions & 0 deletions
10
app/src/main/java/org/sopt/certi/domain/usecase/certification/GetPreCertDayUseCase.kt
This file contains hidden or 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 org.sopt.certi.domain.usecase.certification | ||
|
|
||
| import org.sopt.certi.domain.repository.HomeRepository | ||
| import javax.inject.Inject | ||
|
|
||
| class GetPreCertDayUseCase @Inject constructor( | ||
| private val homeRepository: HomeRepository | ||
| ) { | ||
| suspend operator fun invoke(date: String) = homeRepository.getPreCertDay(date) | ||
| } |
10 changes: 10 additions & 0 deletions
10
app/src/main/java/org/sopt/certi/domain/usecase/certification/GetPreCertMonthUseCase.kt
This file contains hidden or 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 org.sopt.certi.domain.usecase.certification | ||
|
|
||
| import org.sopt.certi.domain.repository.HomeRepository | ||
| import javax.inject.Inject | ||
|
|
||
| class GetPreCertMonthUseCase @Inject constructor( | ||
| private val homeRepository: HomeRepository | ||
| ) { | ||
| suspend operator fun invoke(year: Int, month: Int) = homeRepository.getPreCertMonth(year, month) | ||
| } |
This file contains hidden or 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 hidden or 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.
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.
[1] 이거 이름 img_logo_black으로 해야 하는거 아닌가요