Class SchoolController

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

@RequestMapping("/api/schools") @RestController public class SchoolController extends ApiController
  • Constructor Details

    • SchoolController

      public SchoolController()
  • Method Details

    • updateSchool

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

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

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

      @PreAuthorize("hasRole(\'ROLE_ADMIN\')") @DeleteMapping("") public Object deleteSchool(@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(required=false) String termError) throws com.fasterxml.jackson.core.JsonProcessingException
      Throws:
      com.fasterxml.jackson.core.JsonProcessingException