Class UCSBOrganizationController
java.lang.Object
edu.ucsb.cs156.example.controllers.ApiController
edu.ucsb.cs156.example.controllers.UCSBOrganizationController
@RequestMapping("/api/ucsborganizations")
@RestController
public class UCSBOrganizationController
extends ApiController
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondeleteOrganization
(String orgField) postOrganization
(String orgField, String orgTranslationShort, String orgTranslation, boolean inactive) updateCommons
(String orgField, @Valid UCSBOrganization incoming) Methods inherited from class edu.ucsb.cs156.example.controllers.ApiController
genericMessage, getCurrentUser, handleGenericException
-
Constructor Details
-
UCSBOrganizationController
public UCSBOrganizationController()
-
-
Method Details
-
allOrganizations
@PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("/all") public Iterable<UCSBOrganization> allOrganizations() -
getById
@PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("") public UCSBOrganization getById(@RequestParam String orgField) -
postOrganization
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PostMapping("/post") public UCSBOrganization postOrganization(@RequestParam String orgField, @RequestParam String orgTranslationShort, @RequestParam String orgTranslation, @RequestParam boolean inactive) -
deleteOrganization
-
updateCommons
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PutMapping("") public UCSBOrganization updateCommons(@RequestParam String orgField, @RequestBody @Valid @Valid UCSBOrganization incoming)
-