在实体字段上添加注解: @JsonInclude(JsonInclude.Include.NON_EMPTY) 所在包: import com.fasterxml.jackson.annotation.JsonInclude;