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 Summary
-
Method Summary
Modifier and TypeMethodDescriptiondeleteSchool
(String abbrev) getByAbbrev
(String abbrev) schools()
updateSchool
(String abbrev, @Valid School incoming) Methods inherited from class edu.ucsb.cs156.organic.controllers.ApiController
genericMessage, getCurrentUser, getMapper, handleAccessDeniedException, handleGenericException, handleIllegalArgumentException, mapperThatIgnoresMockitoMocks
-
Constructor Details
-
SchoolsController
public SchoolsController()
-
-
Method Details
-
schools
-
getByAbbrev
-
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
-
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
-