콘텐츠 고정, 해제 API 추가
This commit is contained in:
@@ -196,4 +196,26 @@ class AudioContentController(private val service: AudioContentService) {
|
||||
fun releaseContent() = run {
|
||||
ApiResponse.ok(service.releaseContent())
|
||||
}
|
||||
|
||||
@PostMapping("/pin-to-the-top/{id}")
|
||||
@PreAuthorize("hasRole('CREATOR')")
|
||||
fun pinToTheTop(
|
||||
@PathVariable id: Long,
|
||||
@AuthenticationPrincipal(expression = "#this == 'anonymousUser' ? null : member") member: Member?
|
||||
) = run {
|
||||
if (member == null) throw SodaException("로그인 정보를 확인해주세요.")
|
||||
|
||||
ApiResponse.ok(service.pinToTheTop(contentId = id, member = member))
|
||||
}
|
||||
|
||||
@PutMapping("/unpin-at-the-top/{id}")
|
||||
@PreAuthorize("hasRole('CREATOR')")
|
||||
fun unpinAtTheTop(
|
||||
@PathVariable id: Long,
|
||||
@AuthenticationPrincipal(expression = "#this == 'anonymousUser' ? null : member") member: Member?
|
||||
) = run {
|
||||
if (member == null) throw SodaException("로그인 정보를 확인해주세요.")
|
||||
|
||||
ApiResponse.ok(service.unpinAtTheTop(contentId = id, member = member))
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user