PetRestController - add "/" GET mapping for getPets()

This commit is contained in:
Vitaliy Fedoriv 2016-11-03 22:06:19 +02:00
parent 587a5c5e1d
commit 7f5e9046fb

View file

@ -57,6 +57,11 @@ public class PetRestController {
return new ResponseEntity<Pet>(pet, HttpStatus.OK);
}
@RequestMapping(value = "/", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseEntity<Collection<Pet>> getPets(){
return new ResponseEntity<Collection<Pet>>(this.clinicService.findAllPets(), HttpStatus.OK);
}
@RequestMapping(value = "/pettypes}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public ResponseEntity<Collection<PetType>> getPetTypes(){
return new ResponseEntity<Collection<PetType>>(this.clinicService.findPetTypes(), HttpStatus.OK);