forked from semaphoreci-demos/semaphore-demo-java-spring
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAdminController.java
More file actions
25 lines (20 loc) · 796 Bytes
/
AdminController.java
File metadata and controls
25 lines (20 loc) · 796 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.example.springpipelinedemo.controller;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.security.core.userdetails.UserDetails;
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.servlet.ModelAndView;
/**
* Created by Rimantas Jacikevičius on 19.2.14.
*/
@Controller
@RequestMapping("/admin")
public class AdminController {
@GetMapping("/home")
public ModelAndView home(@AuthenticationPrincipal UserDetails details, Model model) {
model.addAttribute("user", details);
return new ModelAndView("home");
}
}