mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-26 01:15:50 +00:00
parent
1ae4056bf0
commit
f94ade3bf5
4 changed files with 1 additions and 20 deletions
2
pom.xml
2
pom.xml
|
@ -15,7 +15,7 @@
|
|||
<properties>
|
||||
|
||||
<!-- Generic properties -->
|
||||
<java.version>11</java.version>
|
||||
<java.version>17</java.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
|
||||
|
|
|
@ -158,12 +158,4 @@ class OwnerController {
|
|||
return mav;
|
||||
}
|
||||
|
||||
@GetMapping("/owners")
|
||||
public ModelAndView showOwners(@PathVariable("ownerId") int ownerId) {
|
||||
ModelAndView mav = new ModelAndView("owners/ownerDetails");
|
||||
Owner owner = this.owners.findById(ownerId);
|
||||
mav.addObject(owner);
|
||||
return mav;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -105,12 +105,6 @@ class PetController {
|
|||
return VIEWS_PETS_CREATE_OR_UPDATE_FORM;
|
||||
}
|
||||
|
||||
@GetMapping("/pets/{petId}/find")
|
||||
public String initUpdateFormFind(Owner owner, @PathVariable("petId") int petId, ModelMap model) {
|
||||
Pet pet = owner.getPet(petId);
|
||||
model.put("pet", pet);
|
||||
return VIEWS_PETS_CREATE_OR_UPDATE_FORM;
|
||||
}
|
||||
@PostMapping("/pets/{petId}/edit")
|
||||
public String processUpdateForm(@Valid Pet pet, BindingResult result, Owner owner, ModelMap model) {
|
||||
if (result.hasErrors()) {
|
||||
|
|
|
@ -77,11 +77,6 @@ class VisitController {
|
|||
return "pets/createOrUpdateVisitForm";
|
||||
}
|
||||
|
||||
@GetMapping("/owners/{ownerId}/pets/{petId}/visits")
|
||||
public String initNewVisitFormVisit() {
|
||||
return "pets/createOrUpdateVisitForm";
|
||||
}
|
||||
|
||||
// Spring MVC calls method loadPetWithVisit(...) before processNewVisitForm is
|
||||
// called
|
||||
@PostMapping("/owners/{ownerId}/pets/{petId}/visits/new")
|
||||
|
|
Loading…
Reference in a new issue