igfs/app/modules/module_shop/routs/ms.php
2024-10-23 16:16:47 +03:00

26 lines
1.7 KiB
PHP

<?php
use kernel\App;
use kernel\CgRouteCollector;
App::$collector->filter('bearer', [\kernel\modules\secure\middlewares\BearerAuthMiddleware::class, "handler"]);
App::$collector->group(["prefix" => "admin"], function (CgRouteCollector $router) {
App::$collector->group(["prefix" => "module_shop"], function (CgRouteCollector $router){
App::$collector->get('/', [\app\modules\module_shop\controllers\ModuleShopController::class, 'actionIndex']);
App::$collector->get('/page/{page_number}', [\app\modules\module_shop\controllers\ModuleShopController::class, 'actionIndex']);
App::$collector->get('/create', [\app\modules\module_shop\controllers\ModuleShopController::class, 'actionCreate']);
App::$collector->post("/", [\app\modules\module_shop\controllers\ModuleShopController::class, 'actionAdd']);
App::$collector->get('/{id}', [\app\modules\module_shop\controllers\ModuleShopController::class, 'actionView']);
App::$collector->any('/update/{id}', [\app\modules\module_shop\controllers\ModuleShopController::class, 'actionUpdate']);
App::$collector->any("/edit/{id}", [\app\modules\module_shop\controllers\ModuleShopController::class, 'actionEdit']);
App::$collector->get('/delete/{id}', [\app\modules\module_shop\controllers\ModuleShopController::class, 'actionDelete']);
App::$collector->get('/pack/{id}', [\app\modules\module_shop\controllers\ModuleShopController::class, 'actionPack']);
});
});
App::$collector->group(["prefix" => "api"], function (CgRouteCollector $router){
App::$collector->group(['before' => 'bearer'], function (CgRouteCollector $router){
$router->rest("module_shop", [\app\modules\module_shop\controllers\ModuleShopRestController::class]);
});
});