mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-17 21:15:50 +00:00
Add @Qualifier to web package controllers
This commit is contained in:
parent
e4499ee645
commit
d2ed818034
5 changed files with 10 additions and 5 deletions
|
@ -21,6 +21,7 @@ import java.util.Map;
|
|||
import javax.validation.Valid;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.samples.petclinic.model.Owner;
|
||||
import org.springframework.samples.petclinic.service.ClinicService;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
@ -47,7 +48,7 @@ public class OwnerController {
|
|||
|
||||
|
||||
@Autowired
|
||||
public OwnerController(ClinicService clinicService) {
|
||||
public OwnerController(@Qualifier("ClinicService") ClinicService clinicService) {
|
||||
this.clinicService = clinicService;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
package org.springframework.samples.petclinic.web;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.samples.petclinic.model.Owner;
|
||||
import org.springframework.samples.petclinic.model.Pet;
|
||||
import org.springframework.samples.petclinic.model.PetType;
|
||||
|
@ -44,7 +45,7 @@ public class PetController {
|
|||
private final ClinicService clinicService;
|
||||
|
||||
@Autowired
|
||||
public PetController(ClinicService clinicService) {
|
||||
public PetController(@Qualifier("ClinicService") ClinicService clinicService) {
|
||||
this.clinicService = clinicService;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ import java.util.Collection;
|
|||
import java.util.Locale;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.format.Formatter;
|
||||
import org.springframework.samples.petclinic.model.PetType;
|
||||
import org.springframework.samples.petclinic.service.ClinicService;
|
||||
|
@ -43,7 +44,7 @@ public class PetTypeFormatter implements Formatter<PetType> {
|
|||
|
||||
|
||||
@Autowired
|
||||
public PetTypeFormatter(ClinicService clinicService) {
|
||||
public PetTypeFormatter(@Qualifier("ClinicService") ClinicService clinicService) {
|
||||
this.clinicService = clinicService;
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ package org.springframework.samples.petclinic.web;
|
|||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.samples.petclinic.model.Vets;
|
||||
import org.springframework.samples.petclinic.service.ClinicService;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
@ -37,7 +38,7 @@ public class VetController {
|
|||
|
||||
|
||||
@Autowired
|
||||
public VetController(ClinicService clinicService) {
|
||||
public VetController(@Qualifier("ClinicService") ClinicService clinicService) {
|
||||
this.clinicService = clinicService;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ import java.util.Map;
|
|||
import javax.validation.Valid;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.samples.petclinic.model.Pet;
|
||||
import org.springframework.samples.petclinic.model.Visit;
|
||||
import org.springframework.samples.petclinic.service.ClinicService;
|
||||
|
@ -45,7 +46,7 @@ public class VisitController {
|
|||
|
||||
|
||||
@Autowired
|
||||
public VisitController(ClinicService clinicService) {
|
||||
public VisitController(@Qualifier("ClinicService") ClinicService clinicService) {
|
||||
this.clinicService = clinicService;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue