@Service
public class AaaService implements IChangePassword {
@Override
public void changePassword(String username, String password) {
}
}
@Service
public class BbbService implements IChangePassword {
@Override
public void changePassword(String username, String password) {
}
}
public class AccountController extends BaseController {
@Autowired
@Qualifier("aaaService")
private IChangePassword aaaService;
@Autowired
@Qualifier("bbbService")
private IChangePassword bbbService;
}
Spring用@Autowire向一个类注入一个接口的两个实现类
原文:https://www.cnblogs.com/stitchZsx/p/9750077.html