@RequestMapping("/api/dogs")
@RestController
public class DogController
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
-
DogController
public DogController()
-
Method Details
-
allDogs
@PreAuthorize("hasRole(\'ROLE_USER\')")
@GetMapping("/all")
public Iterable<Dog> allDogs()
-
getById
@PreAuthorize("hasRole(\'ROLE_USER\')")
@GetMapping("")
public Dog getById(@RequestParam
Long id)
-
postDog
@PreAuthorize("hasRole(\'ROLE_ADMIN\')")
@PostMapping("/post")
public Dog postDog(@RequestParam
String name,
@RequestParam
String breed)
throws com.fasterxml.jackson.core.JsonProcessingException
- Throws:
com.fasterxml.jackson.core.JsonProcessingException
-
deleteDog
@PreAuthorize("hasRole(\'ROLE_ADMIN\')")
@DeleteMapping("")
public Object deleteDog(@RequestParam
Long id)
-
updateDog
@PreAuthorize("hasRole(\'ROLE_ADMIN\')")
@PutMapping("")
public Dog updateDog(@RequestParam
Long id,
@RequestBody @Valid
@Valid Dog incoming)