Class UCSBOrganizationController

java.lang.Object
edu.ucsb.cs156.example.controllers.ApiController
edu.ucsb.cs156.example.controllers.UCSBOrganizationController

@RequestMapping("/api/ucsborganization") @RestController public class UCSBOrganizationController extends ApiController
This is a REST controller for UCSBOrganization
  • Constructor Details

    • UCSBOrganizationController

      public UCSBOrganizationController()
  • Method Details

    • allorgss

      @PreAuthorize("hasRole('ROLE_USER')") @GetMapping("/all") public Iterable<UCSBOrganization> allorgss()
      THis method returns a list of all UCSBOrganization.
      Returns:
      a list of all UCSBOrganizations
    • postOrganization

      @PreAuthorize("hasRole('ROLE_ADMIN')") @PostMapping("/post") public UCSBOrganization postOrganization(@RequestParam String orgCode, @RequestParam String orgTranslationShort, @RequestParam String orgTranslation, @RequestParam boolean inactive)
      This method creates a new diningorgs. Accessible only to users with the role "ROLE_ADMIN".
      Parameters:
      orgCode - code of the organization (e.g. ZPR)
      orgTranslationShort - short name of the organization
      orgTranslation - full name of the organization
      inactive - whether or not the organization is inactive
      Returns:
      the saved organization