Compare commits
2 Commits
248e57b08c
...
91d25081c0
Author | SHA1 | Date |
---|---|---|
|
91d25081c0 | |
|
dde4eb4a98 |
|
@ -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.CanUsage
|
||||||
import kr.co.vividnext.sodalive.can.use.QUseCan.useCan
|
import kr.co.vividnext.sodalive.can.use.QUseCan.useCan
|
||||||
import kr.co.vividnext.sodalive.common.SodaException
|
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.GetFollowerListDto
|
||||||
import kr.co.vividnext.sodalive.explorer.follower.QGetFollowerListDto
|
import kr.co.vividnext.sodalive.explorer.follower.QGetFollowerListDto
|
||||||
import kr.co.vividnext.sodalive.explorer.profile.ChannelNotice
|
import kr.co.vividnext.sodalive.explorer.profile.ChannelNotice
|
||||||
|
@ -364,6 +365,7 @@ class ExplorerQueryRepository(
|
||||||
val isPaid = if (it.channelName != null) {
|
val isPaid = if (it.channelName != null) {
|
||||||
val useCan = queryFactory
|
val useCan = queryFactory
|
||||||
.selectFrom(useCan)
|
.selectFrom(useCan)
|
||||||
|
.innerJoin(useCan.member, member)
|
||||||
.where(
|
.where(
|
||||||
useCan.member.id.eq(member.id)
|
useCan.member.id.eq(member.id)
|
||||||
.and(useCan.room.id.eq(it.id!!))
|
.and(useCan.room.id.eq(it.id!!))
|
||||||
|
@ -597,4 +599,15 @@ class ExplorerQueryRepository(
|
||||||
.where(channelNotice.member.id.eq(creatorId))
|
.where(channelNotice.member.id.eq(creatorId))
|
||||||
.fetchFirst()
|
.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()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package kr.co.vividnext.sodalive.explorer
|
package kr.co.vividnext.sodalive.explorer
|
||||||
|
|
||||||
import kr.co.vividnext.sodalive.common.SodaException
|
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.GetFollowerListResponse
|
||||||
import kr.co.vividnext.sodalive.explorer.follower.GetFollowerListResponseItem
|
import kr.co.vividnext.sodalive.explorer.follower.GetFollowerListResponseItem
|
||||||
import kr.co.vividnext.sodalive.explorer.profile.ChannelNotice
|
import kr.co.vividnext.sodalive.explorer.profile.ChannelNotice
|
||||||
|
@ -22,6 +24,7 @@ import org.springframework.transaction.annotation.Transactional
|
||||||
@Transactional(readOnly = true)
|
@Transactional(readOnly = true)
|
||||||
class ExplorerService(
|
class ExplorerService(
|
||||||
private val memberService: MemberService,
|
private val memberService: MemberService,
|
||||||
|
private val audioContentService: AudioContentService,
|
||||||
private val queryRepository: ExplorerQueryRepository,
|
private val queryRepository: ExplorerQueryRepository,
|
||||||
private val cheersRepository: CreatorCheersRepository,
|
private val cheersRepository: CreatorCheersRepository,
|
||||||
private val noticeRepository: ChannelNoticeRepository,
|
private val noticeRepository: ChannelNoticeRepository,
|
||||||
|
@ -185,6 +188,15 @@ class ExplorerService(
|
||||||
limit = 4
|
limit = 4
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// 오디오 콘텐츠
|
||||||
|
val contentList = audioContentService.getAudioContentList(
|
||||||
|
creatorId = creatorId,
|
||||||
|
sortType = SortType.NEWEST,
|
||||||
|
member = member,
|
||||||
|
offset = 0,
|
||||||
|
limit = 4
|
||||||
|
).items
|
||||||
|
|
||||||
// 공지사항
|
// 공지사항
|
||||||
val notice = queryRepository.getNoticeString(creatorId)
|
val notice = queryRepository.getNoticeString(creatorId)
|
||||||
|
|
||||||
|
@ -198,7 +210,7 @@ class ExplorerService(
|
||||||
val liveCount = queryRepository.getLiveCount(creatorId) ?: 0
|
val liveCount = queryRepository.getLiveCount(creatorId) ?: 0
|
||||||
val liveTime = queryRepository.getLiveTime(creatorId)
|
val liveTime = queryRepository.getLiveTime(creatorId)
|
||||||
val liveContributorCount = queryRepository.getLiveContributorCount(creatorId) ?: 0
|
val liveContributorCount = queryRepository.getLiveContributorCount(creatorId) ?: 0
|
||||||
val contentCount = 0L
|
val contentCount = queryRepository.getContentCount(creatorId) ?: 0
|
||||||
|
|
||||||
return GetCreatorProfileResponse(
|
return GetCreatorProfileResponse(
|
||||||
creator = CreatorResponse(
|
creator = CreatorResponse(
|
||||||
|
@ -221,6 +233,7 @@ class ExplorerService(
|
||||||
userDonationRanking = userDonationRanking,
|
userDonationRanking = userDonationRanking,
|
||||||
similarCreatorList = similarCreatorList,
|
similarCreatorList = similarCreatorList,
|
||||||
liveRoomList = liveRoomList,
|
liveRoomList = liveRoomList,
|
||||||
|
contentList = contentList,
|
||||||
notice = notice,
|
notice = notice,
|
||||||
cheers = cheers,
|
cheers = cheers,
|
||||||
activitySummary = GetCreatorActivitySummary(
|
activitySummary = GetCreatorActivitySummary(
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
package kr.co.vividnext.sodalive.explorer
|
package kr.co.vividnext.sodalive.explorer
|
||||||
|
|
||||||
|
import kr.co.vividnext.sodalive.content.GetAudioContentListItem
|
||||||
|
|
||||||
data class GetCreatorProfileResponse(
|
data class GetCreatorProfileResponse(
|
||||||
val creator: CreatorResponse,
|
val creator: CreatorResponse,
|
||||||
val userDonationRanking: List<UserDonationRankingResponse>,
|
val userDonationRanking: List<UserDonationRankingResponse>,
|
||||||
val similarCreatorList: List<SimilarCreatorResponse>,
|
val similarCreatorList: List<SimilarCreatorResponse>,
|
||||||
val liveRoomList: List<LiveRoomResponse>,
|
val liveRoomList: List<LiveRoomResponse>,
|
||||||
|
val contentList: List<GetAudioContentListItem>,
|
||||||
val notice: String,
|
val notice: String,
|
||||||
val cheers: GetCheersResponse,
|
val cheers: GetCheersResponse,
|
||||||
val activitySummary: GetCreatorActivitySummary,
|
val activitySummary: GetCreatorActivitySummary,
|
||||||
|
|
Loading…
Reference in New Issue