generated from pricelees/issue-pr-template
refactor: 기존의 view 로직 마이그레이션 및 클래스 통합
This commit is contained in:
parent
72d3c7093b
commit
db5d4f7c4d
@ -1,40 +0,0 @@
|
|||||||
package roomescape.view.controller;
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Controller;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
|
|
||||||
import roomescape.system.auth.annotation.Admin;
|
|
||||||
|
|
||||||
@Controller
|
|
||||||
public class AdminPageController {
|
|
||||||
|
|
||||||
@Admin
|
|
||||||
@GetMapping("/admin")
|
|
||||||
public String showAdminPage() {
|
|
||||||
return "admin/index";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Admin
|
|
||||||
@GetMapping("/admin/reservation")
|
|
||||||
public String showAdminReservationPage() {
|
|
||||||
return "admin/reservation-new";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Admin
|
|
||||||
@GetMapping("/admin/time")
|
|
||||||
public String showAdminTimePage() {
|
|
||||||
return "admin/time";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Admin
|
|
||||||
@GetMapping("/admin/theme")
|
|
||||||
public String showAdminThemePage() {
|
|
||||||
return "admin/theme";
|
|
||||||
}
|
|
||||||
|
|
||||||
@Admin
|
|
||||||
@GetMapping("/admin/waiting")
|
|
||||||
public String showAdminWaitingPage() {
|
|
||||||
return "admin/waiting";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
package roomescape.view.controller;
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Controller;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
|
|
||||||
@Controller
|
|
||||||
public class AuthPageController {
|
|
||||||
|
|
||||||
@GetMapping("/login")
|
|
||||||
public String showLoginPage() {
|
|
||||||
return "login";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,27 +0,0 @@
|
|||||||
package roomescape.view.controller;
|
|
||||||
|
|
||||||
import org.springframework.stereotype.Controller;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
|
|
||||||
import roomescape.system.auth.annotation.LoginRequired;
|
|
||||||
|
|
||||||
@Controller
|
|
||||||
public class ClientPageController {
|
|
||||||
|
|
||||||
@GetMapping("/")
|
|
||||||
public String showPopularThemePage() {
|
|
||||||
return "index";
|
|
||||||
}
|
|
||||||
|
|
||||||
@LoginRequired
|
|
||||||
@GetMapping("/reservation")
|
|
||||||
public String showReservationPage() {
|
|
||||||
return "reservation";
|
|
||||||
}
|
|
||||||
|
|
||||||
@LoginRequired
|
|
||||||
@GetMapping("/reservation-mine")
|
|
||||||
public String showReservationMinePage() {
|
|
||||||
return "reservation-mine";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
48
src/main/java/roomescape/view/controller/PageController.kt
Normal file
48
src/main/java/roomescape/view/controller/PageController.kt
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
package roomescape.view.controller
|
||||||
|
|
||||||
|
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.system.auth.annotation.Admin
|
||||||
|
import roomescape.system.auth.annotation.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"
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user