Compare commits
No commits in common. "078e6011006e2cf4a53454f1cd8d6c13cd21a90c" and "656fd9a1fa6515d3d85bf41c945a5a932f069d2d" have entirely different histories.
078e601100
...
656fd9a1fa
|
@ -27,16 +27,9 @@ 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(
|
) = ApiResponse.ok(service.searchAudioContent(searchWord, pageable))
|
||||||
service.searchAudioContent(
|
|
||||||
status = status ?: ContentReleaseStatus.OPEN,
|
|
||||||
searchWord,
|
|
||||||
pageable
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
@PutMapping
|
@PutMapping
|
||||||
fun modifyAudioContent(
|
fun modifyAudioContent(
|
||||||
|
|
|
@ -17,7 +17,7 @@ class AdminContentService(
|
||||||
private val curationRepository: AdminContentCurationRepository
|
private val curationRepository: AdminContentCurationRepository
|
||||||
) {
|
) {
|
||||||
fun getAudioContentList(status: ContentReleaseStatus, pageable: Pageable): GetAdminContentListResponse {
|
fun getAudioContentList(status: ContentReleaseStatus, pageable: Pageable): GetAdminContentListResponse {
|
||||||
val totalCount = repository.getAudioContentTotalCount(status = status)
|
val totalCount = repository.getAudioContentTotalCount()
|
||||||
val audioContentAndThemeList = repository.getAudioContentList(
|
val audioContentAndThemeList = repository.getAudioContentList(
|
||||||
status = status,
|
status = status,
|
||||||
offset = pageable.offset,
|
offset = pageable.offset,
|
||||||
|
@ -43,15 +43,10 @@ class AdminContentService(
|
||||||
return GetAdminContentListResponse(totalCount, audioContentList)
|
return GetAdminContentListResponse(totalCount, audioContentList)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun searchAudioContent(
|
fun searchAudioContent(searchWord: String, pageable: Pageable): GetAdminContentListResponse {
|
||||||
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, status = status)
|
val totalCount = repository.getAudioContentTotalCount(searchWord)
|
||||||
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