From 7f5e9046fb2b97b45ed035a8c110a64d23c5f7b4 Mon Sep 17 00:00:00 2001 From: Vitaliy Fedoriv Date: Thu, 3 Nov 2016 22:06:19 +0200 Subject: [PATCH] PetRestController - add "/" GET mapping for getPets() --- .../samples/petclinic/rest/PetRestController.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/org/springframework/samples/petclinic/rest/PetRestController.java b/src/main/java/org/springframework/samples/petclinic/rest/PetRestController.java index 41425bce4..ac42e0084 100644 --- a/src/main/java/org/springframework/samples/petclinic/rest/PetRestController.java +++ b/src/main/java/org/springframework/samples/petclinic/rest/PetRestController.java @@ -57,6 +57,11 @@ public class PetRestController { return new ResponseEntity(pet, HttpStatus.OK); } + @RequestMapping(value = "/", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) + public ResponseEntity> getPets(){ + return new ResponseEntity>(this.clinicService.findAllPets(), HttpStatus.OK); + } + @RequestMapping(value = "/pettypes}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public ResponseEntity> getPetTypes(){ return new ResponseEntity>(this.clinicService.findPetTypes(), HttpStatus.OK);