mORMot and Open Source friends
Diff
Not logged in

Differences From Artifact [943b4fe02c4ff5cd]:

To Artifact [76b0351e0617c3b5]:


8 SysUtils; 8 SysUtils; 9 9 10 type 10 type 11 // you'll have warning about abstract classes, because TSQLRestServer doesn't 11 // you'll have warning about abstract classes, because TSQLRestServer doesn't 12 // implement any database engine, but it doesn't matter here 12 // implement any database engine, but it doesn't matter here 13 TServiceServer = class(TSQLRestServer) 13 TServiceServer = class(TSQLRestServer) 14 published 14 published 15 function Sum(aRecord: TSQLRecord; aParameters: PUTF8Char; | 15 function Sum(aSession: Cardinal; aRecord: TSQLRecord; aParameters: PUTF8Char 16 const aSentData: RawUTF8; var aResp, aHead: RawUTF8): Integer; | 16 const aSentData: RawUTF8; out aResp, aHead: RawUTF8): Integer; 17 end; 17 end; 18 18 19 19 20 { TServiceServer } 20 { TServiceServer } 21 21 22 function TServiceServer.Sum(aRecord: TSQLRecord; aParameters: PUTF8Char; | 22 function TServiceServer.Sum(aSession: Cardinal; aRecord: TSQLRecord; 23 const aSentData: RawUTF8; var aResp, aHead: RawUTF8): Integer; | 23 aParameters: PUTF8Char; const aSentData: RawUTF8; out aResp, aHead: RawUTF8): 24 var a,b: Extended; 24 var a,b: Extended; 25 begin 25 begin 26 if not UrlDecodeNeedParameters(aParameters,'A,B') then begin 26 if not UrlDecodeNeedParameters(aParameters,'A,B') then begin 27 result := 404; // invalid Request 27 result := 404; // invalid Request 28 exit; 28 exit; 29 end; 29 end; 30 while aParameters<>nil do begin 30 while aParameters<>nil do begin