generated from pricelees/issue-pr-template
[#44] 매장 기능 도입 #45
@ -29,18 +29,6 @@ interface AuthAPI {
|
||||
servletRequest: HttpServletRequest
|
||||
): ResponseEntity<CommonApiResponse<LoginSuccessResponse>>
|
||||
|
||||
@Operation(summary = "로그인 상태 확인")
|
||||
@ApiResponses(
|
||||
ApiResponse(
|
||||
responseCode = "200",
|
||||
description = "입력된 ID / 결과(Boolean)을 반환합니다.",
|
||||
useReturnTypeSchema = true
|
||||
),
|
||||
)
|
||||
fun checkLogin(
|
||||
@CurrentUser user: CurrentUserContext
|
||||
): ResponseEntity<CommonApiResponse<CurrentUserContext>>
|
||||
|
||||
@Operation(summary = "로그아웃", tags = ["로그인이 필요한 API"])
|
||||
@ApiResponses(
|
||||
ApiResponse(responseCode = "200"),
|
||||
|
||||
@ -3,7 +3,6 @@ package roomescape.auth.web
|
||||
import jakarta.servlet.http.HttpServletRequest
|
||||
import jakarta.servlet.http.HttpServletResponse
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.web.bind.annotation.GetMapping
|
||||
import org.springframework.web.bind.annotation.PostMapping
|
||||
import org.springframework.web.bind.annotation.RequestMapping
|
||||
import org.springframework.web.bind.annotation.RestController
|
||||
@ -29,13 +28,6 @@ class AuthController(
|
||||
return ResponseEntity.ok(CommonApiResponse(response))
|
||||
}
|
||||
|
||||
@GetMapping("/login/check")
|
||||
override fun checkLogin(
|
||||
@CurrentUser user: CurrentUserContext,
|
||||
): ResponseEntity<CommonApiResponse<CurrentUserContext>> {
|
||||
return ResponseEntity.ok(CommonApiResponse(user))
|
||||
}
|
||||
|
||||
@PostMapping("/logout")
|
||||
override fun logout(
|
||||
@CurrentUser user: CurrentUserContext,
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package roomescape.auth.web
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest
|
||||
import roomescape.admin.infrastructure.persistence.AdminType
|
||||
import roomescape.common.dto.PrincipalType
|
||||
|
||||
data class LoginContext(
|
||||
@ -19,6 +20,19 @@ data class LoginRequest(
|
||||
val principalType: PrincipalType
|
||||
)
|
||||
|
||||
data class LoginSuccessResponse(
|
||||
val accessToken: String
|
||||
)
|
||||
abstract class LoginSuccessResponse {
|
||||
abstract val accessToken: String
|
||||
abstract val name: String
|
||||
}
|
||||
|
||||
data class UserLoginSuccessResponse(
|
||||
override val accessToken: String,
|
||||
override val name: String,
|
||||
) : LoginSuccessResponse()
|
||||
|
||||
data class AdminLoginSuccessResponse(
|
||||
override val accessToken: String,
|
||||
override val name: String,
|
||||
val type: AdminType,
|
||||
val storeId: Long?,
|
||||
) : LoginSuccessResponse()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user