44 lines
3.0 KiB
PHP
Raw Permalink Normal View History

2025-01-03 02:11:09 +03:00
<?php
use kernel\App;
use kernel\CgRouteCollector;
use Phroute\Phroute\RouteCollector;
2025-01-27 20:03:58 +03:00
use kernel\app_modules\tgbot\controllers\TgbotNotificationController;
use kernel\app_modules\tgbot\controllers\TgbotController;
2025-01-03 02:11:09 +03:00
App::$collector->group(["prefix" => "admin"], function (CgRouteCollector $router) {
App::$collector->group(["before" => "auth"], function (RouteCollector $router) {
App::$collector->group(["prefix" => "tg-bot"], function (CGRouteCollector $router) {
2025-01-27 20:03:58 +03:00
App::$collector->get('/', [TgbotController::class, 'actionIndex']);
App::$collector->get('/page/{page_number}', [TgbotController::class, 'actionIndex']);
App::$collector->get('/create', [TgbotController::class, 'actionCreate']);
App::$collector->post("/", [TgbotController::class, 'actionAdd']);
App::$collector->get('/view/{id}', [TgbotController::class, 'actionView']);
App::$collector->any('/update/{id}', [TgbotController::class, 'actionUpdate']);
App::$collector->any("/edit/{id}", [TgbotController::class, 'actionEdit']);
App::$collector->get('/delete/{id}', [TgbotController::class, 'actionDelete']);
});
App::$collector->group(["prefix" => "tg-bot-notification"], function (CGRouteCollector $router) {
App::$collector->get('/', [TgbotNotificationController::class, 'actionIndex']);
App::$collector->get('/page/{page_number}', [TgbotNotificationController::class, 'actionIndex']);
App::$collector->get('/create', [TgbotNotificationController::class, 'actionCreate']);
App::$collector->post("/", [TgbotNotificationController::class, 'actionAdd']);
App::$collector->get('/view/{id}', [TgbotNotificationController::class, 'actionView']);
App::$collector->any('/update/{id}', [TgbotNotificationController::class, 'actionUpdate']);
App::$collector->any("/edit/{id}", [TgbotNotificationController::class, 'actionEdit']);
App::$collector->get('/delete/{id}', [TgbotNotificationController::class, 'actionDelete']);
2025-01-03 02:11:09 +03:00
});
});
});
App::$collector->group(["prefix" => "api"], function (CgRouteCollector $router){
App::$collector->group(['before' => 'bearer'], function (CgRouteCollector $router){
$router->rest("tg-bot", [\app\modules\tgbot\controllers\TgBotRestController::class]);
$router->post('/tg-bot/create-card', [\app\modules\tgbot\controllers\TgBotRestController::class, 'actionCreateCard']);
$router->get('/tg-bot/get-by-dialog/{dialog_id}/{bot_id}', [\app\modules\tgbot\controllers\TgBotRestController::class, 'actionGetByDialog']);
});
2025-01-20 00:12:30 +03:00
$router->get('/tg-bot/get-scan-btn/{id}', [\app\modules\tgbot\controllers\TgBotRestController::class, 'actionGetScanBtn']);
2025-01-05 17:23:49 +03:00
$router->get('/tg-bot/get-card-by-dialog/{dialog_id}/{bot_id}', [\app\modules\tgbot\controllers\TgBotRestController::class, 'actionGetCardByDialog']);
2025-01-27 20:03:58 +03:00
$router->get('/tg-bot-notification/get-to-send', [\kernel\app_modules\tgbot\controllers\TgbotNotificationRestController::class, 'actionGetToSend']);
2025-01-03 02:11:09 +03:00
});