mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-15 15:55:54 +01:00
f54f74522c
- Added static method `HTTP_STATUS.ReasonStringFor(HTTPStatusCode)` wich returns the standard `ReasonString` for a given HTTP status code. - Improved handling of `TMVCErrorResponse` information - mid-air-collision handling now uses SHA1 instead of MD5 - Added `MVCFramework.Commons.MVC_HTTP_STATUS_CODES` const array containing all the HTTP status codes wich its `ReasonString`
36 lines
658 B
ObjectPascal
36 lines
658 B
ObjectPascal
unit MainControllerU;
|
|
|
|
interface
|
|
|
|
uses
|
|
MVCFramework, MVCFramework.Commons, MVCFramework.Serializer.Commons;
|
|
|
|
type
|
|
[MVCPath('/api')]
|
|
TMyController = class(TMVCController)
|
|
public
|
|
[MVCPath]
|
|
[MVCHTTPMethod([httpGET])]
|
|
procedure Index;
|
|
end;
|
|
|
|
implementation
|
|
|
|
uses
|
|
MVCFramework.ActiveRecord,
|
|
MVCFramework.SQLGenerators.PostgreSQL,
|
|
System.SysUtils,
|
|
MVCFramework.Logger,
|
|
System.StrUtils,
|
|
Entities;
|
|
|
|
procedure TMyController.Index;
|
|
begin
|
|
Render(ObjectDict().Add('people',
|
|
//TMVCActiveRecord.SelectRQL<TPerson>('and(gt(id, 2),lt(id,6))', 100)
|
|
TMVCActiveRecord.SelectRQL<TPerson>('sort(+personSurname)', 10)
|
|
));
|
|
end;
|
|
|
|
end.
|