From dde4eb4a98a65e39a62245cad1d26a054bb41f0e Mon Sep 17 00:00:00 2001 From: Klaus Date: Sun, 20 Aug 2023 00:26:14 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=ED=81=AC=EB=A6=AC=EC=97=90=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=20=EC=B1=84=EB=84=90=20-=20=EC=BD=98=ED=85=90?= =?UTF-8?q?=EC=B8=A0=20=EC=88=98,=20=EB=9D=BC=EC=9D=B4=EB=B8=8C=20?= =?UTF-8?q?=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EB=82=98=EC=98=A4=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sodalive/explorer/ExplorerQueryRepository.kt | 13 +++++++++++++ .../vividnext/sodalive/explorer/ExplorerService.kt | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/ExplorerQueryRepository.kt b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/ExplorerQueryRepository.kt index db641b4..d76a4a8 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/ExplorerQueryRepository.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/ExplorerQueryRepository.kt @@ -7,6 +7,7 @@ import com.querydsl.jpa.impl.JPAQueryFactory import kr.co.vividnext.sodalive.can.use.CanUsage import kr.co.vividnext.sodalive.can.use.QUseCan.useCan import kr.co.vividnext.sodalive.common.SodaException +import kr.co.vividnext.sodalive.content.QAudioContent.audioContent import kr.co.vividnext.sodalive.explorer.follower.GetFollowerListDto import kr.co.vividnext.sodalive.explorer.follower.QGetFollowerListDto import kr.co.vividnext.sodalive.explorer.profile.ChannelNotice @@ -364,6 +365,7 @@ class ExplorerQueryRepository( val isPaid = if (it.channelName != null) { val useCan = queryFactory .selectFrom(useCan) + .innerJoin(useCan.member, member) .where( useCan.member.id.eq(member.id) .and(useCan.room.id.eq(it.id!!)) @@ -597,4 +599,15 @@ class ExplorerQueryRepository( .where(channelNotice.member.id.eq(creatorId)) .fetchFirst() } + + fun getContentCount(creatorId: Long): Long? { + return queryFactory + .select(audioContent.id.count()) + .from(audioContent) + .where( + audioContent.isActive.isTrue + .and(audioContent.member.id.eq(creatorId)) + ) + .fetchFirst() + } } diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/ExplorerService.kt b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/ExplorerService.kt index a517775..68d5a9b 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/ExplorerService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/ExplorerService.kt @@ -198,7 +198,7 @@ class ExplorerService( val liveCount = queryRepository.getLiveCount(creatorId) ?: 0 val liveTime = queryRepository.getLiveTime(creatorId) val liveContributorCount = queryRepository.getLiveContributorCount(creatorId) ?: 0 - val contentCount = 0L + val contentCount = queryRepository.getContentCount(creatorId) ?: 0 return GetCreatorProfileResponse( creator = CreatorResponse( From 91d25081c001fa478b952d1ead46f612451e9167 Mon Sep 17 00:00:00 2001 From: Klaus Date: Sun, 20 Aug 2023 02:42:59 +0900 Subject: [PATCH 2/2] =?UTF-8?q?=ED=81=AC=EB=A6=AC=EC=97=90=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=20=EC=B1=84=EB=84=90=20-=20=EC=BD=98=ED=85=90?= =?UTF-8?q?=EC=B8=A0=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vividnext/sodalive/explorer/ExplorerService.kt | 13 +++++++++++++ .../sodalive/explorer/GetCreatorProfileResponse.kt | 3 +++ 2 files changed, 16 insertions(+) diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/ExplorerService.kt b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/ExplorerService.kt index 68d5a9b..57b4036 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/ExplorerService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/ExplorerService.kt @@ -1,6 +1,8 @@ package kr.co.vividnext.sodalive.explorer import kr.co.vividnext.sodalive.common.SodaException +import kr.co.vividnext.sodalive.content.AudioContentService +import kr.co.vividnext.sodalive.content.SortType import kr.co.vividnext.sodalive.explorer.follower.GetFollowerListResponse import kr.co.vividnext.sodalive.explorer.follower.GetFollowerListResponseItem import kr.co.vividnext.sodalive.explorer.profile.ChannelNotice @@ -22,6 +24,7 @@ import org.springframework.transaction.annotation.Transactional @Transactional(readOnly = true) class ExplorerService( private val memberService: MemberService, + private val audioContentService: AudioContentService, private val queryRepository: ExplorerQueryRepository, private val cheersRepository: CreatorCheersRepository, private val noticeRepository: ChannelNoticeRepository, @@ -185,6 +188,15 @@ class ExplorerService( limit = 4 ) + // 오디오 콘텐츠 + val contentList = audioContentService.getAudioContentList( + creatorId = creatorId, + sortType = SortType.NEWEST, + member = member, + offset = 0, + limit = 4 + ).items + // 공지사항 val notice = queryRepository.getNoticeString(creatorId) @@ -221,6 +233,7 @@ class ExplorerService( userDonationRanking = userDonationRanking, similarCreatorList = similarCreatorList, liveRoomList = liveRoomList, + contentList = contentList, notice = notice, cheers = cheers, activitySummary = GetCreatorActivitySummary( diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/GetCreatorProfileResponse.kt b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/GetCreatorProfileResponse.kt index 3a1b5f6..31aef25 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/explorer/GetCreatorProfileResponse.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/explorer/GetCreatorProfileResponse.kt @@ -1,10 +1,13 @@ package kr.co.vividnext.sodalive.explorer +import kr.co.vividnext.sodalive.content.GetAudioContentListItem + data class GetCreatorProfileResponse( val creator: CreatorResponse, val userDonationRanking: List, val similarCreatorList: List, val liveRoomList: List, + val contentList: List, val notice: String, val cheers: GetCheersResponse, val activitySummary: GetCreatorActivitySummary,