크리에이터 관리자 콘텐츠 리스트
- 카테고리 조회 추가
This commit is contained in:
@@ -43,7 +43,7 @@ interface AudioContentQueryRepository {
|
||||
limit: Long = 10
|
||||
): List<GetAudioContentListItem>
|
||||
|
||||
fun findTotalCountByCreatorId(creatorId: Long, isAdult: Boolean = false): Int
|
||||
fun findTotalCountByCreatorId(creatorId: Long, isAdult: Boolean = false, categoryId: Long = 0): Int
|
||||
fun getCreatorOtherContentList(
|
||||
cloudfrontHost: String,
|
||||
contentId: Long,
|
||||
@@ -200,7 +200,8 @@ class AudioContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory)
|
||||
|
||||
override fun findTotalCountByCreatorId(
|
||||
creatorId: Long,
|
||||
isAdult: Boolean
|
||||
isAdult: Boolean,
|
||||
categoryId: Long
|
||||
): Int {
|
||||
var where = audioContent.member.id.eq(creatorId)
|
||||
.and(
|
||||
@@ -212,8 +213,15 @@ class AudioContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory)
|
||||
where = where.and(audioContent.isAdult.isFalse)
|
||||
}
|
||||
|
||||
if (categoryId > 0) {
|
||||
where = where.and(categoryContent.category.id.eq(categoryId))
|
||||
}
|
||||
|
||||
return queryFactory
|
||||
.selectFrom(audioContent)
|
||||
.select(audioContent.id)
|
||||
.from(audioContent)
|
||||
.leftJoin(categoryContent)
|
||||
.on(audioContent.id.eq(categoryContent.content.id).and(categoryContent.isActive.ne(false)))
|
||||
.where(where)
|
||||
.fetch()
|
||||
.size
|
||||
|
@@ -630,7 +630,8 @@ class AudioContentService(
|
||||
): GetAudioContentListResponse {
|
||||
val totalCount = repository.findTotalCountByCreatorId(
|
||||
creatorId = creatorId,
|
||||
isAdult = member.auth != null
|
||||
isAdult = member.auth != null,
|
||||
categoryId = categoryId
|
||||
)
|
||||
|
||||
val audioContentList = repository.findByCreatorId(
|
||||
|
Reference in New Issue
Block a user