관리자 - 콘텐츠 리스트 #227
|
@ -27,9 +27,16 @@ class AdminContentController(private val service: AdminContentService) {
|
||||||
|
|
||||||
@GetMapping("/search")
|
@GetMapping("/search")
|
||||||
fun searchAudioContent(
|
fun searchAudioContent(
|
||||||
|
@RequestParam(value = "status", required = false) status: ContentReleaseStatus?,
|
||||||
@RequestParam(value = "search_word") searchWord: String,
|
@RequestParam(value = "search_word") searchWord: String,
|
||||||
pageable: Pageable
|
pageable: Pageable
|
||||||
) = ApiResponse.ok(service.searchAudioContent(searchWord, pageable))
|
) = ApiResponse.ok(
|
||||||
|
service.searchAudioContent(
|
||||||
|
status = status ?: ContentReleaseStatus.OPEN,
|
||||||
|
searchWord,
|
||||||
|
pageable
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
@PutMapping
|
@PutMapping
|
||||||
fun modifyAudioContent(
|
fun modifyAudioContent(
|
||||||
|
|
|
@ -43,10 +43,15 @@ class AdminContentService(
|
||||||
return GetAdminContentListResponse(totalCount, audioContentList)
|
return GetAdminContentListResponse(totalCount, audioContentList)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun searchAudioContent(searchWord: String, pageable: Pageable): GetAdminContentListResponse {
|
fun searchAudioContent(
|
||||||
|
status: ContentReleaseStatus,
|
||||||
|
searchWord: String,
|
||||||
|
pageable: Pageable
|
||||||
|
): GetAdminContentListResponse {
|
||||||
if (searchWord.length < 2) throw SodaException("2글자 이상 입력하세요.")
|
if (searchWord.length < 2) throw SodaException("2글자 이상 입력하세요.")
|
||||||
val totalCount = repository.getAudioContentTotalCount(searchWord)
|
val totalCount = repository.getAudioContentTotalCount(searchWord, status = status)
|
||||||
val audioContentAndThemeList = repository.getAudioContentList(
|
val audioContentAndThemeList = repository.getAudioContentList(
|
||||||
|
status = status,
|
||||||
offset = pageable.offset,
|
offset = pageable.offset,
|
||||||
limit = pageable.pageSize.toLong(),
|
limit = pageable.pageSize.toLong(),
|
||||||
searchWord = searchWord
|
searchWord = searchWord
|
||||||
|
|
Loading…
Reference in New Issue