Class ReportAdminController

java.lang.Object
se.bth.pulse.controller.ReportAdminController

@Controller public class ReportAdminController extends Object
This class is a view controller that serves the report admin page.
  • Constructor Details

    • ReportAdminController

      public ReportAdminController(ReportRepository reportRepository)
  • 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 view
      authentication - - 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 viewed
      model - - used to pass attributes to the view
      authentication - - used to get the username and role of the logged-in user
      Returns:
      String - the view to be rendered