Class ReportsController

java.lang.Object
edu.ucsb.cs156.happiercows.controllers.ApiController
edu.ucsb.cs156.happiercows.controllers.ReportsController

@RequestMapping("/api/reports") @RestController public class ReportsController extends ApiController
  • Constructor Details

    • ReportsController

      public ReportsController()
  • Method Details

    • allReports

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @GetMapping("") public Iterable<Report> allReports()
    • findByReportId

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @GetMapping("/byReportId") public Optional<Report> findByReportId(@RequestParam Long reportId)
    • allReportsByCommonsId

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @GetMapping("/headers") public Iterable<Report> allReportsByCommonsId(@RequestParam Long commonsId)
    • allLinesByReportId

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @GetMapping("/lines") public Iterable<ReportLine> allLinesByReportId(@RequestParam Long reportId)
    • getLinesCSV

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @GetMapping("/download") public org.springframework.http.ResponseEntity<org.springframework.core.io.Resource> getLinesCSV(@RequestParam Long reportId) throws IOException
      Throws:
      IOException