json-view基于 jackson 的扩展接口实现
com.fasterxml.jackson.databind.JsonSerializer
maven最新版本已经更新到1.0.1
pom
<!-- https://mvnrepository.com/artifact/com.monitorjbl/json-view --> <dependency> <groupId>com.monitorjbl</groupId> <artifactId>json-view</artifactId> <version>1.0.1</version> </dependency>
json-view GitHub地址
https://github.com/monitorjbl/json-view
争对springboot对返回的对象字段进行格式化
代码是基于json-view上改造的。
现有功能:
1.返回数据加密
原json
{"id": "1000", "name": "张三", "phone": "13088888888"}
加密后的json
{"id": "1000", "name": "张三", "phone": "字段不可见"}
2.返回json字段增强
原json
{"id": "1000", "name": "张三", "phone": "13088888888"}
字段增强后的json
{"id": "1000", "name": "张三", "phone": "13088888888","namePinYin": "zhangsan"}