HomeService fetchData 리팩토링 및 DB JOIN 기반 번역 적용
fetchData 함수에서 별도로 수행하던 번역 데이터 조회를 DB JOIN 및 COALESCE를 사용하도록 개선하여 성능을 최적화함. - AudioContentRepository, RankingRepository 등에 locale 파라미터 추가 - DB 레벨에서 번역된 제목을 조회하도록 쿼리 수정 - HomeService에서 불필요한 getTranslatedContentList 호출 제거
This commit is contained in:
@@ -9,6 +9,7 @@ import kr.co.vividnext.sodalive.creator.admin.content.series.Series
|
||||
import kr.co.vividnext.sodalive.creator.admin.content.series.SeriesPublishedDaysOfWeek
|
||||
import kr.co.vividnext.sodalive.creator.admin.content.series.SeriesState
|
||||
import kr.co.vividnext.sodalive.explorer.GetExplorerSectionResponse
|
||||
import kr.co.vividnext.sodalive.i18n.LangContext
|
||||
import org.springframework.beans.factory.annotation.Value
|
||||
import org.springframework.stereotype.Service
|
||||
import java.time.LocalDateTime
|
||||
@@ -17,6 +18,7 @@ import java.time.LocalDateTime
|
||||
class RankingService(
|
||||
private val repository: RankingRepository,
|
||||
private val seriesContentRepository: ContentSeriesContentRepository,
|
||||
private val langContext: LangContext,
|
||||
|
||||
@Value("\${cloud.aws.cloud-front.host}")
|
||||
private val imageHost: String
|
||||
@@ -59,7 +61,8 @@ class RankingService(
|
||||
offset = offset,
|
||||
limit = limit,
|
||||
sortType = sortType,
|
||||
theme = theme
|
||||
theme = theme,
|
||||
locale = langContext.lang.code
|
||||
)
|
||||
loopCount++
|
||||
} while (contentList.size < 5 && loopCount < 5)
|
||||
|
||||
Reference in New Issue
Block a user