mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 14:09:17 +02:00
* Correctly get callback type
This commit is contained in:
parent
8cedb10c3a
commit
7148866f8d
@ -104,6 +104,7 @@ type
|
|||||||
function GetParam(aIndex : Integer): TAPIServiceMethodParam;
|
function GetParam(aIndex : Integer): TAPIServiceMethodParam;
|
||||||
function GetParamCount: Integer;
|
function GetParamCount: Integer;
|
||||||
function GetRequestBodyType: String;
|
function GetRequestBodyType: String;
|
||||||
|
function GetResultCallbackType: String;
|
||||||
function GetResultType(AIndex: TNameType): String;
|
function GetResultType(AIndex: TNameType): String;
|
||||||
protected
|
protected
|
||||||
// override this if you want to subclass the parameter
|
// override this if you want to subclass the parameter
|
||||||
@ -136,7 +137,7 @@ type
|
|||||||
// Component result Dto type
|
// Component result Dto type
|
||||||
Property ResultDtoType : String index ntPascal Read GetResultType;
|
Property ResultDtoType : String index ntPascal Read GetResultType;
|
||||||
// Callback type for result.
|
// Callback type for result.
|
||||||
Property ResultCallBackType : String Read FResultCallbackType write FResultCallBackType;
|
Property ResultCallBackType : String Read GetResultCallbackType write FResultCallBackType;
|
||||||
// OpenAPI Operation for this method.
|
// OpenAPI Operation for this method.
|
||||||
Property Operation : TApiOperation Read FOperation;
|
Property Operation : TApiOperation Read FOperation;
|
||||||
// Pascal name for the method.
|
// Pascal name for the method.
|
||||||
@ -495,6 +496,18 @@ begin
|
|||||||
Result:='';
|
Result:='';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TAPIServiceMethod.GetResultCallbackType: String;
|
||||||
|
begin
|
||||||
|
Result:=FResultCallbackType;
|
||||||
|
if Result='' then
|
||||||
|
begin
|
||||||
|
Result:=ResultType;
|
||||||
|
if Result='' then
|
||||||
|
Result:='VoidResult';
|
||||||
|
Result:='T'+Result+'CallBack';
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
function TAPIServiceMethod.GetResultType(AIndex: TNameType): String;
|
function TAPIServiceMethod.GetResultType(AIndex: TNameType): String;
|
||||||
begin
|
begin
|
||||||
if assigned(FResultDataType) then
|
if assigned(FResultDataType) then
|
||||||
|
Loading…
Reference in New Issue
Block a user