test #329
|
@ -3,6 +3,7 @@ package kr.co.vividnext.sodalive.api.home
|
||||||
import kr.co.vividnext.sodalive.audition.GetAuditionListItem
|
import kr.co.vividnext.sodalive.audition.GetAuditionListItem
|
||||||
import kr.co.vividnext.sodalive.content.AudioContentMainItem
|
import kr.co.vividnext.sodalive.content.AudioContentMainItem
|
||||||
import kr.co.vividnext.sodalive.content.main.GetAudioContentRankingItem
|
import kr.co.vividnext.sodalive.content.main.GetAudioContentRankingItem
|
||||||
|
import kr.co.vividnext.sodalive.content.main.banner.GetAudioContentBannerResponse
|
||||||
import kr.co.vividnext.sodalive.content.main.tab.GetContentCurationResponse
|
import kr.co.vividnext.sodalive.content.main.tab.GetContentCurationResponse
|
||||||
import kr.co.vividnext.sodalive.content.series.GetSeriesListResponse
|
import kr.co.vividnext.sodalive.content.series.GetSeriesListResponse
|
||||||
import kr.co.vividnext.sodalive.event.GetEventResponse
|
import kr.co.vividnext.sodalive.event.GetEventResponse
|
||||||
|
@ -15,6 +16,7 @@ data class GetHomeResponse(
|
||||||
val creatorRanking: List<GetExplorerSectionCreatorResponse>,
|
val creatorRanking: List<GetExplorerSectionCreatorResponse>,
|
||||||
val latestContentThemeList: List<String>,
|
val latestContentThemeList: List<String>,
|
||||||
val latestContentList: List<AudioContentMainItem>,
|
val latestContentList: List<AudioContentMainItem>,
|
||||||
|
val bannerList: List<GetAudioContentBannerResponse>,
|
||||||
val eventBannerList: GetEventResponse,
|
val eventBannerList: GetEventResponse,
|
||||||
val originalAudioDramaList: List<GetSeriesListResponse.SeriesListItem>,
|
val originalAudioDramaList: List<GetSeriesListResponse.SeriesListItem>,
|
||||||
val auditionList: List<GetAuditionListItem>,
|
val auditionList: List<GetAuditionListItem>,
|
||||||
|
|
|
@ -4,12 +4,13 @@ import kr.co.vividnext.sodalive.audition.AuditionService
|
||||||
import kr.co.vividnext.sodalive.content.AudioContentMainItem
|
import kr.co.vividnext.sodalive.content.AudioContentMainItem
|
||||||
import kr.co.vividnext.sodalive.content.AudioContentService
|
import kr.co.vividnext.sodalive.content.AudioContentService
|
||||||
import kr.co.vividnext.sodalive.content.ContentType
|
import kr.co.vividnext.sodalive.content.ContentType
|
||||||
|
import kr.co.vividnext.sodalive.content.main.banner.AudioContentBannerService
|
||||||
import kr.co.vividnext.sodalive.content.main.curation.AudioContentCurationService
|
import kr.co.vividnext.sodalive.content.main.curation.AudioContentCurationService
|
||||||
import kr.co.vividnext.sodalive.content.series.ContentSeriesService
|
import kr.co.vividnext.sodalive.content.series.ContentSeriesService
|
||||||
import kr.co.vividnext.sodalive.content.series.GetSeriesListResponse
|
import kr.co.vividnext.sodalive.content.series.GetSeriesListResponse
|
||||||
import kr.co.vividnext.sodalive.content.theme.AudioContentThemeService
|
import kr.co.vividnext.sodalive.content.theme.AudioContentThemeService
|
||||||
import kr.co.vividnext.sodalive.creator.admin.content.series.SeriesPublishedDaysOfWeek
|
import kr.co.vividnext.sodalive.creator.admin.content.series.SeriesPublishedDaysOfWeek
|
||||||
import kr.co.vividnext.sodalive.event.EventService
|
import kr.co.vividnext.sodalive.event.GetEventResponse
|
||||||
import kr.co.vividnext.sodalive.explorer.ExplorerQueryRepository
|
import kr.co.vividnext.sodalive.explorer.ExplorerQueryRepository
|
||||||
import kr.co.vividnext.sodalive.live.room.LiveRoomService
|
import kr.co.vividnext.sodalive.live.room.LiveRoomService
|
||||||
import kr.co.vividnext.sodalive.live.room.LiveRoomStatus
|
import kr.co.vividnext.sodalive.live.room.LiveRoomStatus
|
||||||
|
@ -28,12 +29,12 @@ import java.time.temporal.TemporalAdjusters
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
class HomeService(
|
class HomeService(
|
||||||
private val eventService: EventService,
|
|
||||||
private val memberService: MemberService,
|
private val memberService: MemberService,
|
||||||
private val liveRoomService: LiveRoomService,
|
private val liveRoomService: LiveRoomService,
|
||||||
private val auditionService: AuditionService,
|
private val auditionService: AuditionService,
|
||||||
private val seriesService: ContentSeriesService,
|
private val seriesService: ContentSeriesService,
|
||||||
private val contentService: AudioContentService,
|
private val contentService: AudioContentService,
|
||||||
|
private val bannerService: AudioContentBannerService,
|
||||||
private val curationService: AudioContentCurationService,
|
private val curationService: AudioContentCurationService,
|
||||||
private val contentThemeService: AudioContentThemeService,
|
private val contentThemeService: AudioContentThemeService,
|
||||||
private val recommendChannelService: RecommendChannelQueryService,
|
private val recommendChannelService: RecommendChannelQueryService,
|
||||||
|
@ -95,7 +96,16 @@ class HomeService(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val eventBannerList = eventService.getEventList(isAdult = isAdult)
|
val eventBannerList = GetEventResponse(
|
||||||
|
totalCount = 0,
|
||||||
|
eventList = emptyList()
|
||||||
|
)
|
||||||
|
|
||||||
|
val bannerList = bannerService.getBannerList(
|
||||||
|
tabId = 1,
|
||||||
|
memberId = member?.id,
|
||||||
|
isAdult = isAdult
|
||||||
|
)
|
||||||
|
|
||||||
val originalAudioDramaList = seriesService.getOriginalAudioDramaList(
|
val originalAudioDramaList = seriesService.getOriginalAudioDramaList(
|
||||||
isAdult = isAdult,
|
isAdult = isAdult,
|
||||||
|
@ -167,6 +177,7 @@ class HomeService(
|
||||||
creatorRanking = creatorRanking,
|
creatorRanking = creatorRanking,
|
||||||
latestContentThemeList = latestContentThemeList,
|
latestContentThemeList = latestContentThemeList,
|
||||||
latestContentList = latestContentList,
|
latestContentList = latestContentList,
|
||||||
|
bannerList = bannerList,
|
||||||
eventBannerList = eventBannerList,
|
eventBannerList = eventBannerList,
|
||||||
originalAudioDramaList = originalAudioDramaList,
|
originalAudioDramaList = originalAudioDramaList,
|
||||||
auditionList = auditionList,
|
auditionList = auditionList,
|
||||||
|
|
|
@ -1336,10 +1336,8 @@ class AudioContentQueryRepositoryImpl(
|
||||||
where = where.and(audioContentTheme.theme.`in`(theme))
|
where = where.and(audioContentTheme.theme.`in`(theme))
|
||||||
}
|
}
|
||||||
|
|
||||||
where = if (isFree) {
|
if (isFree) {
|
||||||
where.and(audioContent.price.loe(0))
|
where = where.and(audioContent.price.loe(0))
|
||||||
} else {
|
|
||||||
where.and(audioContent.price.gt(0))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return queryFactory
|
return queryFactory
|
||||||
|
|
|
@ -55,10 +55,8 @@ class AudioContentThemeQueryRepository(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
where = if (isFree) {
|
if (isFree) {
|
||||||
where.and(audioContent.price.loe(0))
|
where = where.and(audioContent.price.loe(0))
|
||||||
} else {
|
|
||||||
where.and(audioContent.price.gt(0))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return queryFactory
|
return queryFactory
|
||||||
|
|
|
@ -60,7 +60,13 @@ class RecommendChannelQueryRepository(
|
||||||
.fetch()
|
.fetch()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getContentsByCreatorIdLikeDesc(creatorId: Long): List<RecommendChannelContentItem> {
|
fun getContentsByCreatorIdLikeDesc(creatorId: Long, isAdult: Boolean): List<RecommendChannelContentItem> {
|
||||||
|
var where = audioContent.member.id.eq(creatorId)
|
||||||
|
|
||||||
|
if (!isAdult) {
|
||||||
|
where = where.and(audioContent.isAdult.isFalse)
|
||||||
|
}
|
||||||
|
|
||||||
return queryFactory
|
return queryFactory
|
||||||
.select(
|
.select(
|
||||||
QRecommendChannelContentItem(
|
QRecommendChannelContentItem(
|
||||||
|
@ -82,7 +88,7 @@ class RecommendChannelQueryRepository(
|
||||||
audioContentComment.audioContent.id.eq(audioContent.id)
|
audioContentComment.audioContent.id.eq(audioContent.id)
|
||||||
.and(audioContentComment.isActive.isTrue)
|
.and(audioContentComment.isActive.isTrue)
|
||||||
)
|
)
|
||||||
.where(audioContent.member.id.eq(creatorId))
|
.where(where)
|
||||||
.groupBy(audioContent.id)
|
.groupBy(audioContent.id)
|
||||||
.orderBy(audioContentLike.id.countDistinct().desc())
|
.orderBy(audioContentLike.id.countDistinct().desc())
|
||||||
.limit(3)
|
.limit(3)
|
||||||
|
|
|
@ -23,7 +23,11 @@ class RecommendChannelQueryService(private val repository: RecommendChannelQuery
|
||||||
)
|
)
|
||||||
|
|
||||||
return recommendChannelList.map {
|
return recommendChannelList.map {
|
||||||
it.contentList = repository.getContentsByCreatorIdLikeDesc(it.channelId)
|
it.contentList = repository.getContentsByCreatorIdLikeDesc(
|
||||||
|
creatorId = it.channelId,
|
||||||
|
isAdult = isAdult
|
||||||
|
)
|
||||||
|
|
||||||
it
|
it
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue