springboot 实现配置文件给常量赋值
@Component
@ConfigurationProperties(prefix = "task.cron")
public class TaskCronParam implements InitializingBean {
private String testCron;
public static String TEST_CRON;
@Override
public void afterPropertiesSet() throws Exception {
TEST_CRON =testCron;
}
}