차단 사용자 제외를 조회 쿼리로 통합
홈, 추천 채널, 랭킹 조회에서 차단 사용자 제외를 애플리케이션 필터링 대신 DB 쿼리로 처리한다. 콘텐츠/랭킹/추천 조회 API에 memberId 인자를 전달한다.
This commit is contained in:
@@ -9,7 +9,6 @@ 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.member.MemberService
|
||||
import org.springframework.beans.factory.annotation.Value
|
||||
import org.springframework.stereotype.Service
|
||||
import java.time.LocalDateTime
|
||||
@@ -17,7 +16,6 @@ import java.time.LocalDateTime
|
||||
@Service
|
||||
class RankingService(
|
||||
private val repository: RankingRepository,
|
||||
private val memberService: MemberService,
|
||||
private val seriesContentRepository: ContentSeriesContentRepository,
|
||||
|
||||
@Value("\${cloud.aws.cloud-front.host}")
|
||||
@@ -25,14 +23,7 @@ class RankingService(
|
||||
) {
|
||||
fun getCreatorRanking(memberId: Long?, rankingDate: String): GetExplorerSectionResponse {
|
||||
val creatorRankings = repository
|
||||
.getCreatorRankings()
|
||||
.filter {
|
||||
if (memberId != null) {
|
||||
!memberService.isBlocked(blockedMemberId = memberId, memberId = it.id!!)
|
||||
} else {
|
||||
true
|
||||
}
|
||||
}
|
||||
.getCreatorRankings(memberId = memberId)
|
||||
.map { it.toExplorerSectionCreator(imageHost) }
|
||||
|
||||
return GetExplorerSectionResponse(
|
||||
|
||||
Reference in New Issue
Block a user