Files
This commit is contained in:
12
resources/routes/auth.php
Normal file
12
resources/routes/auth.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Incoviba\API\Common\Service\Auth as Service;
|
||||
|
||||
$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');
|
||||
});
|
12
resources/routes/bancos.php
Normal file
12
resources/routes/bancos.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
use Incoviba\API\Common\Controller\Bancos;
|
||||
|
||||
$app->group('/bancos', function ($app) {
|
||||
$app->post('/add[/]', [Bancos::class, 'add']);
|
||||
$app->get('[/]', Bancos::class);
|
||||
});
|
||||
$app->group('/banco/{banco_id}', function ($app) {
|
||||
$app->put('/edit[/]', [Bancos::class, 'edit']);
|
||||
$app->delete('/delete[/]', [Bancos::class, 'delete']);
|
||||
$app->get('[/]', [Bancos::class, 'show']);
|
||||
});
|
5
resources/routes/base.php
Normal file
5
resources/routes/base.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
use Incoviba\API\Common\Controller\Base;
|
||||
|
||||
$app->get('[/]', Base::class);
|
||||
$app->get('/php/info[/]', [Base::class, 'info']);
|
13
resources/routes/inmobiliarias.php
Normal file
13
resources/routes/inmobiliarias.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
use Incoviba\API\Common\Controller\Inmobiliarias;
|
||||
|
||||
$app->group('/inmobiliarias', function ($app) {
|
||||
$app->post('/add[/]', [Inmobiliarias::class, 'add']);
|
||||
$app->get('[/]', Inmobiliarias::class);
|
||||
});
|
||||
$app->group('/inmobiliaria/{inmobiliaria_rut}', function ($app) {
|
||||
$app->get('/proyectos[/]', [Inmobiliarias::class, 'proyectos']);
|
||||
$app->put('/edit[/]', [Inmobiliarias::class, 'edit']);
|
||||
$app->delete('/delete[/]', [Inmobiliarias::class, 'delete']);
|
||||
$app->get('[/]', [Inmobiliarias::class, 'show']);
|
||||
});
|
12
resources/routes/propietarios.php
Normal file
12
resources/routes/propietarios.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
use Incoviba\API\Common\Controller\Propietarios;
|
||||
|
||||
$app->group('/propietarios', function ($app) {
|
||||
$app->post('/add[/]', [Propietarios::class, 'add']);
|
||||
$app->get('[/]', Propietarios::class);
|
||||
});
|
||||
$app->group('/propietario/{propietario_rut}', function ($app) {
|
||||
$app->put('/edit[/]', [Propietarios::class, 'edit']);
|
||||
$app->delete('/edit[/]', [Propietarios::class, 'delete']);
|
||||
$app->get('[/]', [Propietarios::class, 'show']);
|
||||
});
|
12
resources/routes/proyectos.php
Normal file
12
resources/routes/proyectos.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
use Incoviba\API\Common\Controller\Proyectos;
|
||||
|
||||
$app->group('/proyectos', function ($app) {
|
||||
$app->post('/add[/]', [Proyectos::class, 'add']);
|
||||
$app->get('[/]', Proyectos::class);
|
||||
});
|
||||
$app->group('/proyecto/{proyecto_id}', function ($app) {
|
||||
$app->put('/edit[/]', [Proyectos::class, 'edit']);
|
||||
$app->delete('/edit[/]', [Proyectos::class, 'delete']);
|
||||
$app->get('[/]', [Proyectos::class, 'show']);
|
||||
});
|
16
resources/routes/tipos.php
Normal file
16
resources/routes/tipos.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
$folder = implode(DIRECTORY_SEPARATOR, [
|
||||
__DIR__,
|
||||
'tipos'
|
||||
]);
|
||||
if (file_exists($folder)) {
|
||||
$app->group('/tipos', function ($app) use ($folder) {
|
||||
$files = new DirectoryIterator($folder);
|
||||
foreach ($files as $file) {
|
||||
if ($file->isDir() or $file->getExtension() !== 'php') {
|
||||
continue;
|
||||
}
|
||||
include_once $file->getRealPath();
|
||||
}
|
||||
});
|
||||
}
|
12
resources/routes/tipos/sociedades.php
Normal file
12
resources/routes/tipos/sociedades.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
use Incoviba\API\Common\Controller\Sociedades;
|
||||
|
||||
$app->group('/sociedades', function ($app) {
|
||||
$app->post('/add[/]', [Sociedades::class, 'add']);
|
||||
$app->get('[/]', Sociedades::class);
|
||||
});
|
||||
$app->group('/sociedad/{sociedad_id}', function ($app) {
|
||||
$app->put('/edit[/]', [Sociedades::class, 'edit']);
|
||||
$app->delete('/edit[/]', [Sociedades::class, 'delete']);
|
||||
$app->get('[/]', [Sociedades::class, 'show']);
|
||||
});
|
12
resources/routes/ventas.php
Normal file
12
resources/routes/ventas.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
use Incoviba\API\Common\Controller\Ventas;
|
||||
|
||||
$app->group('/ventas', function ($app) {
|
||||
$app->post('/add[/]', [Ventas::class, 'add']);
|
||||
$app->get('[/]', Ventas::class);
|
||||
});
|
||||
$app->group('/venta/{venta_id}', function ($app) {
|
||||
$app->put('/edit[/]', [Ventas::class, 'edit']);
|
||||
$app->delete('/edit[/]', [Ventas::class, 'delete']);
|
||||
$app->get('[/]', [Ventas::class, 'show']);
|
||||
});
|
Reference in New Issue
Block a user