华清远见TCP/IP网络协议
属性注入
@ConfigurationProperties
@ConfigurationProperties(prefix = "person")注解的作用是将配置文件中以person开头的属性值通过setXX()方法注入到实体类对应属性中
@Component@ConfigurationProperties(prefix = "person") //将配置文件中以person开头的属性注入到该类中@Datepublic class Person {
private int id; //id
private String name; //名称}//yamlperson.id=1