String remotePost = restTemplateUtil.remotePost(url, method, json, token);
//parseObject方法适用于转化数组
JSONObject data = JSONObject.parseObject(remotePost);
JSONObject jsonObject = data.getJSONObject("data");
CallGetXczxGwqBillVo xczxGwqBillVo = jsonObject.toJavaObject(CallGetXczxGwqBillVo.class);
//转化为的对象
@Data
public class CallGetXczxGwqBillVo {
private String total;
private List<XczxGwqBillVo> records;
private int pages;
}
JSONObject 提取string类型data并转化为object对象
最新推荐文章于 2023-09-23 21:16:06 发布