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)
    • allReportsByGameId

      @PreAuthorize("hasRole('ROLE_ADMIN')") @GetMapping("/headers") public Iterable<Report> allReportsByGameId(@RequestParam Long gameId)
    • 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
    • deleteReport

      @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping("") @Transactional public Object deleteReport(@RequestParam Long reportId)
    • purgeOlderReports

      @PreAuthorize("hasRole('ROLE_ADMIN')") @DeleteMapping("/purge") @Transactional public Object purgeOlderReports(@RequestParam Long reportId)