方式一
/**ide
prefix = "person":配置文件中哪一个下面的全部属性进行一一映射
*/
@Component
@ConfigurationProperties(prefix = "person")
public class Test{
。。。。。。
。。。。。。。
}spa
方式二
/**code
prefix = "person":配置文件中哪一个下面的全部属性进行一一映射
*/
@Component
@ConfigurationProperties(prefix = "person")
public class Test{
。。。。。。
。。。。。。。
}it
/**io
prefix = "person":配置文件中哪一个下面的全部属性进行一一映射
*/
@PropertySource(value = {"classpath:person.properties"})
@Component
@ConfigurationProperties(prefix = "person")
//@Validated
public class Test{
......
}class