方式一
/**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