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] 메인 리스트 뷰 API 연동 및 전체적인 플로우 점검 #214

Merged
merged 32 commits into from
Mar 6, 2024

Conversation

jihyunniiii
Copy link
Collaborator

@jihyunniiii jihyunniiii commented Mar 3, 2024

Related issue 🛠

Work Description ✏️

  • 메인 리스트 뷰 API 연동 및 전체적인 플로우 점검
    • 리스트뷰 검색 + 전체조회 API 연동
    • 홈 뷰 플로우 점검
    • 메인 리스트 뷰 워딩 수정 (최신순 -> 최신등록순)
    • 지도 뷰 핀 클릭 시 딜레이 문제 해결

Screenshot 📸

Screen_recording_20240303_215955.mp4

Uncompleted Tasks 😅

  • 메인 리스트 뷰 핑글 참여/참여 취소 후 리스트뷰 초기화 -> 아요핑과 논의 완 (서버통신 새로 안 받고 로컬에서 처리해주기로 했슴다 ! 이후에 칩, order, 검색 값이 바뀔 때 리스트 새로 받아오기로 결정쓰)
  • 지도 뷰에서는 검색 결과가 없는데 리스트에는 검색 결과가 있는 경우에 대한 분기처리 -> 기획핑과 논의 완 (리스트뷰로 이동 + 리스트 검색 결과 보여줌)
  • 검색 + 칩 관련 플로우 -> 모두 칩 초기화
  • 검색 뷰에서 공백 검색 가능 여부 -> 기획핑과 논의 완 (검색은 가능 + 엠티뷰 노출)

To Reviewers 📢

  • 논의 중인 부분 제외 모두 구현 완료 ㅋㅋ
  • distinctUntilChanged -> 제발 이거 누가 해결 좀 해주세요

Copy link
Collaborator

@HAJIEUN02 HAJIEUN02 left a comment

Choose a reason for hiding this comment

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

고생하셨습니당💖

category = category,
teamId = teamId,
order = order
).data.meetings.map { meeting -> meeting.toPingleEntity() }
Copy link
Collaborator

Choose a reason for hiding this comment

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

랭킹뷰에서는 Dto 내에서 List로 매핑해주는 함수를 작성해주셨는데 이번 api 연동에서는 RepositoryImpl에서 List로 매핑해주신 특별한 이유가 있나요?

@Serializable
data class ResponseRankingDto(
    @SerialName("meetingCount")
    val meetingCount: Int,
    @SerialName("locations")
    val locations: List<ResponseRankingLocationDto>
) {
    @Serializable
    data class ResponseRankingLocationDto(
        @SerialName("name")
        val name: String,
        @SerialName("latestVisitedDate")
        val latestVisitedDate: List<Int>,
        @SerialName("locationCount")
        val locationCount: Int
    ) {
        fun toRankingLocationEntity() = RankingLocationEntity(
            name = this.name,
            latestVisitedDate = this.latestVisitedDate.subList(DATE_START_INDEX, DATE_END_INDEX),
            locationCount = this.locationCount
        )
    }

    fun toRankingEntity() = RankingEntity(
        meetingCount = this.meetingCount,
        locations = this.locations.map { responseRankingLocationDto -> responseRankingLocationDto.toRankingLocationEntity() }
    )

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

랭킹은 RankingEntity 내부에 리스트가 있는 형태이기 때문에 DTO에서 변환을 해주었고 여기는 리스트 자체만 있어서 impl에서 해줬어요 !

val result = runCatching {
mapRemoteDataSource.getPingleList(
mapRemoteDataSource.getMapPingleList(
Copy link
Collaborator

Choose a reason for hiding this comment

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

바뀐 이름이 훨씬 직관적이구 좋은 것 같아욥 Pingle은 마이핑글이나 랭킹뷰에 뜨는 애들도 사실은 핑글이니까는

@Query(ORDER) order: String
): BaseResponse<ResponseMainListDto>

companion object {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Service에서 VERSION이나 MEETINGS 같은 상수 객체들은 사실 여러 파일들에서 동시에 사용할 수 있는데 매 파일마다 선언해주는게 과연 좋은 걸까요? Service 파일 만들 때마다 고민한건데요.. const val로 선언하면 다른 클래스에서도 MainListService.VERSION 이런 식으로 import해서 쓸 수 있잖아요?! 그러면 이런 식으로 companion object들을 한 파일 만들어서 ServiceCompanion 이런 클래스에 넣어두고 사용하면 더 좋지 않을까라는 생각을 해봤어요 그러면 클래스간 의존도야 물론 높아지긴 하겠지만 Service 파일마다 중복된 내용이 너무 많아서.. 뭐가 더 좋은걸까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

이거 나중에 상수화 한 거 파일 하나로 만들어서 불러 쓰는 게 좋을 것 같삼요 ㅜ 리팩토링 때 ㄱㄱ 저도 레퍼런스 좀 찾아보겠슴

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
Collaborator Author

Choose a reason for hiding this comment

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

리팩 때 고고 합시둥 이번 스프린트 끝나고 리팩 뭐 할지 회의 고고!

@@ -37,6 +39,10 @@ abstract class DataSourceModule {
@Singleton
abstract fun bindsJoinGroupRemoteDataSource(joinGroupRemoteDataSourceImpl: JoinGroupRemoteDataSourceImpl): JoinGroupRemoteDataSource

@Binds
@Singleton
abstract fun bindsMainListRemoteDataSource(mainListRemoteDateSourceImpl: MainListRemoteDateSourceImpl): MainListRemoteDataSource
Copy link
Collaborator

Choose a reason for hiding this comment

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

Date -> Data 오타 났숨당

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

예리핑

) {
fun updateMainListPingleModel() = this.copy(
pingleEntity = this.pingleEntity.copy(
curParticipants = if (this.pingleEntity.isParticipating) this.pingleEntity.curParticipants + 1 else this.pingleEntity.curParticipants - 1,
Copy link
Collaborator

Choose a reason for hiding this comment

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

요기 +1, -1 하는 부분 상수화하면 더 좋을 것 같아용!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

넹구 반영하겠슴

)
combine(
homeViewModel.searchWord.flowWithLifecycle(viewLifecycleOwner.lifecycle)
.distinctUntilChanged(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

여기두 이 distinctUntilChanged 호출 안 해주면 값 안 뱉어내나용?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

값을 계속 뱉어내서 문제입니다,, onResume 될 때마다요

is UiState.Success -> {
mainListPingleListUiState.data.let { mainListPingleList ->
mainListAdapter.submitList(mainListPingleList)
binding.rvMainList.smoothScrollToPosition(TOP)
Copy link
Collaborator

Choose a reason for hiding this comment

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

여기는 2개니까 with(binding) 쓰면 좋을 것 같아요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes ~

isExpanded.addOnPropertyChangedCallback(object :
Observable.OnPropertyChangedCallback() {
override fun onPropertyChanged(sender: Observable?, propertyId: Int) {
setCardExpandable(isExpanded = isExpanded.get())
Copy link
Collaborator

Choose a reason for hiding this comment

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

카드 펼쳐지고 접히는 거 다시 봐도 댕멋지다!!!!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ㅋㅋ 사실 별거 없슴요

Copy link
Member

@DoReMinWoo DoReMinWoo left a comment

Choose a reason for hiding this comment

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

고생고생핑~

): BaseResponse<List<ResponsePinListDto>> =
): BaseResponse<List<ResponsePinDto>> =
Copy link
Member

Choose a reason for hiding this comment

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

오홍 디테일을 챙기셨네요

@Query(ORDER) order: String
): BaseResponse<ResponseMainListDto>

companion object {
Copy link
Member

Choose a reason for hiding this comment

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

저도 파일 하나에서 관리하는게 맞는거같아요!

Comment on lines 130 to 137
is UiState.Empty -> {
binding.fabHomeChange.visibility = View.VISIBLE
}

is UiState.Success -> {
binding.fabHomeChange.visibility =
if (uiState.data.second.isNotEmpty()) View.INVISIBLE else View.VISIBLE
}
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
is UiState.Empty -> {
binding.fabHomeChange.visibility = View.VISIBLE
}
is UiState.Success -> {
binding.fabHomeChange.visibility =
if (uiState.data.second.isNotEmpty()) View.INVISIBLE else View.VISIBLE
}
is UiState.Empty -> binding.fabHomeChange.visibility = View.VISIBLE
is UiState.Success -> binding.fabHomeChange.visibility =
if (uiState.data.second.isNotEmpty()) View.INVISIBLE else View.VISIBLE

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

반영할게염 ~

@jihyunniiii jihyunniiii merged commit 6dab9ea into develop Mar 6, 2024
1 check passed
@jihyunniiii jihyunniiii deleted the feat-main-list-api-connection branch March 6, 2024 02:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[feat] 메인 리스트 뷰 API 연동 및 전체적인 플로우 점검
3 participants