controller层添加注解
@Valid @NotNull @RequestBody xxxxxListVo xxxxxxListVo
实体xxxxxListVo 里添加注解
@Builder @Data @AllArgsConstructor @NoArgsConstructor @Accessors(chain = true) public class xxxxxListVo { /** * 主键 */ @Valid @NotNull private List<Integer> ids; /** * 状态 */ @NotNull public Integer taskStatus; }