When the object is converted to a Json string, the specified attribute is ignored

1. When FastJson converts to Json string, ignore the specified properties
1.1 Use annotation @JSONField

import java.io.Serializable;
public class FastJsonInputBean implements Serializable {     @JSONField(serialize = false)     private String contractImage; } 2. JackSon ignores the field @JsonIgnoreProperties primary key Or use @JsonIgnore on the field





 

@JsonIgnoreProperties({"contractTemplateId", "contractImage"})

public class JackSonInputBean implements Serializable {


    @JsonIgnore
    private String contractId;


}

 

 

Guess you like

Origin blog.csdn.net/zhaofuqiangmycomm/article/details/104499166