Skip to content

Instantly share code, notes, and snippets.

@Enigo
Last active March 1, 2021 10:40
Show Gist options
  • Save Enigo/bba3e1ac4ac0794bc472137898967a02 to your computer and use it in GitHub Desktop.
Save Enigo/bba3e1ac4ac0794bc472137898967a02 to your computer and use it in GitHub Desktop.
@RestController
@RequestMapping(path = "/zoo")
public class ZooController {
@PostMapping(path = "/add", consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE)
public String addAnimal(@RequestBody String payload) {
return "OK from post addAnimal";
}
@GetMapping(path = "/all")
public Collection<String> getAnimals() {
return List.of("OK from getAnimals");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment