feat(content-all): 전체 탭 공개 endpoint를 추가한다

This commit is contained in:
2026-06-25 11:27:31 +09:00
parent 9bd0ce712e
commit 147d770e9d
3 changed files with 149 additions and 0 deletions

View File

@@ -103,6 +103,7 @@ class SecurityConfig(
.antMatchers(HttpMethod.POST, "/charge/payverse/webhook").permitAll()
.antMatchers(HttpMethod.GET, "/api/v2/home/recommendations").permitAll()
.antMatchers(HttpMethod.GET, "/api/v2/audio/recommendations").permitAll()
.antMatchers(HttpMethod.GET, "/api/v2/audio/contents").permitAll()
.antMatchers(HttpMethod.GET, "/api/v2/audio/rankings").permitAll()
.antMatchers(HttpMethod.GET, "/api/v2/home/rankings/creators").permitAll()
// 페이지네이션 하위 경로(/lives, /debut-creators 등)는 인증 필수

View File

@@ -0,0 +1,37 @@
package kr.co.vividnext.sodalive.v2.api.content.all.adapter.`in`.web
import kr.co.vividnext.sodalive.common.ApiResponse
import kr.co.vividnext.sodalive.member.Member
import kr.co.vividnext.sodalive.v2.api.content.all.application.MainContentAllFacade
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/audio/contents")
class MainContentAllController(
private val facade: MainContentAllFacade
) {
@GetMapping
fun getContents(
@RequestParam(required = false) type: String?,
@RequestParam(required = false) sort: String?,
@RequestParam(required = false) dayOfWeek: String?,
@RequestParam(required = false) page: Int?,
@RequestParam(required = false) size: Int?,
@AuthenticationPrincipal(expression = "#this == 'anonymousUser' ? null : member") member: Member?
) = run {
ApiResponse.ok(
facade.getContents(
type = type,
sort = sort,
dayOfWeek = dayOfWeek,
page = page,
size = size,
member = member
)
)
}
}