test #329
| @@ -10,7 +10,6 @@ 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.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 | ||||||
| @@ -30,7 +29,6 @@ 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, | ||||||
|   | |||||||
| @@ -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 | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user