package roomescape.view import org.springframework.stereotype.Controller import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.PathVariable import org.springframework.web.bind.annotation.RequestMapping import roomescape.auth.web.support.Admin import roomescape.auth.web.support.LoginRequired @Controller class AuthPageController { @GetMapping("/login") fun showLoginPage(): String = "login" } @Controller @RequestMapping("/admin") class AdminPageController { @Admin @GetMapping fun showIndexPage() = "admin/index" @Admin @GetMapping("/{page}") fun showAdminSubPage(@PathVariable page: String) = when (page) { "reservation" -> "admin/reservation-new" "time" -> "admin/time" "theme" -> "admin/theme" "waiting" -> "admin/waiting" else -> "admin/index" } } @Controller class ClientPageController { @GetMapping("/") fun showPopularThemePage(): String = "index" @LoginRequired @GetMapping("/reservation") fun showReservationPage(): String = "reservation" @LoginRequired @GetMapping("/reservation-mine") fun showReservationMinePage(): String = "reservation-mine" }