feat(admin-series): 관리자 시리즈 리스트 응답에 publishedDaysOfWeek(리스트)와 isOriginal(Boolean) 추가
This commit is contained in:
@@ -19,6 +19,20 @@ class AdminContentSeriesService(
|
||||
limit = pageable.pageSize.toLong()
|
||||
)
|
||||
|
||||
if (items.isNotEmpty()) {
|
||||
val ids = items.map { it.id }
|
||||
val seriesList = repository.findAllById(ids)
|
||||
val seriesMap = seriesList.associateBy { it.id }
|
||||
|
||||
items.forEach { item ->
|
||||
val s = seriesMap[item.id]
|
||||
if (s != null) {
|
||||
item.publishedDaysOfWeek = s.publishedDaysOfWeek.toList().sortedBy { it.ordinal }
|
||||
item.isOriginal = s.isOriginal
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return GetAdminSeriesListResponse(totalCount, items)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package kr.co.vividnext.sodalive.admin.content.series
|
||||
|
||||
import com.querydsl.core.annotations.QueryProjection
|
||||
import kr.co.vividnext.sodalive.creator.admin.content.series.SeriesPublishedDaysOfWeek
|
||||
|
||||
data class GetAdminSeriesListResponse(
|
||||
val totalCount: Int,
|
||||
@@ -17,7 +18,10 @@ data class GetAdminSeriesListItem @QueryProjection constructor(
|
||||
val numberOfWorks: Long,
|
||||
val state: String,
|
||||
val isAdult: Boolean
|
||||
)
|
||||
) {
|
||||
var publishedDaysOfWeek: List<SeriesPublishedDaysOfWeek> = emptyList()
|
||||
var isOriginal: Boolean = false
|
||||
}
|
||||
|
||||
data class GetAdminSearchSeriesListItem @QueryProjection constructor(
|
||||
val id: Long,
|
||||
|
||||
Reference in New Issue
Block a user