generated from pricelees/issue-pr-template
refactor: 메인 페이지 & 예약 페이지에서 테마 상세 조회는 Public으로 권한 변경
This commit is contained in:
parent
905c4b7019
commit
1d41d517b1
@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.PathVariable
|
||||
import org.springframework.web.bind.annotation.RequestBody
|
||||
import roomescape.admin.infrastructure.persistence.Privilege
|
||||
import roomescape.auth.web.support.AdminOnly
|
||||
import roomescape.auth.web.support.UserOnly
|
||||
import roomescape.auth.web.support.Public
|
||||
import roomescape.common.dto.response.CommonApiResponse
|
||||
import roomescape.theme.web.*
|
||||
|
||||
@ -45,13 +45,13 @@ interface ThemeAPIV2 {
|
||||
@Valid @RequestBody themeUpdateRequest: ThemeUpdateRequest
|
||||
): ResponseEntity<CommonApiResponse<Unit>>
|
||||
|
||||
@UserOnly
|
||||
@Operation(summary = "예약 페이지에서 모든 테마 조회", description = "모든 테마를 조회합니다.", tags = ["로그인이 필요한 API"])
|
||||
@Public
|
||||
@Operation(summary = "예약 페이지에서 모든 테마 조회", description = "모든 테마를 조회합니다.")
|
||||
@ApiResponses(ApiResponse(responseCode = "200", description = "성공", useReturnTypeSchema = true))
|
||||
fun findUserThemes(): ResponseEntity<CommonApiResponse<ThemeInfoListRetrieveResponse>>
|
||||
|
||||
@UserOnly
|
||||
@Operation(summary = "예약 페이지에서 입력한 날짜에 가능한 테마 조회", description = "입력한 날짜에 가능한 테마를 조회합니다.", tags = ["로그인이 필요한 API"])
|
||||
@Public
|
||||
@Operation(summary = "예약 페이지에서 입력한 날짜에 가능한 테마 조회", description = "입력한 날짜에 가능한 테마를 조회합니다.")
|
||||
@ApiResponses(ApiResponse(responseCode = "200", description = "성공", useReturnTypeSchema = true))
|
||||
fun findThemesByIds(request: ThemeIdListRetrieveResponse): ResponseEntity<CommonApiResponse<ThemeInfoListRetrieveResponse>>
|
||||
}
|
||||
|
||||
@ -283,29 +283,6 @@ class ThemeApiTest(
|
||||
}
|
||||
|
||||
context("입력된 모든 ID에 대한 테마를 조회한다.") {
|
||||
val endpoint = "/themes/retrieve"
|
||||
|
||||
context("권한이 없으면 접근할 수 없다.") {
|
||||
test("비회원") {
|
||||
runExceptionTest(
|
||||
method = HttpMethod.POST,
|
||||
requestBody = ThemeIdListRetrieveResponse(themeIds = listOf()),
|
||||
endpoint = endpoint,
|
||||
expectedErrorCode = AuthErrorCode.TOKEN_NOT_FOUND
|
||||
)
|
||||
}
|
||||
|
||||
test("관리자") {
|
||||
runExceptionTest(
|
||||
token = authUtil.defaultAdminLogin(),
|
||||
method = HttpMethod.POST,
|
||||
requestBody = ThemeIdListRetrieveResponse(themeIds = listOf()),
|
||||
endpoint = endpoint,
|
||||
expectedErrorCode = AuthErrorCode.ACCESS_DENIED
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
test("정상 응답") {
|
||||
val adminToken = authUtil.defaultAdminLogin()
|
||||
val themeSize = 3
|
||||
@ -406,27 +383,6 @@ class ThemeApiTest(
|
||||
}
|
||||
|
||||
context("예약 페이지에서 테마를 조회한다.") {
|
||||
val endpoint = "/v2/themes"
|
||||
|
||||
context("권한이 없으면 접근할 수 없다.") {
|
||||
test("비회원") {
|
||||
runExceptionTest(
|
||||
method = HttpMethod.GET,
|
||||
endpoint = endpoint,
|
||||
expectedErrorCode = AuthErrorCode.TOKEN_NOT_FOUND
|
||||
)
|
||||
}
|
||||
|
||||
test("관리자") {
|
||||
runExceptionTest(
|
||||
token = authUtil.defaultAdminLogin(),
|
||||
method = HttpMethod.GET,
|
||||
endpoint = endpoint,
|
||||
expectedErrorCode = AuthErrorCode.ACCESS_DENIED
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
test("공개된 테마의 전체 정보가 조회된다.") {
|
||||
val token = authUtil.defaultAdminLogin()
|
||||
listOf(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user