Package se.bth.pulse.controller
Class ReportsController
java.lang.Object
se.bth.pulse.controller.ReportsController
This class is a view controller that serves the reports page.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionshowReport
(Integer id, org.springframework.ui.Model model, org.springframework.security.core.Authentication authentication) Used to render a view for viewing a report.showReports
(org.springframework.ui.Model model, org.springframework.security.core.Authentication authentication) This serves the reports page to the user.
-
Constructor Details
-
ReportsController
-
-
Method Details
-
showReports
@GetMapping("/reports") public String showReports(org.springframework.ui.Model model, org.springframework.security.core.Authentication authentication) This serves the reports page to the user. The return string is the name of the view to be rendered.- Parameters:
model
- - used to pass attributes to the viewauthentication
- - used to get the username and role of the logged-in user- Returns:
- String - the view to be rendered
-
showReport
@GetMapping("/report/{id}") public String showReport(@PathVariable("id") Integer id, org.springframework.ui.Model model, org.springframework.security.core.Authentication authentication) Used to render a view for viewing a report. It uses the report repository to get the report with the given id.- Parameters:
id
- - the id of the report to be viewedmodel
- - used to pass attributes to the viewauthentication
- - used to get the username and role of the logged-in user- Returns:
- String - the view to be rendered
-