Class SchoolsController

java.lang.Object
edu.ucsb.cs156.organic.controllers.ApiController
edu.ucsb.cs156.organic.controllers.SchoolsController

@RequestMapping("/api/Schools") @RestController public class SchoolsController extends ApiController
  • Constructor Details

    • SchoolsController

      public SchoolsController()
  • Method Details

    • allSchools

      @PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("/all") public Iterable<School> allSchools()
    • postSchool

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PostMapping("/post") public School postSchool(@RequestParam String abbrev, @RequestParam String name, @RequestParam String termRegex, @RequestParam String termDescription, @RequestParam String termError) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException
    • getById

      @PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("") public School getById(@RequestParam Long id)
    • deleteSchool

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @DeleteMapping("") public Object deleteSchool(@RequestParam Long id)
    • updateSchool

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PutMapping("") public School updateSchool(@RequestParam Long id, @RequestBody @Valid @Valid School incoming)