entity上增加@JsonIgnoreProperties注解,標記需要忽略的屬性,支持多個
@Entity
@JsonIgnoreProperties(value={"status","updateTime"})
public class GoldSell implements Serializable{
還有一種方式,直接注解在具體的property上,效果一樣
@JsonIgnore
private Integer status;
不過這兩種都是影響屬性,會影響所有的接口,如果有的接口需要有的不需要呢?