@Service在继承的时候,怎么用?
论文问答
1
interface A { void say(); } @Service class A1 implements A { void say(){System.out.println('A1');} } interface B extends A{ void say(); } @Service class B1 extends A1 implements B { void say(){System.out.println('B1');} } 报错:No unique bean of type [A] is defined: expected single matching bean but found 2: [B1, A1]
发表回复