Home > Back-end >  Using HTTP. Get the data as follows, and json
Using HTTP. Get the data as follows, and json

Time:11-02

The style is as follows:
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) traversal get
User_id, user_name, sign_time groups. Id

For the statement

CodePudding user response:

Return the data
{
"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" : "306 LSH,"
"Remark" : null,
"Mobile" : ", "
"Groups" : [
{
"Id" : 1,
"Name" : "default group,"
"Type" : 1,
"Devices", null,
"Is_default" : null
}
],
"Capture_picture" : "5 d886e584bb1c40001ad458e,"
"Capture_bg_picture" : "5 d886e584bb1c40001ad458f,"
"Avatar" : "5 d7a680a4bb1c40001ac80f6,"
"User_id" : 100100,
"User_name" : "Jeff,"
"User_type" : 1,
"Group_id" : null,
"Group_name" : null,
"Device_name" : "lsh02,"
"Device_ldid" : "bfefb52b1b88237d195c1ad944063 SPS - 257,"
"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
}
}

CodePudding user response:

A post a few days ago I mentioned a json parsing statements, you go to see if there is any help, you may need to change yourself,

CodePudding user response:

According to the need to adjust the following code, can be encapsulated in the parameter return structure,
 

The function analysisJson (json: string) : Boolean;
Var
I: integer;
Ja: TSuperArray;
Jo: ISuperObject;
The begin
Result:=false;
Jo:=TSuperObject ParseString (PWideChar (json), false);
If Jo=nil then exit;

Ja: Jo=[' data. The data. Record_list] AsArray;
If ja=nil then exit;

For I:=0 to ja. Do Length - 1
The begin
ShowMessage (ja [I] [' user_name] AsString) are identical.
ShowMessage (IntToStr (ja [I] [' user_id '] AsInteger));
end;
end;
  • Related