@RequestMapping("/api/stores")
@RestController
public class StoresController
extends ApiController
-
Constructor Summary
Constructors
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
StoresController
public StoresController()
-
Method Details
-
allStores
@PreAuthorize("hasRole(\'ROLE_USER\')")
@GetMapping("/all")
public Iterable<Stores> allStores()
-
getById
@PreAuthorize("hasRole(\'ROLE_USER\')")
@GetMapping("")
public Stores getById(@RequestParam
Long id)
-
postStores
@PreAuthorize("hasRole(\'ROLE_ADMIN\')")
@PostMapping("/post")
public Stores postStores(@RequestParam
String location,
@RequestParam
String name,
@RequestParam
String price,
@RequestParam
String sales)
-
deleteStores
@PreAuthorize("hasRole(\'ROLE_ADMIN\')")
@DeleteMapping("")
public Object deleteStores(@RequestParam
Long id)
-
updateStores
@PreAuthorize("hasRole(\'ROLE_ADMIN\')")
@PutMapping("")
public Stores updateStores(@RequestParam
Long id,
@RequestBody @Valid
@Valid Stores incoming)