1、数据校验
@Validated
需要先导入starter
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
2、使用
@Component
@ConfigurationProperties(prefix = "person")
@Validated
public class Person {
@Email
private String name;
private Integer age;
private Boolean happy;
private Date birth;
private Map