2015-01-19 15:26:41 +01:00
|
|
|
unit RESTServicesU;
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
uses
|
2017-01-18 21:53:53 +01:00
|
|
|
Generics.Collections, WinesBO, MVCFramework.RESTAdapter,
|
2017-05-25 16:57:49 +02:00
|
|
|
MVCFramework.Serializer.Commons, MVCFramework.Commons;
|
2015-01-19 15:26:41 +01:00
|
|
|
|
|
|
|
type
|
|
|
|
|
|
|
|
IWineResource = interface(IInvokable)
|
|
|
|
['{068C51B2-F413-48ED-97CE-463234DB3E41}']
|
|
|
|
|
2020-01-08 20:34:02 +01:00
|
|
|
[RESTResource(HttpGet, '/api/wines')]
|
2017-08-21 15:31:31 +02:00
|
|
|
[MVCListOf(TWine)]
|
2015-02-17 09:40:55 +01:00
|
|
|
[Mapping(TWines)]
|
|
|
|
procedure GetWineList(AAsynchReq: IAsynchRequest);
|
2015-01-19 15:26:41 +01:00
|
|
|
|
2020-01-08 20:34:02 +01:00
|
|
|
[RESTResource(httpPOST, '/api/wines')]
|
2015-02-17 09:40:55 +01:00
|
|
|
procedure SaveWine([Body] AWine: TWine; AAsynchReq: IAsynchRequest);
|
2015-01-19 15:26:41 +01:00
|
|
|
|
2020-01-08 20:34:02 +01:00
|
|
|
[RESTResource(httpPUT, '/api/wines/{id}')]
|
2015-02-17 09:40:55 +01:00
|
|
|
procedure UpdateWineById([Param('id')] AID: integer; [Body] AWine: TWine;
|
|
|
|
AAsynchReq: IAsynchRequest);
|
2015-01-19 15:26:41 +01:00
|
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
end.
|