我想根据有关 mORMot 中 REST 路由的信息 ( http://synopse.info/forum/viewtopic.php?id=1833 ) 配置对我的 REST 资源的非常简单的访问。
我需要调用 url as localhost/api/apservice/station/1
,但下面的代码仅适用于调用 aslocalhost/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/station/1 -
return details for station=1
- 本地主机/api/apservice/站/组 -
return all groups from station
- localhost/api/apservice/customers/{aCustomerId}/reports/orders/{aOrderNumber}/details?Filter={aDetailFilter}'