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