source upload

This commit is contained in:
Razor12911
2022-01-17 22:16:47 +02:00
parent 12936d065b
commit 098e8c48de
1778 changed files with 1206749 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
unit RestMethodsInterfaceUnit;
interface
uses
mORMot;
type
rCustomRecord = record
ResultCode: integer;
ResultStr: string;
ResultArray: array of string;
ResultTimeStamp: TDateTime;
end;
rCustomComplicatedRecord = record
SimpleString: string;
SimpleInteger: integer;
AnotherRecord: rCustomRecord;
end;
IRestMethods = interface(IInvokable)
['{4EB49814-A4A9-40D2-B85A-137DDF43C72C}']
function HelloWorld(): string;
function Sum(val1, val2: Double): Double;
function GetCustomRecord(): rCustomRecord;
function SendCustomRecord(const CustomResult: rCustomRecord): Boolean;
function SendMultipleCustomRecords(const CustomResult: rCustomRecord; const CustomComplicatedRecord: rCustomComplicatedRecord): Boolean;
function GetMethodCustomResult(): TServiceCustomAnswer; // without default {result:[]}
// function ProperErrorHanding(): boolean;
end;
const
ROOT_NAME = 'service';
SERVICE_INSTANCE_IMPLEMENTATION = TServiceInstanceImplementation.sicSingle;
NAMED_PIPE_NAME = 'Rest_Test.0001';
CONNECTION_TIMEOUT = 3000; // Default mORMot value
implementation
initialization
TInterfaceFactory.RegisterInterfaces([TypeInfo(IRestMethods)]); // to use directly IRestMethods instead of TypeInfo(IRestMethods)
end.