mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-17 21:15:50 +00:00
PetRestController - add "/" GET mapping for getPets()
This commit is contained in:
parent
587a5c5e1d
commit
7f5e9046fb
1 changed files with 5 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue