API
This commit is contained in:
@ -1,4 +1,6 @@
|
||||
<?php
|
||||
use Contabilidad\Common\Controller\Base;
|
||||
|
||||
$app->get('/key/generate[/]', [Base::class, 'generate_key']);
|
||||
$app->get('/balance[/]', [Contabilidad\Common\Controller\TiposCategorias::class, 'balance']);
|
||||
$app->get('/', Base::class);
|
||||
|
12
api/resources/routes/monedas.php
Normal file
12
api/resources/routes/monedas.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
use Contabilidad\Common\Controller\Monedas;
|
||||
|
||||
$app->group('/monedas', function($app) {
|
||||
$app->post('/add[/]', [Monedas::class, 'add']);
|
||||
$app->get('[/]', Monedas::class);
|
||||
});
|
||||
$app->group('/moneda/{moneda_id}', function($app) {
|
||||
$app->put('/edit', [Monedas::class, 'edit']);
|
||||
$app->delete('/delete', [Monedas::class, 'delete']);
|
||||
$app->get('[/]', [Monedas::class, 'show']);
|
||||
});
|
16
api/resources/routes/tipos.php
Normal file
16
api/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();
|
||||
}
|
||||
});
|
||||
}
|
13
api/resources/routes/tipos/cambios.php
Normal file
13
api/resources/routes/tipos/cambios.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
use Contabilidad\Common\Controller\TiposCambios;
|
||||
|
||||
$app->group('/cambios', function($app) {
|
||||
$app->post('/obtener[/]', [TiposCambios::class, 'obtain']);
|
||||
$app->post('/add[/]', [TiposCambios::class, 'add']);
|
||||
$app->get('[/]', TiposCambios::class);
|
||||
});
|
||||
$app->group('/cambio/{tipo_id}', function($app) {
|
||||
$app->put('/edit[/]', [TiposCambios::class, 'edit']);
|
||||
$app->delete('/delete[/]', [TiposCambios::class, 'delete']);
|
||||
$app->get('[/]', [TiposCambios::class, 'show']);
|
||||
});
|
13
api/resources/routes/tipos/categorias.php
Normal file
13
api/resources/routes/tipos/categorias.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
use Contabilidad\Common\Controller\TiposCategorias;
|
||||
|
||||
$app->group('/categorias', function($app) {
|
||||
$app->post('/add[/]', [TiposCategorias::class, 'add']);
|
||||
$app->get('[/]', TiposCategorias::class);
|
||||
});
|
||||
$app->group('/categoria/{tipo_id}', function($app) {
|
||||
$app->get('/categorias', [TiposCategorias::class, 'categorias']);
|
||||
$app->put('/edit', [TiposCategorias::class, 'edit']);
|
||||
$app->delete('/delete', [TiposCategorias::class, 'delete']);
|
||||
$app->get('[/]', [TiposCategorias::class, 'show']);
|
||||
});
|
12
api/resources/routes/tipos/cuentas.php
Normal file
12
api/resources/routes/tipos/cuentas.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
use Contabilidad\Common\Controller\TiposCuentas;
|
||||
|
||||
$app->group('/cuentas', function($app) {
|
||||
$app->post('/add[/]', [TiposCuentas::class, 'add']);
|
||||
$app->get('[/]', TiposCuentas::class);
|
||||
});
|
||||
$app->group('/cuenta/{tipo_id}', function($app) {
|
||||
$app->put('/edit', [TiposCuentas::class, 'edit']);
|
||||
$app->delete('/delete', [TiposCuentas::class, 'delete']);
|
||||
$app->get('[/]', [TiposCuentas::class, 'show']);
|
||||
});
|
Reference in New Issue
Block a user