@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向一个类注入一个接口的两个实现类
@Qualifier注解
最新推荐文章于 2025-10-10 15:28:42 发布
5997

被折叠的 条评论
为什么被折叠?



