spring boot Jackson忽略字段不序列化字段
使用JsonIgnoreProperties注解忽略多个字段
@JsonIgnoreProperties({ "summary", "author" })
public class ArticleIgnoreProperties {
private String title;
private String summary;
private String content;
private String author;
// 省略getter、setter方法
@Override
public String toString() {
return "ArticleIgnoreProperties [title=" + title + ", summary=" + summary + ", content=" + content + ", author="
+ author + "]";
}
}