controller:
@PostMapping("WSendList")
public ApiResult getList( @ApiParam(required = true) @Valid @RequestBody PageListIO<WSendIO> body) {
...
return ApiResult.success();
}
PageListIO对象:
WSendIO对象:
public class WSendIO implements Serializable{
@NotNull(message = "字段 不能为空")
private Integer isTest;
...
}
这样请求WSendIO中的验证时不会执行的
解决方案:在PageListIO中使用@Valid