Class IceCreamShopController
java.lang.Object
edu.ucsb.cs156.example.controllers.ApiController
edu.ucsb.cs156.example.controllers.IceCreamShopController
@RequestMapping("/api/icecreamshop")
@RestController
public class IceCreamShopController
extends ApiController
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionpostIceCreamShop
(String name, String flavor, String description) updateCommons
(Long id, @Valid IceCreamShop incoming) Methods inherited from class edu.ucsb.cs156.example.controllers.ApiController
genericMessage, getCurrentUser, handleGenericException
-
Constructor Details
-
IceCreamShopController
public IceCreamShopController()
-
-
Method Details
-
allIceCreamShop
@PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("/all") public Iterable<IceCreamShop> allIceCreamShop() -
getById
@PreAuthorize("hasRole(\'ROLE_USER\')") @GetMapping("") public IceCreamShop getById(@RequestParam Long id) -
postIceCreamShop
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PostMapping("/post") public IceCreamShop postIceCreamShop(@RequestParam String name, @RequestParam String flavor, @RequestParam String description) -
deleteIceCreamShop
-
updateCommons
@PreAuthorize("hasRole(\'ROLE_ADMIN\')") @PutMapping("") public IceCreamShop updateCommons(@RequestParam Long id, @RequestBody @Valid @Valid IceCreamShop incoming)
-