Se avanza en la pagina de inicio, falta los indicadores
This commit is contained in:
23
common/Controller/Web/Indicadores.php
Normal file
23
common/Controller/Web/Indicadores.php
Normal 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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user