크리에이터 관리자 콘텐츠 리스트

- 카테고리 조회 추가
This commit is contained in:
2024-02-06 16:11:57 +09:00
parent 738d7fba2a
commit 7bafb6ba0d
5 changed files with 38 additions and 12 deletions

View File

@@ -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

View File

@@ -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(