Dalsi zmeny
This commit is contained in:
@ -76,6 +76,22 @@ type
|
||||
|
||||
end;
|
||||
|
||||
[MVCPath('/emp/vytezeni')]
|
||||
TEMPVytezeniDoklController = class(TBaseController)
|
||||
private
|
||||
FSelfSvc: TEMPVytezeniDoklService;
|
||||
public
|
||||
constructor Create; override;
|
||||
destructor Destroy; override;
|
||||
|
||||
[MVCPath('/fprij/post/($id)')]
|
||||
[MVCHTTPMethod([httpGET])]
|
||||
[MVCSwagSummary('EMP - vyt<79><74>en<65> dokument<6E> dokladu FaktPrij', 'Po<50>le dokument dokladu Faktury p<>ijat<61> na AiDOCU API', 'EMPVytezDokFPrijPostByID')]
|
||||
[MVCSwagParam(plPath, 'id', 'ID dokladu Faktury p<>ijat<61>', ptString, true)]
|
||||
[MVCProduces('application/json')]
|
||||
procedure FPrij_PostByID (id: string);
|
||||
end;
|
||||
|
||||
|
||||
implementation
|
||||
uses
|
||||
@ -195,22 +211,22 @@ uses
|
||||
|
||||
|
||||
procedure TEMPDokumentAtestController.GetMeta;
|
||||
begin
|
||||
try
|
||||
Render(ObjectDict().Add('data', GetDokumentService.GetMeta));
|
||||
except
|
||||
begin
|
||||
try
|
||||
Render(ObjectDict().Add('data', GetDokumentService.GetMeta));
|
||||
except
|
||||
{$IFDEF NORENDER400}
|
||||
RenderStatusMessage (200);
|
||||
RenderStatusMessage (200);
|
||||
{$ELSE}
|
||||
on E: EServiceException do
|
||||
begin
|
||||
raise EMVCException.Create(E.Message, '', 0, 404);
|
||||
end
|
||||
else
|
||||
raise;
|
||||
on E: EServiceException do
|
||||
begin
|
||||
raise EMVCException.Create(E.Message, '', 0, 404);
|
||||
end
|
||||
else
|
||||
raise;
|
||||
{$ENDIF}
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
@ -243,4 +259,48 @@ uses
|
||||
end;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{ TEMPVytezeniDoklService }
|
||||
|
||||
constructor TEMPVytezeniDoklController.Create;
|
||||
begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
|
||||
|
||||
destructor TEMPVytezeniDoklController.Destroy;
|
||||
begin
|
||||
inherited;
|
||||
end;
|
||||
|
||||
|
||||
procedure TEMPVytezeniDoklController.FPrij_PostByID (id: string);
|
||||
var iId: integer;
|
||||
begin
|
||||
id:= sanitizeSQLString (id);
|
||||
if not(TryStrToInt(id, iId)) then
|
||||
iId:= 0;
|
||||
|
||||
try
|
||||
Render(ObjectDict().Add('data', GetEMPVytezeniDoklService.FPrij_PostByID (iId))); // viz uSvcCustom.pas
|
||||
except
|
||||
{$IFDEF NORENDER400}
|
||||
RenderStatusMessage (200);
|
||||
{$ELSE}
|
||||
on E: EServiceException do
|
||||
begin
|
||||
raise EMVCException.Create(E.Message, '', 0, 404);
|
||||
end
|
||||
else
|
||||
raise;
|
||||
{$ENDIF}
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
end.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user