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

검색 모아보기 관련 이슈 수정 #200

Merged
merged 5 commits into from
Aug 12, 2024

Conversation

JaesungLeee
Copy link
Member

@JaesungLeee JaesungLeee commented Aug 11, 2024

Issue

작업 내역 (Required)

  • MemeWithPagination 도메인 모델 추가
  • 페이징 Repository 로직 수정
  • 검색 모아보기 진입 시 EmptyScreen 일시적으로 노출 후 전체 컨텐츠 노출되는 이슈 수정

Review Point (Required)

  • 이게 PaginaSource에서 처리를 해서 내려보내주려고 했는데 LoadResult.Page의 data로 들어가는 타입이 List<T>더라구여 ;; MemeWithPagination에 Flow<PagingData<T>>가 포함되기 떄문에 data로 내려보내줄수가 없었습니다 ㅠㅠ 일단 동작은 되게끔 구현은 해놨는데 여전히 전체 갯수 로드를 위해 API를 한번 더 call하는 문제는 있습니다
public data class Page<Key : Any, Value : Any> constructor(
    /**
     * Loaded data
     */
    val data: List<Value>,
    
    val prevKey: Key ?,
    
    val nextKey: Key ?,
    
    @IntRange(from = COUNT_UNDEFINED.toLong()) 
    val itemsBefore: Int = COUNT_UNDEFINED,
    
    @IntRange(from = COUNT_UNDEFINED.toLong()) 
    val itemsAfter: Int = COUNT_UNDEFINED
) : LoadResult<Key, Value>(), Iterable<Value> { .. }

// MemeRepositoryImpl.kt
override suspend fun getSearchMemes(keyword: String): MemeWithPagination {
   val totalMemeCount = memeDataSource.getSearchMemes(
       keyword = keyword,
       page = 1,
       size = ITEMS_PER_PAGE
   ).pagination.total

    return MemeWithPagination(
        totalMemeCount = totalMemeCount,
        memes = createPager { page ->
           memeDataSource.getSearchMemes(
                keyword = keyword,
                page = page,
                size = ITEMS_PER_PAGE,
           ).memeList.map { it.toMeme() }
        }.flow
    )
}

Screenshot

Before After

관련 링크

  • none

@JaesungLeee
Copy link
Member Author

요거 월욜 업데이트 이후에 조금 더 보고싶어서 해당 이슈 close는 안해둘게영

Copy link
Collaborator

@hj1115hj hj1115hj left a comment

Choose a reason for hiding this comment

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

이슈 잡느라 고생많았어요ㅜㅜ!

@JaesungLeee JaesungLeee merged commit be931c9 into develop Aug 12, 2024
@JaesungLeee JaesungLeee deleted the feature/meme-item-count branch August 12, 2024 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

검색화면에서 키워드 클릭 후 진입 시 밈 없음 화면 표시 후 밈 표시되는 이슈
3 participants