樣式如下:
Memo1
{"code":200,"message":"OK","data":{"total":166,"size":20,"data":{"total":166,"user_count":166,"guest_count":0,"stranger_count":0,"blacklist_count":0,"abnormal_body_temperature_count":0,"record_list":[{"id":608939,"direction":0,"latitude":null,"longitude":null,"address":null,"location":"172.16.28.253","remark":null,"groups":[{"id":4,"name":"學","type":1,"devices":null,"is_default":null}],"mobile":"001491","mask":0,"capture_picture":"5f02bf1e9688550001b32e94","capture_bg_picture":"5f02bf1e9688550001b32e95","avatar":"5d518ec996885500014f71b4","heat_avatar":null,"user_id":537,"user_name":"李志","user_type":1,"group_id":null,"group_name":null,"device_name":"STSK","device_ldid":"SKP-12621fc440198a5b3c97e2717c1ff484","sign_time":1594015518,"country_code":null,"place_code":null,"on_business":0,"entry_mode":1,"sign_time_zone":"GMT+08:00","verify_score":0.971,"mis_id":null,"mis_type":null,"doc_photo":"","ic_number":"","id_number":"","abnormal_type":0,"job_number":"001491","user_ic_number":"","user_id_number":"JMJR3Bi9t65uBoUT3JGv7fbYh8RzcAbG","reception_user_id":0,"reception_user_name":null,"sign_date":"2020-07-06","user_remark":"","body_temperature":null,"delete_avatar":1},{"id":608938,"direction":0,"latitude":null,"longitude":null,"address":null,"location":"172.16.28.253","remark":null,"groups":
(superobject)遍歷得到
user_id,user_name,sign_time,groups.id
求陳述句
uj5u.com熱心網友回復:
回傳資料{
"code": 200,
"message": "OK",
"data": {
"total": 118,
"size": 3,
"data": {
"total": 118,
"user_count": 35,
"guest_count": 0,
"stranger_count": 65,
"record_list": [
{
"id": 1361801,
"direction": 0,
"latitude": null,
"longitude": null,
"address": null,
"location": "306lsh",
"remark": null,
"mobile": "",
"groups": [
{
"id": 1,
"name": "默認組",
"type": 1,
"devices": null,
"is_default": null
}
],
"capture_picture": "5d886e584bb1c40001ad458e",
"capture_bg_picture": "5d886e584bb1c40001ad458f",
"avatar": "5d7a680a4bb1c40001ac80f6",
"user_id": 100100,
"user_name": "Jeff",
"user_type": 1,
"group_id": null,
"group_name": null,
"device_name": "lsh02",
"device_ldid": "SPS-257bfefb52b1b88237d195c1ad944063",
"sign_time": 1569222232,
"country_code": null,
"place_code": null,
"on_business": 0,
"entry_mode": 1,
"sign_time_zone": "GMT+08:00",
"verify_score": null,
"mis_id": null,
"mis_type": null,
"doc_photo": "",
"ic_number": "",
"id_number": "",
"abnormal_type": null,
"job_number": "",
"user_ic_number": "",
"user_id_number": "",
"reception_user_id": 0,
"reception_user_name": "",
"sign_date": "2019-11-26",
"user_remark": "",
"body_temperature": 37.3,
"mask": 1
}
]
},
"page_num": 1,
"page_size": 3,
"total_page": 40
}
}
uj5u.com熱心網友回復:
前幾天我的一個帖子里提到了json決議陳述句,你去看看有沒有幫助。可能需要你自己修改一下。uj5u.com熱心網友回復:
根據需要對以下代碼調整下,可以封裝在引數回傳結構體。
function analysisJson(json: string): boolean;
var
i: integer;
ja: TSuperArray;
jo: ISuperObject;
begin
result := false;
jo := TSuperObject.ParseString(PWideChar(json),false);
if jo=nil then exit;
ja := jo['data.data.record_list'].AsArray;
if ja=nil then exit;
for i:=0 to ja.Length-1 do
begin
ShowMessage(ja[i]['user_name'].AsString);
ShowMessage(IntToStr(ja[i]['user_id'].AsInteger));
end;
end;
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/9604.html
標籤:網絡通信/分布式開發
上一篇:錯誤使用 network/train (line 340)Inputs and targets have different numbers of samp
下一篇:Sql怎么在表中添加圖片?
