导入依赖
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.47</version>
</dependency>
1、实体转JSON
String str = JSON.toJSONString(entity);
2、JSON转实体
Entity entity = JSON.parseObject(content, Entity.class);