使用fastjson
public static void main(String[] args) {
String uu = "{ " +
" \"data\": { " +
" \"is_admin\": false, " +
" \"app_id\": 10, " +
" \"user\": { " +
" \"id\": \"2\", " +
" \"phone\": \"186xxxxxx\", " +
" \"area\": \"beijing\", " +
" \"is_active\": \"1\", " +
" \"is_admin\": false " +
" } " +
" }, " +
" \"expire\": 18000 " +
"}";
JSONObject jsonObject = new JSONObject(JSON.parseObject(uu));
JSONObject jsonObject1 = jsonObject.getJSONObject("data").getJSONObject("user");
Project project = JSONObject.parseObject(jsonObject1.toString(), Project.class);
System.out.println(project.getId());
}