This commit is contained in:
2021-12-25 23:17:15 -03:00
parent bbee033a8a
commit 3580738273
23 changed files with 755 additions and 81 deletions

View File

@ -1,12 +1,8 @@
<?php
use Psr\Http\Message\ServerRequestInterface as Request;
use Psr\Http\Message\ResponseInterface as Response;
use Incoviba\API\Common\Service\Auth as Service;
use Incoviba\API\Common\Controller\Auth;
$app->get('/auth/generate', function(Request $request, Response $response, Service $service): Response {
$key = $service->generate();
$response->getBody()->write(json_encode(['key' => $key]));
return $response
->withStatus(200)
->withHeader('content-type', 'application/json');
});
$app->post('/auth/login[/]', [Auth::class, 'login']);
$app->get('/auth/generate[/]', [Auth::class, 'generate']);
$app->post('/auth/validate[/]', [Auth::class, 'validate']);
$app->post('/auth/user[/]', [Auth::class, 'user']);
$app->post('/auth/logout[/]', [Auth::class, 'logout']);

View File

@ -0,0 +1,5 @@
<?php
use Incoviba\API\Common\Controller\Configs;
$app->get('/config/{config_name}', [Configs::class, 'get']);
$app->post('/config', [Configs::class, 'set']);

View File

@ -1,8 +1,18 @@
<?php
use Incoviba\API\Common\Controller\Proyectos;
use Incoviba\API\Common\Controller\Proyectos\Cuotas;
use Incoviba\API\Common\Controller\Proyectos\Cierres;
$app->group('/proyectos', function ($app) {
$app->post('/add[/]', [Proyectos::class, 'add']);
$app->group('/cuotas', function($app) {
$app->get('/hoy[/]', [Cuotas::class, 'hoy']);
$app->get('/mes[/]', [Cuotas::class, 'mes']);
$app->get('/pendientes[/]', [Cuotas::class, 'pendientes']);
});
$app->group('/cierres', function($app) {
$app->get('[/]', Cierres::class);
});
$app->get('[/]', Proyectos::class);
});
$app->group('/proyecto/{proyecto_id}', function ($app) {