2025-01-03 02:11:09 +03:00
|
|
|
<?php
|
|
|
|
|
2025-01-03 18:07:07 +03:00
|
|
|
use kernel\App;
|
|
|
|
use kernel\CgRouteCollector;
|
|
|
|
|
|
|
|
include KERNEL_APP_MODULES_DIR . "/tgbot/routs/tgbot.php";
|
|
|
|
|
2025-01-23 20:02:06 +03:00
|
|
|
App::$collector->filter("tg_bot_auth", [\app\modules\tgbot\middlewares\TgBotAuthMiddleware::class, "handler"]);
|
2025-01-26 14:42:47 +03:00
|
|
|
App::$collector->filter("tg_bot_is_admin", [\app\modules\tgbot\middlewares\TgBotAuthMiddleware::class, "isTgAdmin"]);
|
2025-01-03 18:07:07 +03:00
|
|
|
|
|
|
|
App::$collector->group(["prefix" => "miniapp"], function (CGRouteCollector $router) {
|
|
|
|
App::$collector->get('/', [\app\modules\tgbot\controllers\TgMainController::class, 'actionMain']);
|
2025-01-23 20:02:06 +03:00
|
|
|
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']);
|
2025-01-26 14:42:47 +03:00
|
|
|
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']);
|
2025-01-27 20:03:58 +03:00
|
|
|
App::$collector->get('/card_info/{cardId}', [\app\modules\tgbot\controllers\TgMainController::class, 'actionCardInfo']);
|
2025-01-26 14:42:47 +03:00
|
|
|
});
|
2025-01-23 20:02:06 +03:00
|
|
|
});
|
2025-01-03 18:07:07 +03:00
|
|
|
});
|