Skip to content
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

Merged
merged 20 commits into from
Jul 17, 2024

Conversation

Hyobeen-Park
Copy link
Member

@Hyobeen-Park Hyobeen-Park commented Jul 15, 2024

⛳️ Work Description

  • 서버 통신 관련 파일 구현
  • 뷰모델 로직 구현

📸 Screenshot

Screen_Recording_20240718_024745_Terning-Android.mp4

📢 To Reviewers

  • 딱 맞는 인턴 공고 서버 통신 성공!!!!!!!!!!!!!!!!!!!
  • 사진 잘리는 건 석준오빠가 고치는중~~

…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
Copy link
Member

@leeeyubin leeeyubin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

같이 서버통신 로직 토론해준 효빈언니 최고!!! 덕분에 이번 서버통신 매우 easy 할 듯 싶네용 ㅎㅎ
로직 수정되면 알려주세요!!!

Comment on lines 5 to 7

interface InternDataSource {
suspend fun getRecommendIntern(sortBy: String): BaseResponse<RecommendInternResponseDto>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Home 관련된 로직이면 Home이란 단어를 먼저 써줘야 추후에 리팩할 때 찾기에도 편할 것 같아요!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오!!! 맞아요ㅎㅎㅎ 수정하겠습니당!!

Comment on lines 74 to 75
}.onFailure { exception: Throwable ->
_recommendInternState.value = UiState.Failure(exception.message ?: " ")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

실패했을 때의 상태를 UiState를 활용해서 Failure로 명시해주고, 토스트는 sideEffect로 관리해주면 좋을 것 같아요!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sideEffect!!!!! 도전해보겠습니다😎

Comment on lines 22 to 31
// fun toRecommendInternEntity(): List<RecommendInternResponseModel> = listOf(
// RecommendInternResponseModel(
// internshipAnnouncementId = this.internshipAnnouncementId,
// title = this.title,
// dDay = this.dDay,
// workingPeriod = this.workingPeriod,
// companyImage = this.companyImage,
// isScrapped = this.isScrapped,
// )
// )
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 피알에서는 안 쓰이는 코드이면 지워줘도 될 것 같아요!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이게 원래 코드고 밑에 있는 코드가 더미데이터인데 제가 깜빡하고 수정을 안했네요😅 수정하겠습니다 감사해요!!

Copy link
Contributor

@arinming arinming left a 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> =
Copy link
Contributor

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>

Copy link
Contributor

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()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

우왕...😗

Comment on lines 63 to 64
val homeSortByState get() = _homeSortByState.asStateFlow()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요거는 아직 안쓰는 건가여?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거는 (아마도) 필터링 정보 불러올 때 다시 사용할 것 같아요!!

Copy link
Member

@boiledEgg-s boiledEgg-s left a 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>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
suspend fun getRecommendIntern(sortBy: String): BaseResponse<HomeRecommendInternResponseDto>
suspend fun getRecommendIntern(sortBy: String): BaseResponse<List<HomeRecommendInternResponseDto>>

API 명세서 확인해봤을땐 BaseResponseresult가 직접 리스트를 관리하는 것으로 보여서 이 방식대로 수정해야되지 않나 싶네요,,

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아하!!! 감사합니다!!

Comment on lines 91 to 97
enum class SortBy(val sortBy: String) {
EARLIEST("deadlineSoon"),
SHORTEST("shortestDuration"),
LONGEST("longestDuration"),
SCRAP("mostScrapped"),
VIEW_COUNT("mostViewed"),
}
Copy link
Member

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
@Hyobeen-Park Hyobeen-Park changed the title [FEAT/#77] 홈 뷰 / 맞춤 공고 서버 통신 로직 구현 [FEAT/#77] 홈 뷰 / 맞춤 공고 서버 통신 구현 Jul 17, 2024
Copy link
Member

@leeeyubin leeeyubin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM~~~~~~~~~~~~

Copy link
Member

@boiledEgg-s boiledEgg-s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

베리 나이스하네요!!

@Hyobeen-Park Hyobeen-Park merged commit a516c32 into develop Jul 17, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FEAT ✨ 새로운 기능 구현 효빈💚 효빈
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] 홈 뷰 / 딱 맞는 대학생 인턴 공고 서버 통신 구현
4 participants