26 lines
691 B
PHP
26 lines
691 B
PHP
|
<?php
|
||
|
namespace Incoviba\Controller\API;
|
||
|
|
||
|
use Psr\Http\Message\ResponseInterface;
|
||
|
use Psr\Http\Message\ServerRequestInterface;
|
||
|
use Incoviba\Service;
|
||
|
|
||
|
class Informes
|
||
|
{
|
||
|
use withJson;
|
||
|
|
||
|
public function diario(ServerRequestInterface $request, ResponseInterface $response, Service\Informes\Diario $diarioService): ResponseInterface
|
||
|
{
|
||
|
$body = $request->getParsedBody();
|
||
|
$output = [
|
||
|
'input' => $body,
|
||
|
'data' => []
|
||
|
];
|
||
|
try {
|
||
|
$file = $request->getUploadedFiles()['file'];
|
||
|
$output['data'] = $diarioService->process($file);
|
||
|
} catch (\Error) {}
|
||
|
return $this->withJson($response, $output);
|
||
|
}
|
||
|
}
|