0
我想根據關於mORMot中REST路由的信息(http://synopse.info/forum/viewtopic.php?id=1833)配置對REST資源的非常簡單的訪問。在mORMot中配置REST資源
我需要調用網址爲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
- 本地主機/ API/apservice /客戶/ {aCustomerId}/reports/orders/{aOrderNumber}/details?Filter = {aDetailFilter}'
難道就沒有任何可以配置方便路由能力> – SpanishBoy