Class UCSBDiningCommonsController
java.lang.Object
edu.ucsb.cs156.example.controllers.ApiController
edu.ucsb.cs156.example.controllers.UCSBDiningCommonsController
@RequestMapping("/api/ucsbdiningcommons")
@RestController
public class UCSBDiningCommonsController
extends ApiController
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondeleteCommons
(String code) postCommons
(String code, String name, boolean hasSackMeal, boolean hasTakeOutMeal, boolean hasDiningCam, double latitude, double longitude) updateCommons
(String code, @Valid UCSBDiningCommons incoming) Methods inherited from class edu.ucsb.cs156.example.controllers.ApiController
genericMessage, getCurrentUser, handleGenericException
-
Constructor Details
-
UCSBDiningCommonsController
public UCSBDiningCommonsController()
-
-
Method Details
-
allCommonss
@PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("/all") public Iterable<UCSBDiningCommons> allCommonss() -
postCommons
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PostMapping("/post") public UCSBDiningCommons postCommons(@RequestParam String code, @RequestParam String name, @RequestParam boolean hasSackMeal, @RequestParam boolean hasTakeOutMeal, @RequestParam boolean hasDiningCam, @RequestParam double latitude, @RequestParam double longitude) -
getById
@PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("") public UCSBDiningCommons getById(@RequestParam String code) -
deleteCommons
-
updateCommons
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PutMapping("") public UCSBDiningCommons updateCommons(@RequestParam String code, @RequestBody @Valid @Valid UCSBDiningCommons incoming)
-