Package se.bth.pulse.controller
Class ReportAdminController
java.lang.Object
se.bth.pulse.controller.ReportAdminController
This class is a view controller that serves the report admin page.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionshowReport
(Integer id, org.springframework.ui.Model model, org.springframework.security.core.Authentication authentication) Renders a view for viewing a report.showReports
(org.springframework.ui.Model model, org.springframework.security.core.Authentication authentication) Renders and views the report admin page.
-
Constructor Details
-
ReportAdminController
-
-
Method Details
-
showReports
@GetMapping("/admin/reports") public String showReports(org.springframework.ui.Model model, org.springframework.security.core.Authentication authentication) Renders and views the report admin page. It uses the report repository to get all the reports.- 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("/admin/report/{id}") public String showReport(@PathVariable("id") Integer id, org.springframework.ui.Model model, org.springframework.security.core.Authentication authentication) Renders 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
-