[#34] 회원 / 인증 도메인 재정의 #43

Merged
pricelees merged 73 commits from refactor/#34 into main 2025-09-13 10:13:45 +00:00
2 changed files with 5 additions and 49 deletions
Showing only changes of commit 1d41d517b1 - Show all commits

View File

@ -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>>
}

View File

@ -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(