20 lines
577 B
Kotlin
20 lines
577 B
Kotlin
package com.chantha.mini.controller
|
|
|
|
import com.chantha.mini.route.MainRoute
|
|
import org.springframework.security.access.prepost.PreAuthorize
|
|
import org.springframework.stereotype.Controller
|
|
import org.springframework.ui.Model
|
|
import org.springframework.web.bind.annotation.GetMapping
|
|
import org.springframework.web.bind.annotation.RequestMapping
|
|
import org.springframework.web.bind.annotation.RestController
|
|
|
|
@Controller
|
|
class MainController {
|
|
|
|
@PreAuthorize("hasRole('ADMIN')")
|
|
@GetMapping(MainRoute.HOME_PAGE)
|
|
fun index(): String {
|
|
return "index"
|
|
}
|
|
|
|
} |