Skip to content

Commit

Permalink
test: connection 조정
Browse files Browse the repository at this point in the history
  • Loading branch information
belljun3395 committed Jan 15, 2025
1 parent a95cb4b commit e0c608a
Showing 1 changed file with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,11 @@ class BrowseArticlesUseCase(
}
val articleIds = articleViewsRecords.map { it.articleId }.toList()

/**
* ARTICLE_MAIN_CARD 테이블에서 이번 스크롤에서 보여줄 10개 아티클 조회
*/
val articleMainCardRecords: List<ArticleMainCardRecord> =
articleIds.mapNotNull {
articleMainCardDao.selectArticleMainCardsRecord(
it,
)
}
val articleMainCardRecords: Set<ArticleMainCardRecord> =
articleMainCardDao.selectArticleMainCardsRecord(articleIds.toSortedSet())

/**
* 아티클 컨텐츠는 ARTICLE_MAIN_CARD가 아닌 ARTICLE_IFO에서 조회 (TODO: 캐싱 적용)
*/
val selectArticleContentsRecords: List<SelectArticleContentsRecord> = articleIds.mapNotNull { articleDao.selectArticleContent(it) }
val selectArticleContentsRecords: List<SelectArticleContentsRecord> =
articleDao.selectArticleContents(articleIds.toSortedSet())

articleMainCardRecords.withIndex().forEach { (index, articleMainCardRecord) ->
articleMainCardRecord.content = selectArticleContentsRecords[index].content
Expand Down

0 comments on commit e0c608a

Please sign in to comment.