Skip to content

Commit

Permalink
🔨 APP #270 corrigindo exemplo
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinaldo Araujo Barreto Junior committed Jul 6, 2022
1 parent 2b8f905 commit 12edccb
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions appexemplo_v2.0/api/routes2.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,38 @@
<?php
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\Routing\RouteCollectorProxy as RouteCollectorProxy;
use Slim\Factory\AppFactory;

use api_controllers\SysinfoAPI;
use api_controllers\SelfilhosmenuAPI;
use api_controllers\SelfilhosmenuqtdAPI;
use api_controllers\SelmenuqtdAPI;
use api_controllers\Acesso_menuAPI;
use api_controllers\Acesso_perfilAPI;
use api_controllers\Acesso_perfil_menuAPI;
use api_controllers\Acesso_perfil_userAPI;
use api_controllers\Acesso_userAPI;
use api_controllers\Acesso_user_menuAPI;
use api_controllers\AutoridadeAPI;
use api_controllers\EnderecoAPI;
use api_controllers\MarcaAPI;
use api_controllers\Meta_tipoAPI;
use api_controllers\MunicipioAPI;
use api_controllers\Natureza_juridicaAPI;
use api_controllers\PedidoAPI;
use api_controllers\Pedido_itemAPI;
use api_controllers\PessoaAPI;
use api_controllers\Pessoa_fisicaAPI;
use api_controllers\Pessoa_juridicaAPI;
use api_controllers\ProdutoAPI;
use api_controllers\RegiaoAPI;
use api_controllers\TelefoneAPI;
use api_controllers\TipoAPI;
use api_controllers\UfAPI;
use api_controllers\Vw_acesso_user_menuAPI;
use api_controllers\Vw_pessoaAPI;
use api_controllers\Vw_pessoa_marca_produtoAPI;

/**
* Instantiate App
Expand Down Expand Up @@ -47,6 +76,7 @@
$routeArray = array();
$routeArray['id'] = $route->getIdentifier();
$routeArray['name']= $route->getName();
$routeArray['methods']= $route->getMethods()[0];
$routeArray['url'] = $url.$route->getPattern();
$routesArray[] = $routeArray;
}
Expand All @@ -63,5 +93,20 @@

$app->get($urlChamada.'sysinfo', SysinfoAPI::class . ':getInfo');


//--------------------------------------------------------------------
// TABLE: meta_tipo
//--------------------------------------------------------------------
$urlGrupo = $urlChamada.'meta_tipo';
$app->group($urlGrupo, function(RouteCollectorProxy $group) use ($app,$urlGrupo) {
$app->get($urlGrupo, Meta_tipoAPI::class . ':selectAll');
$app->get($urlGrupo.'/{id:[0-9]+}', Meta_tipoAPI::class . ':selectById');

$app->post($urlGrupo, Meta_tipoAPI::class . ':save');
$app->put($urlGrupo.'/{id:[0-9]+}', Meta_tipoAPI::class . ':save');
$app->delete($urlGrupo.'/{id:[0-9]+}', Meta_tipoAPI::class . ':delete');
});


// Run app
$app->run();

0 comments on commit 12edccb

Please sign in to comment.