-
Notifications
You must be signed in to change notification settings - Fork 1
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
[FEAT/#77] 홈 뷰 / 맞춤 공고 서버 통신 구현 #86
Conversation
…mmend-intern # Conflicts: # feature/src/main/java/com/terning/feature/home/home/HomeViewModel.kt
…mmend-intern # Conflicts: # feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt # feature/src/main/java/com/terning/feature/home/home/HomeViewModel.kt
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.
같이 서버통신 로직 토론해준 효빈언니 최고!!! 덕분에 이번 서버통신 매우 easy 할 듯 싶네용 ㅎㅎ
로직 수정되면 알려주세요!!!
|
||
interface InternDataSource { | ||
suspend fun getRecommendIntern(sortBy: String): BaseResponse<RecommendInternResponseDto> |
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.
Home 관련된 로직이면 Home이란 단어를 먼저 써줘야 추후에 리팩할 때 찾기에도 편할 것 같아요!
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.
오!!! 맞아요ㅎㅎㅎ 수정하겠습니당!!
}.onFailure { exception: Throwable -> | ||
_recommendInternState.value = UiState.Failure(exception.message ?: " ") |
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.
실패했을 때의 상태를 UiState를 활용해서 Failure로 명시해주고, 토스트는 sideEffect로 관리해주면 좋을 것 같아요!
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.
sideEffect!!!!! 도전해보겠습니다😎
// fun toRecommendInternEntity(): List<RecommendInternResponseModel> = listOf( | ||
// RecommendInternResponseModel( | ||
// internshipAnnouncementId = this.internshipAnnouncementId, | ||
// title = this.title, | ||
// dDay = this.dDay, | ||
// workingPeriod = this.workingPeriod, | ||
// companyImage = this.companyImage, | ||
// isScrapped = this.isScrapped, | ||
// ) | ||
// ) |
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.
이 피알에서는 안 쓰이는 코드이면 지워줘도 될 것 같아요!
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.
이게 원래 코드고 밑에 있는 코드가 더미데이터인데 제가 깜빡하고 수정을 안했네요😅 수정하겠습니다 감사해요!!
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.
레전드 천재 발생 서버 로직 순항중,,, 수고하셨어요 ㅜㅜ!!!!!!!!
class HomeDataSourceImpl @Inject constructor( | ||
private val homeService: HomeService | ||
) : HomeDataSource { | ||
override suspend fun getRecommendIntern(sortBy: String): BaseResponse<HomeRecommendInternResponseDto> = |
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.
BaseResponse로 감싸기 참고합니당!! 히
suspend fun getRecommendIntern( | ||
@Query("sortBy") sortBy: String, | ||
): BaseResponse<HomeRecommendInternResponseDto> | ||
|
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.
여기 줄바꿈 없애주시면 완벽할것가탕여 ㅎㅎ
|
||
sealed class HomeSideEffect { | ||
data class ShowToast(@StringRes val message: Int) : HomeSideEffect() | ||
data object NavigateToChangeFilter : HomeSideEffect() |
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.
우왕...😗
val homeSortByState get() = _homeSortByState.asStateFlow() | ||
|
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.
요거는 아직 안쓰는 건가여?
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.
이거는 (아마도) 필터링 정보 불러올 때 다시 사용할 것 같아요!!
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.
API 명세서와 약간 다른 부분이 있는 것 같아서 그것만 잡으면 될 것 같아요!!
매핑 부분 보다가 제가 놓친 부분을 발견했네요ㅎㅎ 코드 너무 좋습니당~
import com.terning.data.dto.response.HomeRecommendInternResponseDto | ||
|
||
interface HomeDataSource { | ||
suspend fun getRecommendIntern(sortBy: String): BaseResponse<HomeRecommendInternResponseDto> |
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.
suspend fun getRecommendIntern(sortBy: String): BaseResponse<HomeRecommendInternResponseDto> | |
suspend fun getRecommendIntern(sortBy: String): BaseResponse<List<HomeRecommendInternResponseDto>> |
API 명세서 확인해봤을땐 BaseResponse
의 result
가 직접 리스트를 관리하는 것으로 보여서 이 방식대로 수정해야되지 않나 싶네요,,
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.
아하!!! 감사합니다!!
enum class SortBy(val sortBy: String) { | ||
EARLIEST("deadlineSoon"), | ||
SHORTEST("shortestDuration"), | ||
LONGEST("longestDuration"), | ||
SCRAP("mostScrapped"), | ||
VIEW_COUNT("mostViewed"), | ||
} |
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.
이런 건 따로 분리해주는 게 좋을 것 같아요!
…mmend-intern # Conflicts: # app/src/main/java/com/terning/point/di/DataSourceModule.kt # app/src/main/java/com/terning/point/di/RepositoryModule.kt # app/src/main/java/com/terning/point/di/ServiceModule.kt
…mmend-intern # Conflicts: # app/src/main/java/com/terning/point/di/DataSourceModule.kt # app/src/main/java/com/terning/point/di/RepositoryModule.kt # app/src/main/java/com/terning/point/di/ServiceModule.kt # data/src/main/java/com/terning/data/datasource/HomeDataSource.kt # data/src/main/java/com/terning/data/datasourceimpl/HomeDataSourceImpl.kt # data/src/main/java/com/terning/data/repositoryimpl/HomeRepositoryImpl.kt # data/src/main/java/com/terning/data/service/HomeService.kt # domain/src/main/java/com/terning/domain/repository/HomeRepository.kt # feature/src/main/java/com/terning/feature/home/home/HomeRoute.kt # feature/src/main/java/com/terning/feature/home/home/HomeSideEffect.kt # feature/src/main/java/com/terning/feature/home/home/HomeViewModel.kt
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.
LGTM~~~~~~~~~~~~
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.
베리 나이스하네요!!
⛳️ Work Description
📸 Screenshot
Screen_Recording_20240718_024745_Terning-Android.mp4
📢 To Reviewers