diff --git a/src/main/kotlin/controller/api/AudioApiController.kt b/src/main/kotlin/controller/api/AudioApiController.kt index 46b1817..1918015 100644 --- a/src/main/kotlin/controller/api/AudioApiController.kt +++ b/src/main/kotlin/controller/api/AudioApiController.kt @@ -30,13 +30,24 @@ @RequestParam("album", required = false) albumName: String?, @RequestParam("tag", required = false) tagName: String? ): ResponseEntity = - ResponseEntity.ok(audioService.getByKeywords( - audioName, artistName, albumName, tagName, PAGE_LIMIT)) + ResponseEntity.ok( + audioService.getByKeywords( + audioName, artistName, albumName, tagName, PAGE_LIMIT + ) + ) @GetMapping("history") fun getLeastRecentlyPlayedList(): ResponseEntity = ResponseEntity.ok(audioService.getLeastRecentlyAccessedAudio(PAGE_LIMIT)) + @PostMapping("history/{slug}") + fun updateHistory( + @PathVariable("slug") slug: String + ): ResponseEntity { + audioService.updateHistory(slug) + return ResponseEntity.ok(null) + } + @PutMapping("{slug}") fun updateAudio( @PathVariable("slug") slug: String,