2.获取配置文件中的值
author.name=revin
author.age=28 public class Test {
@Value("${author.name}")
private String name;
@Value("${author.age}")
private Long age;
///...省略 set get方法
}@ConfigurationProperties(prefix="author")
public class AuthorSettings {
private String name;
private Long age;
///...set get 省略
}Last updated