import com.alibaba.fastjson.JSON;
// dto 转 json
String json = JSON.toJSONString(dto)
// json 转 dto
DTO dto = JSON.parseObject(str, DTO.class)
import com.alibaba.fastjson.JSON;
// dto 转 json
String json = JSON.toJSONString(dto)
// json 转 dto
DTO dto = JSON.parseObject(str, DTO.class)
本文标题:DTO & JSON 互相转换
本文链接:https://www.haomeiwen.com/subject/akjdhftx.html
网友评论