mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-15 07:45:54 +01:00
Improved Wizard (commeneted code to show how to use context events)
This commit is contained in:
parent
886f8b8f9b
commit
487cf8ec8b
@ -218,6 +218,8 @@ Congratulations to Daniele Teti and all the staff for the excellent work!" -- Ma
|
||||
|
||||
- ⚡ Support for Delphi 11.3 Alexandria
|
||||
- ⚡ Ability to use records in swagger param and response attributes [Issue 649](https://github.com/danieleteti/delphimvcframework/issues/649)
|
||||
- ⚡ Improved Wizard - now it produces commented code to show how to use `ContextEvents`
|
||||
- ⚡ Improved compatibility with Delphi 10.2 Tokyo and older versions (Thanks Mark Lobanov)
|
||||
- 🐞 FIX [Issue 648](https://github.com/danieleteti/delphimvcframework/issues/648) Thanks to [sf-spb](https://github.com/sf-spb)
|
||||
|
||||
## What's New in dmvcframework-3.2.3-radium
|
||||
|
@ -308,18 +308,31 @@ resourcestring
|
||||
' Config[TMVCConfigKey.ViewPath] := ''templates'';' + sLineBreak +
|
||||
' //Max Record Count for automatic Entities CRUD' + sLineBreak +
|
||||
' Config[TMVCConfigKey.MaxEntitiesRecordCount] := ''20'';' + sLineBreak +
|
||||
' //Enable Server Signature in response' + sLineBreak +
|
||||
' //Enable Server Signature in response' + sLineBreak +
|
||||
' Config[TMVCConfigKey.ExposeServerSignature] := ''true'';' + sLineBreak +
|
||||
' //Enable X-Powered-By Header in response' + sLineBreak +
|
||||
' Config[TMVCConfigKey.ExposeXPoweredBy] := ''true'';' + sLineBreak +
|
||||
// ' // Define a default URL for requests that don''t map to a route or a file (useful for client side web app)' + sLineBreak +
|
||||
// ' Config[TMVCConfigKey.FallbackResource] := ''index.html'';' + sLineBreak +
|
||||
' //Enable X-Powered-By Header in response' + sLineBreak +
|
||||
' Config[TMVCConfigKey.ExposeXPoweredBy] := ''true'';' + sLineBreak +
|
||||
' // Max request size in bytes' + sLineBreak +
|
||||
' Config[TMVCConfigKey.MaxRequestSize] := IntToStr(TMVCConstants.DEFAULT_MAX_REQUEST_SIZE);' + sLineBreak +
|
||||
' end);' + sLineBreak +
|
||||
' FMVC.AddController(%3:s);' + sLineBreak + sLineBreak +
|
||||
' %4:s ' + sLineBreak +
|
||||
' %5:s ' + sLineBreak +
|
||||
' ' + sLineBreak +
|
||||
' {' + sLineBreak +
|
||||
' FMVC.OnWebContextCreate( ' + sLineBreak +
|
||||
' procedure(const Context: TWebContext) ' + sLineBreak +
|
||||
' begin ' + sLineBreak +
|
||||
' // Initialize services to make them accessibile from Context ' + sLineBreak +
|
||||
' // Context.CustomIntfObject := TMyService.Create; ' + sLineBreak +
|
||||
' end); ' + sLineBreak +
|
||||
' ' + sLineBreak +
|
||||
' FMVC.OnWebContextDestroy(' + sLineBreak +
|
||||
' procedure(const Context: TWebContext)' + sLineBreak +
|
||||
' begin' + sLineBreak +
|
||||
' //Cleanup services, if needed' + sLineBreak +
|
||||
' end);' + sLineBreak +
|
||||
' }' + sLineBreak +
|
||||
'end;' + sLineBreak +
|
||||
sLineBreak +
|
||||
'procedure %1:s.WebModuleDestroy(Sender: TObject);' + sLineBreak +
|
||||
|
@ -347,8 +347,10 @@ uses
|
||||
Json.Schema.Field.Booleans;
|
||||
|
||||
function GetRecordType(const aQualifiedName: String): TRttiType;
|
||||
var
|
||||
lContext: TRttiContext;
|
||||
begin
|
||||
var lContext := TRttiContext.Create;
|
||||
lContext := TRttiContext.Create;
|
||||
try
|
||||
result := lContext.FindType(aQualifiedName);
|
||||
finally
|
||||
@ -705,7 +707,6 @@ var
|
||||
lEnumMappedValues: TList<string>;
|
||||
I: Integer;
|
||||
begin
|
||||
var lContext := TRttiContext.Create;
|
||||
for lField in aRttiType.GetFields do
|
||||
begin
|
||||
lSkipProp := False;
|
||||
@ -823,7 +824,9 @@ begin
|
||||
lJsonField.Required := lFieldSchemaDef.Required;
|
||||
lJsonField.Nullable := lFieldSchemaDef.Nullable;
|
||||
if not lFieldSchemaDef.Description.IsEmpty then
|
||||
begin
|
||||
TJsonFieldInteger(lJsonField).Description := lFieldSchemaDef.Description;
|
||||
end;
|
||||
|
||||
aJsonFieldRoot.AddField(lJsonField);
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user