44 lines
3.0 KiB
PHP
44 lines
3.0 KiB
PHP
<?php
|
|
|
|
|
|
use kernel\App;
|
|
use kernel\CgRouteCollector;
|
|
use Phroute\Phroute\RouteCollector;
|
|
use kernel\app_modules\tgbot\controllers\TgbotNotificationController;
|
|
use kernel\app_modules\tgbot\controllers\TgbotController;
|
|
|
|
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) {
|
|
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']);
|
|
});
|
|
});
|
|
});
|
|
|
|
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']);
|
|
});
|
|
$router->get('/tg-bot/get-scan-btn/{id}', [\app\modules\tgbot\controllers\TgBotRestController::class, 'actionGetScanBtn']);
|
|
$router->get('/tg-bot/get-card-by-dialog/{dialog_id}/{bot_id}', [\app\modules\tgbot\controllers\TgBotRestController::class, 'actionGetCardByDialog']);
|
|
$router->get('/tg-bot-notification/get-to-send', [\kernel\app_modules\tgbot\controllers\TgbotNotificationRestController::class, 'actionGetToSend']);
|
|
}); |