Se avanza en la pagina de inicio, falta los indicadores

This commit is contained in:
2020-05-12 11:07:58 -04:00
parent fbe1e4f7e5
commit 9084ea5edb
39 changed files with 1027 additions and 45 deletions

View File

@ -0,0 +1,23 @@
<?php
namespace ProVM\KI\Common\Controller\Web;
use Psr\Container\ContainerInterface as Container;
use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Http\Message\ResponseInterface as Response;
use Carbon\Carbon;
use ProVM\KI\Common\Service\Indicadores as Service;
class Indicadores {
public function get(Request $request, Response $response, Container $container, Service $service, $indicador) {
$valor = $service->get($indicador, Carbon::today());
$output = [
'sim' => $indicador,
'valor' => $valor
];
$response->getBody()->write(json_encode($output));
return $response
->withHeader('Content-Type', 'application/json')
->withStatus(201);
}
}