mORMot での REST ルーティングに関する情報 ( http://synopse.info/forum/viewtopic.php?id=1833 )に基づいて、REST リソースへの非常に単純なアクセスを構成したいと考えています。
url を として呼び出す必要がありますlocalhost/api/apservice/station/1
が、以下のコードは として呼び出す場合にのみ機能しますlocalhost/api/apservice/station?stationid={stationid}
IAPIService = interface(IInvokable)
['{0F23D411-C3F0-451A-8580-AB5BE6E521E6}']
function Station(StationID: Integer; out Station: TSQLStation): TCQRSResult;
end;
TAPIService = class(TInterfacedObject, IAPIService)
private
fDbConnection : TSQLDBConnectionProperties;
public
constructor Create(const aProps: TSQLDBConnectionProperties ); overload;
public
function Station(StationID: Integer; out Station: TSQLStation): TCQRSResult;
end;
リソースへの REST ルーティングを正しく構成する方法を教えてください。次の例が必要です。
- ローカルホスト/api/apservice/ステーション/1 -
return details for station=1
- ローカルホスト/api/apservice/ステーション/グループ -
return all groups from station
- localhost/api/apservice/customers/{aCustomerId}/reports/orders/{aOrderNumber}/details?Filter={aDetailFilter}'