Files
oficial/app/src/Controller/API/Informes.php
2024-01-17 10:33:11 -03:00

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);
}
}