Commit 397034df by 원종진

서버에 데이터 조회 실패시 처리 추가

parent afeacd2a
......@@ -69,28 +69,48 @@ begin
with aRecResult do
begin
code := SuperObj['code'].AsString;
data := AES128DecodeString(SuperObj['data'].AsString, aAESKey);
name := AES128DecodeString(SuperObj['name'].AsString, aAESKey);
DetailObj := SO(data);
for i:=0 to DetailObj.AsArray.Length-1 do
// Request 응답의 code 항목이 FAIL이면 조회 실패 메시지를 준비시키고
// 그 외의 경우는 data, name 값을 AES128Decoding 하여 디스플레이 준비시킨다.
if (SuperObj['code'] = nil) or (UpperCase(SuperObj['code'].AsString) = 'FAIL') then
begin
New(pDetailItem);
with pDetailItem^ do
begin
Key := '조회 실패';
if (SuperObj['msg'] <> nil) then
Value := SuperObj['msg'].AsString
else
Value := '';
end;
fResultList.Add(pDetailItem);
ListBox1.Items.Add('');
end else
begin
if ObjectFindFirst(DetailObj.AsArray.O[i], JSONArrIter) then
repeat
New(pDetailItem);
with pDetailItem^ do
begin
Key := JSONArrIter.key;
Value := JSONArrIter.val.AsString;
end;
fResultList.Add(pDetailItem);
ListBox1.Items.Add('');
until not ObjectFindNext(JSONArrIter);
ObjectFindClose(JSONArrIter);
code := SuperObj['code'].AsString;
name := AES128DecodeString(SuperObj['name'].AsString, aAESKey);
data := AES128DecodeString(SuperObj['data'].AsString, aAESKey);
DetailObj := SO(data);
for i:=0 to DetailObj.AsArray.Length-1 do
begin
if ObjectFindFirst(DetailObj.AsArray.O[i], JSONArrIter) then
repeat
New(pDetailItem);
with pDetailItem^ do
begin
Key := JSONArrIter.key;
Value := JSONArrIter.val.AsString;
end;
fResultList.Add(pDetailItem);
ListBox1.Items.Add('');
until not ObjectFindNext(JSONArrIter);
ObjectFindClose(JSONArrIter);
end;
end;
Self.Caption := name;
end;
end;
......@@ -141,3 +161,4 @@ begin
end;
end.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment