라이브 탭 상단 추천라이브 - 차단 당한 유저는 차단한 유저의 배너가 조회되지 않도록 수정

This commit is contained in:
Klaus 2023-08-30 22:12:44 +09:00
parent 41fe37bdb2
commit eece72bc40
2 changed files with 9 additions and 1 deletions

View File

@ -19,7 +19,11 @@ class LiveRecommendRepository(
@Value("\${cloud.aws.cloud-front.host}")
private val cloudFrontHost: String
) {
fun getRecommendLive(memberId: Long, isAdult: Boolean): List<GetRecommendLiveResponse> {
fun getRecommendLive(
memberId: Long,
isBlocked: (Long) -> Boolean,
isAdult: Boolean
): List<GetRecommendLiveResponse> {
val dateNow = LocalDateTime.now()
var where = recommendLiveCreatorBanner.startDate.loe(dateNow)
@ -41,6 +45,9 @@ class LiveRecommendRepository(
.where(where)
.orderBy(recommendLiveCreatorBanner.orders.asc())
.fetch()
.asSequence()
.filter { !isBlocked(it.creatorId) }
.toList()
}
fun getOnAirRecommendChannelList(

View File

@ -14,6 +14,7 @@ class LiveRecommendService(
fun getRecommendLive(member: Member): List<GetRecommendLiveResponse> {
return repository.getRecommendLive(
memberId = member.id!!,
isBlocked = { !blockMemberRepository.isBlocked(blockedMemberId = member.id!!, memberId = it) },
isAdult = member.auth != null
)
}