常见:使用fastjson进行需要处理,比如字段为null依然序列化问题。那么fastjson的@JSONField就能很好的解决这些问题。
//fastjson2 设置参数为null时参与序列化
@JSONField(serializeFeatures = JSONWriter.Feature.WriteMapNullValue)
private String userPhone;
//fastjson 设置参数为null时参与序列化
@JSONField(serialzeFeatures = SerializerFeature.WriteMapNullValue)
private String userPhone;