feat(home-live): 현재 진행 중 라이브 endpoint를 추가한다

This commit is contained in:
2026-06-27 00:07:15 +09:00
parent 99f61ed13e
commit 5f09f59f53
2 changed files with 153 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
package kr.co.vividnext.sodalive.v2.api.home.live.adapter.`in`.web
import kr.co.vividnext.sodalive.common.ApiResponse
import kr.co.vividnext.sodalive.common.SodaException
import kr.co.vividnext.sodalive.member.Member
import kr.co.vividnext.sodalive.v2.api.home.live.application.HomeOnAirLiveFacade
import org.springframework.security.core.annotation.AuthenticationPrincipal
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.bind.annotation.RestController
@RestController
@RequestMapping("/api/v2/home/on-air-lives")
class HomeOnAirLiveController(
private val homeOnAirLiveFacade: HomeOnAirLiveFacade
) {
@GetMapping
fun getOnAirLives(
@RequestParam(defaultValue = "0") page: Int,
@AuthenticationPrincipal(expression = "#this == 'anonymousUser' ? null : member") member: Member?
) = run {
ApiResponse.ok(homeOnAirLiveFacade.getOnAirLives(requireMember(member), page))
}
private fun requireMember(member: Member?): Member {
return member ?: throw SodaException(messageKey = "common.error.bad_credentials")
}
}