- 使用类型注入的类,如果有子类,需要使用
@Primary
注解表示为父类,否则Spring会报错找到了多个符合要求的类型
报错为:
No qualifying bean of type 'com.pxst.xyinfo.rules.GenericRule' available: expected single matching bean but found 8: bcaRule,bniRule,briRule,cimbRule,genericRule,mayRule,mdrRule,pmtRule