第一种:
String格式为:
String result = "{"code":200,"code":"0","message":"SUCCESS"}"
复制
使用:
JSONObject json = JSONObject.parseObject(result);
复制
第二种:
String格式为:
result: { "code": 200, "message": "查询成功", "result": { "records": [ { "jobName": "高级开发工程师", "jobExperience": "一年以下", "education": "本科" }, { "jobName": "高级开发工程师", "jobExperience": "一年以下", "education": "本科" } ], "total": 1, "size": 10, "current": 1, "pages": 1 } }
复制
使用:
JSONObject json = (JSONObject) JSON.toJSON(result);
复制