mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-16 00:05:53 +01:00
36 lines
698 B
ObjectPascal
36 lines
698 B
ObjectPascal
unit MainControllerU;
|
|
|
|
interface
|
|
|
|
uses
|
|
MVCFramework, MVCFramework.Commons, MVCFramework.JSONRPC, JsonDataObjects;
|
|
|
|
type
|
|
TMyDerivedController = class(TMVCJSONRPCController)
|
|
public
|
|
function Subtract(aParams: TMVCJSONArray): Integer;
|
|
procedure DoSomething;
|
|
|
|
end;
|
|
|
|
implementation
|
|
|
|
uses
|
|
System.SysUtils, MVCFramework.Logger, System.StrUtils;
|
|
|
|
{ TMyDerivedController }
|
|
|
|
procedure TMyDerivedController.DoSomething;
|
|
begin
|
|
|
|
end;
|
|
|
|
function TMyDerivedController.Subtract(aParams: TMVCJSONArray): Integer;
|
|
begin
|
|
if aParams.Count <> 2 then
|
|
raise EMVCJSONRPCException.Create('Method "subtract" expects exactly 2 params');
|
|
Result := aParams[0].IntValue - aParams[1].IntValue;
|
|
end;
|
|
|
|
end.
|