1.静态工具类中
@Component
public class EntityListUtils {
private static final Logger logger = LoggerFactory.getLogger(EntityListUtils.class);
@Autowired
private ConfigProperties configPropertiesAutowired;
private static ConfigProperties configProperties;
@PostConstruct
public void init() {
configProperties = this.configPropertiesAutowired;
}
2.属性类中
@Configuration
@ConfigurationProperties(prefix = "qlinchao")
public class ConfigProperties {
public ConfigProperties() {
}
private String strategyFilepath;
private String totalprofitFilepath;
//get,set方法
}