card action

This commit is contained in:
2025-01-26 14:42:47 +03:00
parent 08cdf44b67
commit 824130df26
27 changed files with 430 additions and 53 deletions

View File

@ -6,13 +6,18 @@ use kernel\CgRouteCollector;
include KERNEL_APP_MODULES_DIR . "/tgbot/routs/tgbot.php";
App::$collector->filter("tg_bot_auth", [\app\modules\tgbot\middlewares\TgBotAuthMiddleware::class, "handler"]);
App::$collector->filter("tg_bot_is_admin", [\app\modules\tgbot\middlewares\TgBotAuthMiddleware::class, "isTgAdmin"]);
App::$collector->group(["prefix" => "miniapp"], function (CGRouteCollector $router) {
App::$collector->get('/', [\app\modules\tgbot\controllers\TgMainController::class, 'actionMain']);
App::$collector->group(["before" => "tg_bot_auth"], function (CGRouteCollector $router){
App::$collector->get('/news', [\app\modules\tgbot\controllers\TgMainController::class, 'actionNews']);
App::$collector->get('/promo', [\app\modules\tgbot\controllers\TgMainController::class, 'actionPromo']);
App::$collector->get('/scanner', [\app\modules\tgbot\controllers\TgMainController::class, 'actionScanner']);
App::$collector->get('/card_action/{cardId}', [\app\modules\tgbot\controllers\TgMainController::class, 'actionCardAction']);
App::$collector->group(["before" => "tg_bot_is_admin"], function (CGRouteCollector $router){
App::$collector->get('/scanner', [\app\modules\tgbot\controllers\TgMainController::class, 'actionScanner']);
App::$collector->get('/card_action/{cardId}', [\app\modules\tgbot\controllers\TgMainController::class, 'actionCardActionStep1']);
App::$collector->get('/card_action_step_2', [\app\modules\tgbot\controllers\TgMainController::class, 'actionCardActionStep2']);
App::$collector->post('/card_action_step_3', [\app\modules\tgbot\controllers\TgMainController::class, 'actionCardActionStep3']);
});
});
});