From 1d41d517b1485020df7f307708922fed50a66668 Mon Sep 17 00:00:00 2001 From: pricelees Date: Sat, 13 Sep 2025 16:04:58 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EB=A9=94=EC=9D=B8=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20&=20=EC=98=88=EC=95=BD=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=EC=97=90=EC=84=9C=20=ED=85=8C=EB=A7=88=20?= =?UTF-8?q?=EC=83=81=EC=84=B8=20=EC=A1=B0=ED=9A=8C=EB=8A=94=20Public?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EA=B6=8C=ED=95=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kotlin/roomescape/theme/docs/ThemeApi.kt | 10 ++--- .../kotlin/roomescape/theme/ThemeApiTest.kt | 44 ------------------- 2 files changed, 5 insertions(+), 49 deletions(-) diff --git a/src/main/kotlin/roomescape/theme/docs/ThemeApi.kt b/src/main/kotlin/roomescape/theme/docs/ThemeApi.kt index e11e4dfd..ef83799b 100644 --- a/src/main/kotlin/roomescape/theme/docs/ThemeApi.kt +++ b/src/main/kotlin/roomescape/theme/docs/ThemeApi.kt @@ -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> - @UserOnly - @Operation(summary = "예약 페이지에서 모든 테마 조회", description = "모든 테마를 조회합니다.", tags = ["로그인이 필요한 API"]) + @Public + @Operation(summary = "예약 페이지에서 모든 테마 조회", description = "모든 테마를 조회합니다.") @ApiResponses(ApiResponse(responseCode = "200", description = "성공", useReturnTypeSchema = true)) fun findUserThemes(): ResponseEntity> - @UserOnly - @Operation(summary = "예약 페이지에서 입력한 날짜에 가능한 테마 조회", description = "입력한 날짜에 가능한 테마를 조회합니다.", tags = ["로그인이 필요한 API"]) + @Public + @Operation(summary = "예약 페이지에서 입력한 날짜에 가능한 테마 조회", description = "입력한 날짜에 가능한 테마를 조회합니다.") @ApiResponses(ApiResponse(responseCode = "200", description = "성공", useReturnTypeSchema = true)) fun findThemesByIds(request: ThemeIdListRetrieveResponse): ResponseEntity> } diff --git a/src/test/kotlin/roomescape/theme/ThemeApiTest.kt b/src/test/kotlin/roomescape/theme/ThemeApiTest.kt index 7e7799ba..fb53975c 100644 --- a/src/test/kotlin/roomescape/theme/ThemeApiTest.kt +++ b/src/test/kotlin/roomescape/theme/ThemeApiTest.kt @@ -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(