注解
@JsonInclude(JsonInclude.Include.NON_NULL)
在实体类上加入此注解,可以剔除掉不需要的null属性
示例
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ImprovementReceipt extends BaseEntity {
private Long rectificationid;
private Long sastaskid;
private Long sasprojectid;
private Long sasprojectcontentid;
private Long sascontentscoreid;
}
在api返回时null的属性将不会返回给前端接受