- @ApiModelProperty(value = "小组id")
- @NotEmpty(message = "小组id 不能为空")
- private Integer teamId;
1.假如不小心Integer使用@NotEmpty注解报错
提示:
No validator could be found for constraint 'javax.validation.constraints.NotEmpty' validating type 'java.lang.Integer'. Check configuration for 'teamId' error type: javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint 'javax.validation.constraints.NotEmpty' validating type 'java.lang.Integer'. Check configuration for 'teamId'
解决方案:
@NotNull换成这个
@ApiModelProperty(value = "小组id")
@NotNull(message = "小组id 不能为空")
private Integer teamId;