Compare commits
No commits in common. "229e7a8ccc0f3740dab1ad7282244854ab6d016d" and "3c616474ff34e7661abca1defbf8d72128ebe0d7" have entirely different histories.
229e7a8ccc
...
3c616474ff
|
@ -106,8 +106,6 @@ class AudioContentController(private val service: AudioContentService) {
|
|||
@RequestParam("creator-id") creatorId: Long,
|
||||
@RequestParam("sort-type", required = false) sortType: SortType? = SortType.NEWEST,
|
||||
@RequestParam("category-id", required = false) categoryId: Long? = 0,
|
||||
@RequestParam("isAdultContentVisible", required = false) isAdultContentVisible: Boolean? = null,
|
||||
@RequestParam("contentType", required = false) contentType: ContentType? = null,
|
||||
@AuthenticationPrincipal(expression = "#this == 'anonymousUser' ? null : member") member: Member?,
|
||||
pageable: Pageable
|
||||
) = run {
|
||||
|
@ -118,8 +116,6 @@ class AudioContentController(private val service: AudioContentService) {
|
|||
creatorId = creatorId,
|
||||
sortType = sortType ?: SortType.NEWEST,
|
||||
categoryId = categoryId ?: 0,
|
||||
isAdultContentVisible = isAdultContentVisible ?: true,
|
||||
contentType = contentType ?: ContentType.ALL,
|
||||
member = member,
|
||||
offset = pageable.offset,
|
||||
limit = pageable.pageSize.toLong()
|
||||
|
|
|
@ -41,20 +41,13 @@ interface AudioContentQueryRepository {
|
|||
creatorId: Long,
|
||||
coverImageHost: String,
|
||||
isAdult: Boolean = false,
|
||||
contentType: ContentType = ContentType.ALL,
|
||||
sortType: SortType = SortType.NEWEST,
|
||||
categoryId: Long = 0,
|
||||
offset: Long = 0,
|
||||
limit: Long = 10
|
||||
): List<GetAudioContentListItem>
|
||||
|
||||
fun findTotalCountByCreatorId(
|
||||
creatorId: Long,
|
||||
isAdult: Boolean = false,
|
||||
categoryId: Long = 0,
|
||||
contentType: ContentType = ContentType.ALL
|
||||
): Int
|
||||
|
||||
fun findTotalCountByCreatorId(creatorId: Long, isAdult: Boolean = false, categoryId: Long = 0): Int
|
||||
fun getCreatorOtherContentList(
|
||||
cloudfrontHost: String,
|
||||
contentId: Long,
|
||||
|
@ -196,7 +189,6 @@ class AudioContentQueryRepositoryImpl(
|
|||
creatorId: Long,
|
||||
coverImageHost: String,
|
||||
isAdult: Boolean,
|
||||
contentType: ContentType,
|
||||
sortType: SortType,
|
||||
categoryId: Long,
|
||||
offset: Long,
|
||||
|
@ -217,20 +209,6 @@ class AudioContentQueryRepositoryImpl(
|
|||
|
||||
if (!isAdult) {
|
||||
where = where.and(audioContent.isAdult.isFalse)
|
||||
} else {
|
||||
if (contentType != ContentType.ALL) {
|
||||
where = where.and(
|
||||
audioContent.member.isNull.or(
|
||||
audioContent.member.auth.gender.eq(
|
||||
if (contentType == ContentType.MALE) {
|
||||
0
|
||||
} else {
|
||||
1
|
||||
}
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
var select = queryFactory
|
||||
|
@ -295,8 +273,7 @@ class AudioContentQueryRepositoryImpl(
|
|||
override fun findTotalCountByCreatorId(
|
||||
creatorId: Long,
|
||||
isAdult: Boolean,
|
||||
categoryId: Long,
|
||||
contentType: ContentType
|
||||
categoryId: Long
|
||||
): Int {
|
||||
var where = audioContent.member.id.eq(creatorId)
|
||||
.and(
|
||||
|
@ -307,20 +284,6 @@ class AudioContentQueryRepositoryImpl(
|
|||
|
||||
if (!isAdult) {
|
||||
where = where.and(audioContent.isAdult.isFalse)
|
||||
} else {
|
||||
if (contentType != ContentType.ALL) {
|
||||
where = where.and(
|
||||
audioContent.member.isNull.or(
|
||||
audioContent.member.auth.gender.eq(
|
||||
if (contentType == ContentType.MALE) {
|
||||
0
|
||||
} else {
|
||||
1
|
||||
}
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
var select = queryFactory
|
||||
|
|
|
@ -675,25 +675,19 @@ class AudioContentService(
|
|||
sortType: SortType,
|
||||
member: Member,
|
||||
categoryId: Long = 0,
|
||||
isAdultContentVisible: Boolean,
|
||||
contentType: ContentType,
|
||||
offset: Long,
|
||||
limit: Long
|
||||
): GetAudioContentListResponse {
|
||||
val isAdult = member.auth != null && isAdultContentVisible
|
||||
|
||||
val totalCount = repository.findTotalCountByCreatorId(
|
||||
creatorId = creatorId,
|
||||
isAdult = isAdult,
|
||||
categoryId = categoryId,
|
||||
contentType = contentType
|
||||
isAdult = member.auth != null,
|
||||
categoryId = categoryId
|
||||
)
|
||||
|
||||
val audioContentList = repository.findByCreatorId(
|
||||
creatorId = creatorId,
|
||||
coverImageHost = coverImageHost,
|
||||
isAdult = isAdult,
|
||||
contentType = contentType,
|
||||
isAdult = member.auth != null,
|
||||
sortType = sortType,
|
||||
categoryId = categoryId,
|
||||
offset = offset,
|
||||
|
|
|
@ -20,8 +20,6 @@ class ContentSeriesController(private val service: ContentSeriesService) {
|
|||
fun getSeriesList(
|
||||
@RequestParam creatorId: Long,
|
||||
@RequestParam("sortType", required = false) sortType: SeriesSortType? = SeriesSortType.NEWEST,
|
||||
@RequestParam("isAdultContentVisible", required = false) isAdultContentVisible: Boolean? = null,
|
||||
@RequestParam("contentType", required = false) contentType: ContentType? = null,
|
||||
@AuthenticationPrincipal(expression = "#this == 'anonymousUser' ? null : member") member: Member?,
|
||||
pageable: Pageable
|
||||
) = run {
|
||||
|
@ -31,8 +29,6 @@ class ContentSeriesController(private val service: ContentSeriesService) {
|
|||
service.getSeriesList(
|
||||
creatorId = creatorId,
|
||||
sortType = sortType ?: SeriesSortType.NEWEST,
|
||||
isAdultContentVisible = isAdultContentVisible ?: true,
|
||||
contentType = contentType ?: ContentType.ALL,
|
||||
member = member,
|
||||
offset = pageable.offset,
|
||||
limit = pageable.pageSize.toLong()
|
||||
|
@ -43,19 +39,12 @@ class ContentSeriesController(private val service: ContentSeriesService) {
|
|||
@GetMapping("/{id}")
|
||||
fun getSeriesDetail(
|
||||
@PathVariable id: Long,
|
||||
@RequestParam("isAdultContentVisible", required = false) isAdultContentVisible: Boolean? = null,
|
||||
@RequestParam("contentType", required = false) contentType: ContentType? = null,
|
||||
@AuthenticationPrincipal(expression = "#this == 'anonymousUser' ? null : member") member: Member?
|
||||
) = run {
|
||||
if (member == null) throw SodaException("로그인 정보를 확인해주세요.")
|
||||
|
||||
ApiResponse.ok(
|
||||
service.getSeriesDetail(
|
||||
seriesId = id,
|
||||
isAdultContentVisible = isAdultContentVisible ?: true,
|
||||
contentType = contentType ?: ContentType.ALL,
|
||||
member = member
|
||||
)
|
||||
service.getSeriesDetail(seriesId = id, member = member)
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -63,8 +52,6 @@ class ContentSeriesController(private val service: ContentSeriesService) {
|
|||
fun getSeriesContentList(
|
||||
@PathVariable id: Long,
|
||||
@RequestParam("sortType", required = false) sortType: SeriesSortType? = SeriesSortType.NEWEST,
|
||||
@RequestParam("isAdultContentVisible", required = false) isAdultContentVisible: Boolean? = null,
|
||||
@RequestParam("contentType", required = false) contentType: ContentType? = null,
|
||||
@AuthenticationPrincipal(expression = "#this == 'anonymousUser' ? null : member") member: Member?,
|
||||
pageable: Pageable
|
||||
) = run {
|
||||
|
@ -73,8 +60,6 @@ class ContentSeriesController(private val service: ContentSeriesService) {
|
|||
ApiResponse.ok(
|
||||
service.getSeriesContentList(
|
||||
seriesId = id,
|
||||
isAdultContentVisible = isAdultContentVisible ?: true,
|
||||
contentType = contentType ?: ContentType.ALL,
|
||||
member = member,
|
||||
sortType = sortType ?: SeriesSortType.NEWEST,
|
||||
offset = pageable.offset,
|
||||
|
|
|
@ -22,17 +22,16 @@ import org.springframework.data.jpa.repository.JpaRepository
|
|||
interface ContentSeriesRepository : JpaRepository<Series, Long>, ContentSeriesQueryRepository
|
||||
|
||||
interface ContentSeriesQueryRepository {
|
||||
fun getSeriesTotalCount(creatorId: Long, isAuth: Boolean, contentType: ContentType): Int
|
||||
fun getSeriesTotalCount(creatorId: Long, isAuth: Boolean): Int
|
||||
fun getSeriesList(
|
||||
imageHost: String,
|
||||
creatorId: Long,
|
||||
isAuth: Boolean,
|
||||
contentType: ContentType,
|
||||
offset: Long,
|
||||
limit: Long
|
||||
): List<Series>
|
||||
|
||||
fun getSeriesDetail(seriesId: Long, isAuth: Boolean, contentType: ContentType): Series?
|
||||
fun getSeriesDetail(seriesId: Long, isAuth: Boolean): Series?
|
||||
fun getKeywordList(seriesId: Long): List<String>
|
||||
fun getSeriesContentMinMaxPrice(seriesId: Long): GetSeriesContentMinMaxPriceResponse
|
||||
fun getRecommendSeriesList(isAuth: Boolean, contentType: ContentType, limit: Long): List<Series>
|
||||
|
@ -52,32 +51,17 @@ interface ContentSeriesQueryRepository {
|
|||
class ContentSeriesQueryRepositoryImpl(
|
||||
private val queryFactory: JPAQueryFactory
|
||||
) : ContentSeriesQueryRepository {
|
||||
override fun getSeriesTotalCount(creatorId: Long, isAuth: Boolean, contentType: ContentType): Int {
|
||||
override fun getSeriesTotalCount(creatorId: Long, isAuth: Boolean): Int {
|
||||
var where = series.member.id.eq(creatorId)
|
||||
.and(series.isActive.isTrue)
|
||||
|
||||
if (!isAuth) {
|
||||
where = where.and(series.isAdult.isFalse)
|
||||
} else {
|
||||
if (contentType != ContentType.ALL) {
|
||||
where = where.and(
|
||||
series.member.isNull.or(
|
||||
series.member.auth.gender.eq(
|
||||
if (contentType == ContentType.MALE) {
|
||||
0
|
||||
} else {
|
||||
1
|
||||
}
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return queryFactory
|
||||
.select(series.id)
|
||||
.from(series)
|
||||
.innerJoin(series.member, member)
|
||||
.where(where)
|
||||
.fetch()
|
||||
.size
|
||||
|
@ -87,7 +71,6 @@ class ContentSeriesQueryRepositoryImpl(
|
|||
imageHost: String,
|
||||
creatorId: Long,
|
||||
isAuth: Boolean,
|
||||
contentType: ContentType,
|
||||
offset: Long,
|
||||
limit: Long
|
||||
): List<Series> {
|
||||
|
@ -96,25 +79,10 @@ class ContentSeriesQueryRepositoryImpl(
|
|||
|
||||
if (!isAuth) {
|
||||
where = where.and(series.isAdult.isFalse)
|
||||
} else {
|
||||
if (contentType != ContentType.ALL) {
|
||||
where = where.and(
|
||||
series.member.isNull.or(
|
||||
series.member.auth.gender.eq(
|
||||
if (contentType == ContentType.MALE) {
|
||||
0
|
||||
} else {
|
||||
1
|
||||
}
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return queryFactory
|
||||
.selectFrom(series)
|
||||
.innerJoin(series.member, member)
|
||||
.where(where)
|
||||
.orderBy(series.orders.asc(), series.createdAt.asc())
|
||||
.offset(offset)
|
||||
|
@ -122,31 +90,16 @@ class ContentSeriesQueryRepositoryImpl(
|
|||
.fetch()
|
||||
}
|
||||
|
||||
override fun getSeriesDetail(seriesId: Long, isAuth: Boolean, contentType: ContentType): Series? {
|
||||
override fun getSeriesDetail(seriesId: Long, isAuth: Boolean): Series? {
|
||||
var where = series.id.eq(seriesId)
|
||||
.and(series.isActive.isTrue)
|
||||
|
||||
if (!isAuth) {
|
||||
where = where.and(series.isAdult.isFalse)
|
||||
} else {
|
||||
if (contentType != ContentType.ALL) {
|
||||
where = where.and(
|
||||
series.member.isNull.or(
|
||||
series.member.auth.gender.eq(
|
||||
if (contentType == ContentType.MALE) {
|
||||
0
|
||||
} else {
|
||||
1
|
||||
}
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return queryFactory
|
||||
.selectFrom(series)
|
||||
.innerJoin(series.member, member)
|
||||
.where(where)
|
||||
.fetchFirst()
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ class ContentSeriesService(
|
|||
limit: Long = 20
|
||||
): List<GetSeriesListResponse.SeriesListItem> {
|
||||
val originalAudioDramaList = repository.getOriginalAudioDramaList(memberId, isAdult, contentType, offset, limit)
|
||||
return seriesToSeriesListItem(originalAudioDramaList, isAdult, contentType)
|
||||
return seriesToSeriesListItem(originalAudioDramaList, isAdult)
|
||||
}
|
||||
|
||||
fun getGenreList(memberId: Long, isAdult: Boolean, contentType: ContentType): List<GetSeriesGenreListResponse> {
|
||||
|
@ -51,43 +51,29 @@ class ContentSeriesService(
|
|||
|
||||
fun getSeriesList(
|
||||
creatorId: Long,
|
||||
isAdultContentVisible: Boolean,
|
||||
contentType: ContentType,
|
||||
member: Member,
|
||||
sortType: SeriesSortType = SeriesSortType.NEWEST,
|
||||
offset: Long = 0,
|
||||
limit: Long = 10
|
||||
): GetSeriesListResponse {
|
||||
val isAuth = member.auth != null && isAdultContentVisible
|
||||
|
||||
val totalCount = repository.getSeriesTotalCount(
|
||||
creatorId = creatorId,
|
||||
isAuth = isAuth,
|
||||
contentType = contentType
|
||||
)
|
||||
val totalCount = repository.getSeriesTotalCount(creatorId = creatorId, isAuth = member.auth != null)
|
||||
val rawItems = repository.getSeriesList(
|
||||
imageHost = coverImageHost,
|
||||
creatorId = creatorId,
|
||||
isAuth = isAuth,
|
||||
contentType = contentType,
|
||||
isAuth = member.auth != null,
|
||||
offset = offset,
|
||||
limit = limit
|
||||
).filter { !blockMemberRepository.isBlocked(blockedMemberId = member.id!!, memberId = it.member!!.id!!) }
|
||||
|
||||
val items = seriesToSeriesListItem(seriesList = rawItems, isAdult = isAuth, contentType = contentType)
|
||||
val items = seriesToSeriesListItem(seriesList = rawItems, isAdult = member.auth != null)
|
||||
|
||||
return GetSeriesListResponse(totalCount, items)
|
||||
}
|
||||
|
||||
fun getSeriesDetail(
|
||||
seriesId: Long,
|
||||
isAdultContentVisible: Boolean,
|
||||
contentType: ContentType,
|
||||
member: Member
|
||||
): GetSeriesDetailResponse {
|
||||
fun getSeriesDetail(seriesId: Long, member: Member): GetSeriesDetailResponse {
|
||||
val series = repository.getSeriesDetail(
|
||||
seriesId = seriesId,
|
||||
isAuth = member.auth != null && isAdultContentVisible,
|
||||
contentType = contentType
|
||||
isAuth = member.auth != null
|
||||
) ?: throw SodaException("잘못된 시리즈 입니다.\n다시 시도해 주세요")
|
||||
|
||||
val isBlocked = blockMemberRepository.isBlocked(blockedMemberId = member.id!!, memberId = series.member!!.id!!)
|
||||
|
@ -111,8 +97,6 @@ class ContentSeriesService(
|
|||
|
||||
val seriesContentList = getSeriesContentList(
|
||||
seriesId = seriesId,
|
||||
isAdultContentVisible = isAdultContentVisible,
|
||||
contentType = contentType,
|
||||
member = member,
|
||||
sortType = SeriesSortType.NEWEST,
|
||||
offset = 0,
|
||||
|
@ -155,20 +139,17 @@ class ContentSeriesService(
|
|||
|
||||
fun getSeriesContentList(
|
||||
seriesId: Long,
|
||||
isAdultContentVisible: Boolean,
|
||||
contentType: ContentType,
|
||||
member: Member,
|
||||
sortType: SeriesSortType,
|
||||
offset: Long,
|
||||
limit: Long
|
||||
): GetSeriesContentListResponse {
|
||||
val isAdult = member.auth != null && isAdultContentVisible
|
||||
val isAdult = member.auth != null
|
||||
|
||||
val totalCount = seriesContentRepository.getContentCount(seriesId, isAdult = isAdult, contentType = contentType)
|
||||
val totalCount = seriesContentRepository.getContentCount(seriesId, isAdult = isAdult)
|
||||
val contentList = seriesContentRepository.getContentList(
|
||||
seriesId = seriesId,
|
||||
isAdult = isAdult,
|
||||
contentType = contentType,
|
||||
imageHost = coverImageHost,
|
||||
sortType = sortType,
|
||||
offset = offset,
|
||||
|
@ -199,14 +180,13 @@ class ContentSeriesService(
|
|||
contentType: ContentType,
|
||||
member: Member
|
||||
): List<GetSeriesListResponse.SeriesListItem> {
|
||||
val isAuth = member.auth != null && isAdultContentVisible
|
||||
val seriesList = repository.getRecommendSeriesList(
|
||||
isAuth = isAuth,
|
||||
isAuth = member.auth != null && isAdultContentVisible,
|
||||
contentType = contentType,
|
||||
limit = 10
|
||||
).filter { !blockMemberRepository.isBlocked(blockedMemberId = member.id!!, memberId = it.member!!.id!!) }
|
||||
|
||||
return seriesToSeriesListItem(seriesList = seriesList, isAdult = isAuth, contentType = contentType)
|
||||
return seriesToSeriesListItem(seriesList = seriesList, isAdult = member.auth != null)
|
||||
}
|
||||
|
||||
fun fetchSeriesByCurationId(
|
||||
|
@ -221,13 +201,12 @@ class ContentSeriesService(
|
|||
isAdult = isAdult,
|
||||
contentType = contentType
|
||||
)
|
||||
return seriesToSeriesListItem(seriesList, isAdult, contentType)
|
||||
return seriesToSeriesListItem(seriesList, isAdult)
|
||||
}
|
||||
|
||||
private fun seriesToSeriesListItem(
|
||||
seriesList: List<Series>,
|
||||
isAdult: Boolean,
|
||||
contentType: ContentType
|
||||
isAdult: Boolean
|
||||
): List<GetSeriesListResponse.SeriesListItem> {
|
||||
return seriesList
|
||||
.map {
|
||||
|
@ -247,8 +226,7 @@ class ContentSeriesService(
|
|||
.map {
|
||||
it.numberOfContent = seriesContentRepository.getContentCount(
|
||||
seriesId = it.seriesId,
|
||||
isAdult = isAdult,
|
||||
contentType = contentType
|
||||
isAdult = isAdult
|
||||
)
|
||||
|
||||
it
|
||||
|
|
|
@ -2,24 +2,21 @@ package kr.co.vividnext.sodalive.content.series.content
|
|||
|
||||
import com.querydsl.core.types.dsl.Expressions
|
||||
import com.querydsl.jpa.impl.JPAQueryFactory
|
||||
import kr.co.vividnext.sodalive.content.ContentType
|
||||
import kr.co.vividnext.sodalive.content.QAudioContent.audioContent
|
||||
import kr.co.vividnext.sodalive.creator.admin.content.series.QSeries.series
|
||||
import kr.co.vividnext.sodalive.creator.admin.content.series.QSeriesContent.seriesContent
|
||||
import kr.co.vividnext.sodalive.creator.admin.content.series.SeriesContent
|
||||
import kr.co.vividnext.sodalive.creator.admin.content.series.SeriesSortType
|
||||
import kr.co.vividnext.sodalive.member.QMember.member
|
||||
import org.springframework.data.jpa.repository.JpaRepository
|
||||
import java.time.LocalDateTime
|
||||
|
||||
interface ContentSeriesContentRepository : JpaRepository<SeriesContent, Long>, ContentSeriesContentQueryRepository
|
||||
|
||||
interface ContentSeriesContentQueryRepository {
|
||||
fun getContentCount(seriesId: Long, isAdult: Boolean, contentType: ContentType): Int
|
||||
fun getContentCount(seriesId: Long, isAdult: Boolean): Int
|
||||
fun getContentList(
|
||||
seriesId: Long,
|
||||
isAdult: Boolean,
|
||||
contentType: ContentType,
|
||||
imageHost: String,
|
||||
sortType: SeriesSortType,
|
||||
offset: Long,
|
||||
|
@ -32,33 +29,18 @@ interface ContentSeriesContentQueryRepository {
|
|||
class ContentSeriesContentQueryRepositoryImpl(
|
||||
private val queryFactory: JPAQueryFactory
|
||||
) : ContentSeriesContentQueryRepository {
|
||||
override fun getContentCount(seriesId: Long, isAdult: Boolean, contentType: ContentType): Int {
|
||||
override fun getContentCount(seriesId: Long, isAdult: Boolean): Int {
|
||||
var where = seriesContent.series.id.eq(seriesId)
|
||||
.and(seriesContent.content.isActive.isTrue)
|
||||
|
||||
if (!isAdult) {
|
||||
where = where.and(seriesContent.content.isAdult.isFalse)
|
||||
} else {
|
||||
if (contentType != ContentType.ALL) {
|
||||
where = where.and(
|
||||
series.member.isNull.or(
|
||||
series.member.auth.gender.eq(
|
||||
if (contentType == ContentType.MALE) {
|
||||
0
|
||||
} else {
|
||||
1
|
||||
}
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return queryFactory
|
||||
.select(seriesContent.id)
|
||||
.from(seriesContent)
|
||||
.innerJoin(seriesContent.series, series)
|
||||
.innerJoin(series.member, member)
|
||||
.innerJoin(seriesContent.content, audioContent)
|
||||
.where(where)
|
||||
.fetch()
|
||||
|
@ -68,7 +50,6 @@ class ContentSeriesContentQueryRepositoryImpl(
|
|||
override fun getContentList(
|
||||
seriesId: Long,
|
||||
isAdult: Boolean,
|
||||
contentType: ContentType,
|
||||
imageHost: String,
|
||||
sortType: SeriesSortType,
|
||||
offset: Long,
|
||||
|
@ -86,20 +67,6 @@ class ContentSeriesContentQueryRepositoryImpl(
|
|||
|
||||
if (!isAdult) {
|
||||
where = where.and(audioContent.isAdult.isFalse)
|
||||
} else {
|
||||
if (contentType != ContentType.ALL) {
|
||||
where = where.and(
|
||||
series.member.isNull.or(
|
||||
series.member.auth.gender.eq(
|
||||
if (contentType == ContentType.MALE) {
|
||||
0
|
||||
} else {
|
||||
1
|
||||
}
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
val formattedDate = Expressions.stringTemplate(
|
||||
|
@ -129,7 +96,6 @@ class ContentSeriesContentQueryRepositoryImpl(
|
|||
)
|
||||
.from(seriesContent)
|
||||
.innerJoin(seriesContent.series, series)
|
||||
.innerJoin(series.member, member)
|
||||
.innerJoin(seriesContent.content, audioContent)
|
||||
.where(where)
|
||||
.orderBy(*sortOrders.toTypedArray())
|
||||
|
|
|
@ -52,18 +52,10 @@ class ExplorerController(private val service: ExplorerService) {
|
|||
fun getCreatorProfile(
|
||||
@PathVariable("id") creatorId: Long,
|
||||
@RequestParam timezone: String,
|
||||
@RequestParam("isAdultContentVisible", required = false) isAdultContentVisible: Boolean? = null,
|
||||
@AuthenticationPrincipal(expression = "#this == 'anonymousUser' ? null : member") member: Member?
|
||||
) = run {
|
||||
if (member == null) throw SodaException("로그인 정보를 확인해주세요.")
|
||||
ApiResponse.ok(
|
||||
service.getCreatorProfile(
|
||||
creatorId = creatorId,
|
||||
timezone = timezone,
|
||||
isAdultContentVisible = isAdultContentVisible ?: true,
|
||||
member = member
|
||||
)
|
||||
)
|
||||
ApiResponse.ok(service.getCreatorProfile(creatorId, timezone, member))
|
||||
}
|
||||
|
||||
@GetMapping("/profile/{id}/donation-rank")
|
||||
|
|
|
@ -2,7 +2,6 @@ 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.ContentType
|
||||
import kr.co.vividnext.sodalive.content.SortType
|
||||
import kr.co.vividnext.sodalive.content.series.ContentSeriesService
|
||||
import kr.co.vividnext.sodalive.explorer.follower.GetFollowerListResponse
|
||||
|
@ -165,12 +164,7 @@ class ExplorerService(
|
|||
.toList()
|
||||
}
|
||||
|
||||
fun getCreatorProfile(
|
||||
creatorId: Long,
|
||||
timezone: String,
|
||||
isAdultContentVisible: Boolean,
|
||||
member: Member
|
||||
): GetCreatorProfileResponse {
|
||||
fun getCreatorProfile(creatorId: Long, timezone: String, member: Member): GetCreatorProfileResponse {
|
||||
// 크리에이터(유저) 정보
|
||||
val creatorAccount = queryRepository.getMember(creatorId) ?: throw SodaException("없는 사용자 입니다.")
|
||||
|
||||
|
@ -221,8 +215,6 @@ class ExplorerService(
|
|||
audioContentService.getAudioContentList(
|
||||
creatorId = creatorId,
|
||||
sortType = SortType.NEWEST,
|
||||
isAdultContentVisible = isAdultContentVisible,
|
||||
contentType = ContentType.ALL,
|
||||
member = member,
|
||||
offset = 0,
|
||||
limit = 3
|
||||
|
@ -276,12 +268,7 @@ class ExplorerService(
|
|||
|
||||
val seriesList = if (isCreator) {
|
||||
seriesService
|
||||
.getSeriesList(
|
||||
creatorId = creatorId,
|
||||
isAdultContentVisible = isAdultContentVisible,
|
||||
contentType = ContentType.ALL,
|
||||
member = member
|
||||
)
|
||||
.getSeriesList(creatorId = creatorId, member = member)
|
||||
.items
|
||||
} else {
|
||||
listOf()
|
||||
|
|
|
@ -91,7 +91,7 @@ class RankingService(
|
|||
loopCount++
|
||||
} while (seriesList.size < 5 && loopCount < 5)
|
||||
|
||||
return seriesToSeriesListItem(seriesList = seriesList, isAdult = isAdult, contentType = contentType)
|
||||
return seriesToSeriesListItem(seriesList = seriesList, isAdult = isAdult)
|
||||
}
|
||||
|
||||
fun getSeriesAllRankingByGenre(
|
||||
|
@ -106,7 +106,7 @@ class RankingService(
|
|||
contentType = contentType,
|
||||
genreId = genreId
|
||||
)
|
||||
return seriesToSeriesListItem(seriesList = seriesList, isAdult = isAdult, contentType = contentType)
|
||||
return seriesToSeriesListItem(seriesList = seriesList, isAdult = isAdult)
|
||||
}
|
||||
|
||||
fun getCompleteSeriesRankingTotalCount(
|
||||
|
@ -139,13 +139,12 @@ class RankingService(
|
|||
offset = offset,
|
||||
limit = limit
|
||||
)
|
||||
return seriesToSeriesListItem(seriesList = seriesList, isAdult = isAdult, contentType = contentType)
|
||||
return seriesToSeriesListItem(seriesList = seriesList, isAdult = isAdult)
|
||||
}
|
||||
|
||||
private fun seriesToSeriesListItem(
|
||||
seriesList: List<Series>,
|
||||
isAdult: Boolean,
|
||||
contentType: ContentType
|
||||
isAdult: Boolean
|
||||
): List<GetSeriesListResponse.SeriesListItem> {
|
||||
return seriesList
|
||||
.map {
|
||||
|
@ -165,8 +164,7 @@ class RankingService(
|
|||
.map {
|
||||
it.numberOfContent = seriesContentRepository.getContentCount(
|
||||
seriesId = it.seriesId,
|
||||
isAdult = isAdult,
|
||||
contentType = contentType
|
||||
isAdult = isAdult
|
||||
)
|
||||
|
||||
it
|
||||
|
@ -256,7 +254,7 @@ class RankingService(
|
|||
isAdult = isAdult,
|
||||
contentType = contentType
|
||||
)
|
||||
return seriesToSeriesListItem(seriesList, isAdult, contentType = contentType)
|
||||
return seriesToSeriesListItem(seriesList, isAdult)
|
||||
}
|
||||
|
||||
fun fetchFreeContentByCreatorIdTop4(
|
||||
|
|
Loading…
Reference in New Issue