当前位置: 首页> 汽车> 时评 > 三亚发布最新疫情通报_电商的运营推广_百度知道网页入口_aso搜索排名优化

三亚发布最新疫情通报_电商的运营推广_百度知道网页入口_aso搜索排名优化

时间:2025/7/10 20:39:23来源:https://blog.csdn.net/a14654/article/details/115354391 浏览次数: 0次
三亚发布最新疫情通报_电商的运营推广_百度知道网页入口_aso搜索排名优化

使用Jackson的方式

//第一种方式,使用@JsonIgnore注解标注在属性上,忽略指定属性
public  class PropertyDTO {@JsonProperty("disable")private Integer disable;@JsonProperty("placeholder")private String placeholder;//使用@JsonIgnore注解,忽略此属性,前端不会拿到该属性@JsonIgnoreprivate String validate;
}//第二种方式,使用@JsonIgnoreProperties标注在类上,可以忽略指定集合的属性
@JsonIgnoreProperties({"validate"})
public  class PropertyDTO {@JsonProperty("disable")private Integer disable;@JsonProperty("placeholder")private String placeholder;private String validate;
}

注意点

public  class PropertyDTO {@JsonProperty("disable")private Integer disable;@JsonProperty("placeholder")private String placeholder;@JsonProperty("validate")@JsonIgnoreprivate String validate;
}

同时使用@JsonProperty@JsonIgnore时,可能会导致@JsonIgnore失效,前端依旧拿到该属性。

使用fastjson时
使用@JSONField(serialize = false)注解

关键字:三亚发布最新疫情通报_电商的运营推广_百度知道网页入口_aso搜索排名优化

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: