diff --git a/api-repo/src/main/kotlin/com/few/api/repo/dao/article/ArticleDao.kt b/api-repo/src/main/kotlin/com/few/api/repo/dao/article/ArticleDao.kt index 9fdb56e20..881e98246 100644 --- a/api-repo/src/main/kotlin/com/few/api/repo/dao/article/ArticleDao.kt +++ b/api-repo/src/main/kotlin/com/few/api/repo/dao/article/ArticleDao.kt @@ -135,8 +135,8 @@ class ArticleDao( suspend fun selectArticleContentsAsync(articleId: Long): SelectArticleContentsRecord = dslContext .select( - ArticleIfo.ARTICLE_IFO.ARTICLE_MST_ID.`as`(SelectArticleContentsRecord::articleId.name) -// ArticleIfo.ARTICLE_IFO.CONTENT.`as`(SelectArticleContentsRecord::content.name) + ArticleIfo.ARTICLE_IFO.ARTICLE_MST_ID.`as`(SelectArticleContentsRecord::articleId.name), + ArticleIfo.ARTICLE_IFO.CONTENT.`as`(SelectArticleContentsRecord::content.name) ).from(ArticleIfo.ARTICLE_IFO) .where(ArticleIfo.ARTICLE_IFO.ARTICLE_MST_ID.eq(articleId)) .and(ArticleIfo.ARTICLE_IFO.DELETED_AT.isNull) diff --git a/api-repo/src/main/kotlin/com/few/api/repo/dao/article/record/SelectArticleContentsRecord.kt b/api-repo/src/main/kotlin/com/few/api/repo/dao/article/record/SelectArticleContentsRecord.kt index b40b13f81..1b649fe95 100644 --- a/api-repo/src/main/kotlin/com/few/api/repo/dao/article/record/SelectArticleContentsRecord.kt +++ b/api-repo/src/main/kotlin/com/few/api/repo/dao/article/record/SelectArticleContentsRecord.kt @@ -2,6 +2,5 @@ package com.few.api.repo.dao.article.record data class SelectArticleContentsRecord( val articleId: Long, -) { - val content: String = "" -} \ No newline at end of file + val content: String, +) \ No newline at end of file diff --git a/api/src/main/kotlin/com/few/api/domain/article/usecase/BrowseArticlesUseCase.kt b/api/src/main/kotlin/com/few/api/domain/article/usecase/BrowseArticlesUseCase.kt index 6fea14214..14d2702e6 100644 --- a/api/src/main/kotlin/com/few/api/domain/article/usecase/BrowseArticlesUseCase.kt +++ b/api/src/main/kotlin/com/few/api/domain/article/usecase/BrowseArticlesUseCase.kt @@ -99,7 +99,7 @@ class BrowseArticlesUseCase( val sortedArticles = updateAndSortArticleViews(articleMainCardRecords, articleViewsRecords) val selectArticleContentsRecords = deferredResults.associateBy { it.articleId } sortedArticles.forEach { - it.content = selectArticleContentsRecords[it.articleId]?.content ?: "" + it.content = selectArticleContentsRecords[it.articleId]?.content?.substring(0, 500) ?: "" } val articleUseCaseOuts: List =