관리자 콘텐츠 리스트

- group_concat 제거
This commit is contained in:
Klaus 2024-03-19 22:16:07 +09:00
parent 7c1c4b907b
commit 69331edabb
3 changed files with 17 additions and 6 deletions

View File

@ -75,7 +75,6 @@ class AdminAudioContentQueryRepositoryImpl(
audioContent.id,
audioContent.title,
audioContent.detail,
Expressions.stringTemplate("GROUP_CONCAT({0})", hashTag.tag),
audioContentCuration.title,
audioContentCuration.id.nullif(0),
audioContent.coverImage.prepend("/").prepend(imageHost),
@ -93,11 +92,8 @@ class AdminAudioContentQueryRepositoryImpl(
)
.from(audioContent)
.leftJoin(audioContent.curation, audioContentCuration)
.leftJoin(audioContent.audioContentHashTags, audioContentHashTag)
.leftJoin(audioContentHashTag.hashTag, hashTag)
.innerJoin(audioContent.theme, audioContentTheme)
.where(where)
.groupBy(audioContent.id)
.offset(offset)
.limit(limit)
.orderBy(audioContent.releaseDate.desc())

View File

@ -30,6 +30,13 @@ class AdminContentService(
val audioContentList = audioContentAndThemeList
.asSequence()
.map {
val tags = repository
.getHashTagList(audioContentId = it.audioContentId)
.joinToString(" ") { tag -> tag }
it.tags = tags
it
}
.map {
it.contentUrl = audioContentCloudFront.generateSignedURL(
resourcePath = it.contentUrl,
@ -54,6 +61,13 @@ class AdminContentService(
val audioContentList = audioContentAndThemeList
.asSequence()
.map {
val tags = repository
.getHashTagList(audioContentId = it.audioContentId)
.joinToString(" ") { tag -> tag }
it.tags = tags
it
}
.map {
it.contentUrl = audioContentCloudFront.generateSignedURL(
resourcePath = it.contentUrl,

View File

@ -11,7 +11,6 @@ data class GetAdminContentListItem @QueryProjection constructor(
val audioContentId: Long,
val title: String,
val detail: String,
var tags: String,
val curationTitle: String?,
val curationId: Long,
var coverImageUrl: String,
@ -25,4 +24,6 @@ data class GetAdminContentListItem @QueryProjection constructor(
val isCommentAvailable: Boolean,
val date: String,
val releaseDate: String?
)
) {
var tags: String = ""
}