@ApiModelProperty("值")
@ApiModelProperty(value = "值类型(0:数字 1:字符串)", required = true, allowableValues = "0,1")
@NotNull(message = "[值]不能为空")
@NotBlank(message = "[值]不能为空")
@NotEmpty(message = "[值]不能为空")
@PositiveOrZero(message = "[值]必须是正整数")
@Min(value = 1, message = "[值]不能小于1")
@Max(value = 2, message = "[值]不能大于2")
@Size(max = 13,min=11, message = "[值]长度在11-13个字符之内")
@URL(message = "[值]URL网址不正确")
@Email(message = "[值]邮箱格式不正确")
@Pattern(regexp = "^1[0-9]{10}$",message = "[手机号]不合法")
@Pattern(regexp = "^男|女$", message = "[值]只能填写'男'或'女'")
@Pattern(regexp="/^(\\-|\\+)?(((\\d|[1-9]\\d|1[0-7]\\d|0{1,3})\\.\\d{0,6})|(\\d|[1-9]\\d|1[0-7]\\d|0{1,3})|180\\.0{0,6}|180)$/",message = "[值]地理经度不正确")
@Pattern(regexp = "/^(\\-|\\+)?([0-8]?\\d{1}\\.\\d{0,6}|90\\.0{0,6}|[0-8]?\\d{1}|90)$/",message = "[值]地理纬度不正确")
@Digits(integer = 9, fraction = 2, message = "[值]请保留2位小数")
@DecimalMin(value = "0.01", inclusive=true,message = "[值]必须大于等于0.01")
@DecimalMax(value = "999999999.99", inclusive=false,message = "[值]必须小于999999999.99")
@Past
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
Spring校验注解
最新推荐文章于 2024-09-26 11:18:03 发布