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

    • schools

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @GetMapping("/all") public Iterable<School> schools()
    • getByAbbrev

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @GetMapping("") public School getByAbbrev(@RequestParam String abbrev)
    • 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
    • updateSchool

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PutMapping("/update") public School updateSchool(@RequestParam String abbrev, @RequestBody @Valid @Valid School incoming)
    • deleteSchool

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @DeleteMapping("/delete") public Object deleteSchool(@RequestParam String abbrev) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException