| @@ -3,6 +3,7 @@ package kr.co.vividnext.sodalive.api.home | ||||
| import kr.co.vividnext.sodalive.audition.GetAuditionListItem | ||||
| import kr.co.vividnext.sodalive.content.AudioContentMainItem | ||||
| 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.series.GetSeriesListResponse | ||||
| import kr.co.vividnext.sodalive.event.GetEventResponse | ||||
| @@ -15,6 +16,7 @@ data class GetHomeResponse( | ||||
|     val creatorRanking: List<GetExplorerSectionCreatorResponse>, | ||||
|     val latestContentThemeList: List<String>, | ||||
|     val latestContentList: List<AudioContentMainItem>, | ||||
|     val bannerList: List<GetAudioContentBannerResponse>, | ||||
|     val eventBannerList: GetEventResponse, | ||||
|     val originalAudioDramaList: List<GetSeriesListResponse.SeriesListItem>, | ||||
|     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.AudioContentService | ||||
| 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.series.ContentSeriesService | ||||
| import kr.co.vividnext.sodalive.content.series.GetSeriesListResponse | ||||
| import kr.co.vividnext.sodalive.content.theme.AudioContentThemeService | ||||
| 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.live.room.LiveRoomService | ||||
| import kr.co.vividnext.sodalive.live.room.LiveRoomStatus | ||||
| @@ -28,12 +29,12 @@ import java.time.temporal.TemporalAdjusters | ||||
|  | ||||
| @Service | ||||
| class HomeService( | ||||
|     private val eventService: EventService, | ||||
|     private val memberService: MemberService, | ||||
|     private val liveRoomService: LiveRoomService, | ||||
|     private val auditionService: AuditionService, | ||||
|     private val seriesService: ContentSeriesService, | ||||
|     private val contentService: AudioContentService, | ||||
|     private val bannerService: AudioContentBannerService, | ||||
|     private val curationService: AudioContentCurationService, | ||||
|     private val contentThemeService: AudioContentThemeService, | ||||
|     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( | ||||
|             isAdult = isAdult, | ||||
| @@ -167,6 +177,7 @@ class HomeService( | ||||
|             creatorRanking = creatorRanking, | ||||
|             latestContentThemeList = latestContentThemeList, | ||||
|             latestContentList = latestContentList, | ||||
|             bannerList = bannerList, | ||||
|             eventBannerList = eventBannerList, | ||||
|             originalAudioDramaList = originalAudioDramaList, | ||||
|             auditionList = auditionList, | ||||
|   | ||||
| @@ -1336,10 +1336,8 @@ class AudioContentQueryRepositoryImpl( | ||||
|             where = where.and(audioContentTheme.theme.`in`(theme)) | ||||
|         } | ||||
|  | ||||
|         where = if (isFree) { | ||||
|             where.and(audioContent.price.loe(0)) | ||||
|         } else { | ||||
|             where.and(audioContent.price.gt(0)) | ||||
|         if (isFree) { | ||||
|             where = where.and(audioContent.price.loe(0)) | ||||
|         } | ||||
|  | ||||
|         return queryFactory | ||||
|   | ||||
| @@ -55,10 +55,8 @@ class AudioContentThemeQueryRepository( | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         where = if (isFree) { | ||||
|             where.and(audioContent.price.loe(0)) | ||||
|         } else { | ||||
|             where.and(audioContent.price.gt(0)) | ||||
|         if (isFree) { | ||||
|             where = where.and(audioContent.price.loe(0)) | ||||
|         } | ||||
|  | ||||
|         return queryFactory | ||||
|   | ||||
| @@ -60,7 +60,13 @@ class RecommendChannelQueryRepository( | ||||
|             .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 | ||||
|             .select( | ||||
|                 QRecommendChannelContentItem( | ||||
| @@ -82,7 +88,7 @@ class RecommendChannelQueryRepository( | ||||
|                 audioContentComment.audioContent.id.eq(audioContent.id) | ||||
|                     .and(audioContentComment.isActive.isTrue) | ||||
|             ) | ||||
|             .where(audioContent.member.id.eq(creatorId)) | ||||
|             .where(where) | ||||
|             .groupBy(audioContent.id) | ||||
|             .orderBy(audioContentLike.id.countDistinct().desc()) | ||||
|             .limit(3) | ||||
|   | ||||
| @@ -23,7 +23,11 @@ class RecommendChannelQueryService(private val repository: RecommendChannelQuery | ||||
|         ) | ||||
|  | ||||
|         return recommendChannelList.map { | ||||
|             it.contentList = repository.getContentsByCreatorIdLikeDesc(it.channelId) | ||||
|             it.contentList = repository.getContentsByCreatorIdLikeDesc( | ||||
|                 creatorId = it.channelId, | ||||
|                 isAdult = isAdult | ||||
|             ) | ||||
|  | ||||
|             it | ||||
|         } | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user