1.yml文件
person:
name: lw
age: 18
boss: false
birth: 2019/06/29
maps:
V1: K1
V2: abc
list: [cat,dog,pig]
dog:
name: 旺财
age: 3
2.一个具体的类(注意:@ConfigurationProperties(prefix = "person")和@DateTimeFormat(pattern = "yyyy/MM/dd")注解)
@Component
@ConfigurationProperties(prefix = "person")
@Data
public class Person {
private String name;
private Integer age;
private boolean boss;
@DateTimeFormat(pattern = "yyyy/MM/dd")
private LocalDate birth;
private Map<String, Object> maps;
private List<Object> list;
private Dog dog;
}