관리자 - 콘텐츠 리스트
- 찾기에 content release status 추가
This commit is contained in:
		| @@ -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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user