콘텐츠 메인 시리즈 탭

- 차단 당한 유저는 오리지널 오디오 드라마가 조회되지 않도록 수정
This commit is contained in:
Klaus 2025-02-12 19:54:11 +09:00
parent 7e9cb556d0
commit 63f952d390
3 changed files with 19 additions and 9 deletions

View File

@ -23,15 +23,17 @@ class AudioContentMainTabSeriesService(
) {
fun fetchData(member: Member): GetContentMainTabSeriesResponse {
val isAdult = member.auth != null
val memberId = member.id!!
// 메인 배너 (시리즈)
val contentBannerList = bannerService.getBannerList(
tabId = 2,
memberId = member.id!!,
memberId = memberId,
isAdult = isAdult
)
val originalAudioDrama = seriesService.getOriginalAudioDramaList(
memberId = memberId,
isAdult = isAdult,
offset = 0,
limit = 20
@ -48,7 +50,7 @@ class AudioContentMainTabSeriesService(
.plusDays(1)
val rankSeriesList = rankingService.getSeriesRanking(
memberId = member.id!!,
memberId = memberId,
isAdult = isAdult,
startDate = dailyRankingStartDate,
endDate = dailyRankingEndDate
@ -60,7 +62,7 @@ class AudioContentMainTabSeriesService(
// 장르별 추천 시리즈
val recommendSeriesList = if (genreList.isNotEmpty()) {
rankingService.getSeriesAllRankingByGenre(
memberId = member.id!!,
memberId = memberId,
isAdult = isAdult,
genreId = genreList[0].id
)
@ -82,7 +84,7 @@ class AudioContentMainTabSeriesService(
.plusMonths(1)
val rankCompleteSeriesList = rankingService.getCompleteSeriesRanking(
memberId = member.id!!,
memberId = memberId,
isAdult = isAdult,
startDate = monthlyRankingStartDate,
endDate = monthlyRankingEndDate
@ -98,7 +100,7 @@ class AudioContentMainTabSeriesService(
.plusDays(6)
val seriesRankCreatorList = rankingService.fetchCreatorBySeriesRevenueRankTop20(
memberId = member.id!!,
memberId = memberId,
startDate = startDate.minusDays(1),
endDate = endDate
)
@ -122,7 +124,7 @@ class AudioContentMainTabSeriesService(
title = it.title,
items = seriesService.fetchSeriesByCurationId(
curationId = it.id!!,
memberId = member.id!!,
memberId = memberId,
isAdult = isAdult
)
)

View File

@ -35,7 +35,7 @@ interface ContentSeriesQueryRepository {
fun getKeywordList(seriesId: Long): List<String>
fun getSeriesContentMinMaxPrice(seriesId: Long): GetSeriesContentMinMaxPriceResponse
fun getRecommendSeriesList(isAuth: Boolean, contentType: ContentType, limit: Long): List<Series>
fun getOriginalAudioDramaList(isAdult: Boolean, offset: Long = 0, limit: Long = 20): List<Series>
fun getOriginalAudioDramaList(memberId: Long, isAdult: Boolean, offset: Long = 0, limit: Long = 20): List<Series>
fun getGenreList(isAdult: Boolean): List<GetSeriesGenreListResponse>
fun findByCurationId(curationId: Long, memberId: Long, isAdult: Boolean): List<Series>
}
@ -143,9 +143,14 @@ class ContentSeriesQueryRepositoryImpl(
.fetch()
}
override fun getOriginalAudioDramaList(isAdult: Boolean, offset: Long, limit: Long): List<Series> {
override fun getOriginalAudioDramaList(memberId: Long, isAdult: Boolean, offset: Long, limit: Long): List<Series> {
val blockMemberCondition = blockMember.member.id.eq(member.id)
.and(blockMember.isActive.isTrue)
.and(blockMember.blockedMember.id.eq(memberId))
var where = series.isOriginal.isTrue
.and(series.isActive.isTrue)
.and(blockMember.id.isNull)
if (!isAdult) {
where = where.and(series.isAdult.isFalse)
@ -153,6 +158,8 @@ class ContentSeriesQueryRepositoryImpl(
return queryFactory
.selectFrom(series)
.innerJoin(series.member, member)
.leftJoin(blockMember).on(blockMemberCondition)
.where(where)
.orderBy(Expressions.numberTemplate(Double::class.java, "function('rand')").asc())
.offset(offset)

View File

@ -31,11 +31,12 @@ class ContentSeriesService(
private val coverImageHost: String
) {
fun getOriginalAudioDramaList(
memberId: Long,
isAdult: Boolean,
offset: Long = 0,
limit: Long = 20
): List<GetSeriesListResponse.SeriesListItem> {
val originalAudioDramaList = repository.getOriginalAudioDramaList(isAdult, offset, limit)
val originalAudioDramaList = repository.getOriginalAudioDramaList(memberId, isAdult, offset, limit)
return seriesToSeriesListItem(originalAudioDramaList, isAdult)
}