parent
4eb4c19386
commit
078e601100
|
@ -27,9 +27,16 @@ class AdminContentController(private val service: AdminContentService) {
|
|||
|
||||
@GetMapping("/search")
|
||||
fun searchAudioContent(
|
||||
@RequestParam(value = "status", required = false) status: ContentReleaseStatus?,
|
||||
@RequestParam(value = "search_word") searchWord: String,
|
||||
pageable: Pageable
|
||||
) = ApiResponse.ok(service.searchAudioContent(searchWord, pageable))
|
||||
) = ApiResponse.ok(
|
||||
service.searchAudioContent(
|
||||
status = status ?: ContentReleaseStatus.OPEN,
|
||||
searchWord,
|
||||
pageable
|
||||
)
|
||||
)
|
||||
|
||||
@PutMapping
|
||||
fun modifyAudioContent(
|
||||
|
|
|
@ -43,10 +43,15 @@ class AdminContentService(
|
|||
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글자 이상 입력하세요.")
|
||||
val totalCount = repository.getAudioContentTotalCount(searchWord)
|
||||
val totalCount = repository.getAudioContentTotalCount(searchWord, status = status)
|
||||
val audioContentAndThemeList = repository.getAudioContentList(
|
||||
status = status,
|
||||
offset = pageable.offset,
|
||||
limit = pageable.pageSize.toLong(),
|
||||
searchWord = searchWord
|
||||
|
|
Loading…
Reference in New Issue