JSR303 data check
spring-boot may be used @validated check data, if the data exception thrown will be unified, convenient unitary anomaly centers.
@Component //注册bean
@Validated //引入数据校验
public class demo {
@Email //name必须是邮箱格式
private String email;
}