Last active
March 1, 2021 10:43
-
-
Save Enigo/c7e4b6e3365c84cb66cf2ab3148b6031 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RestController | |
@RequestMapping(path = "/zoo") | |
public class ZooController { | |
@Secured(Role.Code.ADMIN) | |
@PostMapping(path = "/add", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) | |
public String addAnimal(@RequestBody String payload) { | |
return "OK from post addAnimal"; | |
} | |
@Secured({Role.Code.USER, Role.Code.ADMIN}) | |
@GetMapping(path = "/all") | |
public Collection<String> getAnimals() { | |
return List.of("OK from get"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment