java中工具类的静态方法调用注入的service解决方案
2020-01-04 本文已影响0人
李彬燊666
1:在工具上添加@service 注解
2:
@Resource
private IFileModelsService fileService;
@Resource
private IKeyWordService keyWordService;
private static FTPUtils ftpUtils;
@PostConstruct
public void init(){
ftpUtils = this;
ftpUtils.fileService = this.fileService;
ftpUtils.keyWordService = this.keyWordService;
}