parent
e76eed7274
commit
db0e526896
|
@ -45,13 +45,21 @@ class CreatorAdminCategoryRepository(private val queryFactory: JPAQueryFactory)
|
|||
}
|
||||
|
||||
fun getContentInCategory(
|
||||
imageHost: String,
|
||||
categoryId: Long,
|
||||
memberId: Long,
|
||||
offset: Long,
|
||||
limit: Long
|
||||
): List<GetContentInCategoryItem> {
|
||||
return queryFactory
|
||||
.select(QGetContentInCategoryItem(audioContent.id, audioContent.title, audioContent.isAdult))
|
||||
.select(
|
||||
QGetContentInCategoryItem(
|
||||
audioContent.id,
|
||||
audioContent.title,
|
||||
audioContent.isAdult,
|
||||
audioContent.coverImage.prepend("/").prepend(imageHost)
|
||||
)
|
||||
)
|
||||
.from(audioContent)
|
||||
.leftJoin(categoryContent)
|
||||
.on(audioContent.id.eq(categoryContent.content.id).and(categoryContent.isActive.isTrue))
|
||||
|
|
|
@ -1,9 +1,15 @@
|
|||
package kr.co.vividnext.sodalive.creator.admin.content.category
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value
|
||||
import org.springframework.stereotype.Service
|
||||
|
||||
@Service
|
||||
class CreatorAdminCategoryService(private val repository: CreatorAdminCategoryRepository) {
|
||||
class CreatorAdminCategoryService(
|
||||
private val repository: CreatorAdminCategoryRepository,
|
||||
|
||||
@Value("\${cloud.aws.cloud-front.host}")
|
||||
private val imageHost: String
|
||||
) {
|
||||
fun searchContentNotInCategory(
|
||||
categoryId: Long,
|
||||
searchWord: String,
|
||||
|
@ -24,6 +30,7 @@ class CreatorAdminCategoryService(private val repository: CreatorAdminCategoryRe
|
|||
): GetContentInCategoryResponse {
|
||||
val totalCount = repository.getContentInCategoryTotalCount(categoryId, memberId)
|
||||
val items = repository.getContentInCategory(
|
||||
imageHost,
|
||||
categoryId,
|
||||
memberId,
|
||||
offset,
|
||||
|
|
|
@ -10,5 +10,6 @@ data class GetContentInCategoryResponse(
|
|||
data class GetContentInCategoryItem @QueryProjection constructor(
|
||||
val contentId: Long,
|
||||
val title: String,
|
||||
val isAdult: Boolean
|
||||
val isAdult: Boolean,
|
||||
val image: String
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue