使用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 + "]";
}
}
原文:https://www.cnblogs.com/mingyue5826/p/14345252.html