This commit is contained in:
Билай Станислав 2024-11-05 12:15:09 +03:00
parent a02c55e16e
commit 6f7debc25b
2 changed files with 12 additions and 11 deletions

View File

@ -3,6 +3,7 @@
namespace kernel\modules\module_shop_client\controllers; namespace kernel\modules\module_shop_client\controllers;
use GuzzleHttp\Client; use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
use JetBrains\PhpStorm\NoReturn; use JetBrains\PhpStorm\NoReturn;
use kernel\AdminController; use kernel\AdminController;
use kernel\helpers\Debug; use kernel\helpers\Debug;
@ -24,6 +25,10 @@ class ModuleShopClientController extends AdminController
$this->client = new Client(); $this->client = new Client();
$this->moduleService = new ModuleService(); $this->moduleService = new ModuleService();
} }
/**
* @throws GuzzleException
*/
public function actionIndex(int $page_number = 1): void public function actionIndex(int $page_number = 1): void
{ {
$per_page = 8; $per_page = 8;
@ -46,6 +51,9 @@ class ModuleShopClientController extends AdminController
]); ]);
} }
/**
* @throws GuzzleException
*/
public function actionView(int $id): void public function actionView(int $id): void
{ {
$token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.W10.POQZmGB7EZIayINtYhzu5r1rdgZhF9qPJpaQkl_g6pU'; $token = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.W10.POQZmGB7EZIayINtYhzu5r1rdgZhF9qPJpaQkl_g6pU';
@ -58,6 +66,9 @@ class ModuleShopClientController extends AdminController
$this->cgView->render("view.php", ['data' => $module_info]); $this->cgView->render("view.php", ['data' => $module_info]);
} }
/**
* @throws GuzzleException
*/
public function actionInstall(): void public function actionInstall(): void
{ {
$request = new Request(); $request = new Request();

View File

@ -12,18 +12,8 @@ App::$collector->group(["prefix" => "admin"], function (RouteCollector $router){
App::$collector->get('/', [\kernel\modules\module_shop_client\controllers\ModuleShopClientController::class, 'actionIndex']); App::$collector->get('/', [\kernel\modules\module_shop_client\controllers\ModuleShopClientController::class, 'actionIndex']);
App::$collector->get('/page/{page_number}', [\kernel\modules\module_shop_client\controllers\ModuleShopClientController::class, 'actionIndex']); App::$collector->get('/page/{page_number}', [\kernel\modules\module_shop_client\controllers\ModuleShopClientController::class, 'actionIndex']);
App::$collector->get('/install', [\kernel\modules\module_shop_client\controllers\ModuleShopClientController::class, 'actionInstall']); App::$collector->get('/install', [\kernel\modules\module_shop_client\controllers\ModuleShopClientController::class, 'actionInstall']);
// App::$collector->get('/create', [\kernel\modules\post\controllers\PostController::class, 'actionCreate']);
// App::$collector->post("/", [\kernel\modules\post\controllers\PostController::class, 'actionAdd']);
App::$collector->get('/view/{id}', [\kernel\modules\module_shop_client\controllers\ModuleShopClientController::class, 'actionView']); App::$collector->get('/view/{id}', [\kernel\modules\module_shop_client\controllers\ModuleShopClientController::class, 'actionView']);
// App::$collector->any('/update/{id}', [\kernel\modules\post\controllers\PostController::class, 'actionUpdate']);
// App::$collector->any("/edit/{id}", [\kernel\modules\post\controllers\PostController::class, 'actionEdit']);
App::$collector->get('/delete', [\kernel\modules\module_shop_client\controllers\ModuleShopClientController::class, 'actionDelete']); App::$collector->get('/delete', [\kernel\modules\module_shop_client\controllers\ModuleShopClientController::class, 'actionDelete']);
}); });
}); });
}); });
//App::$collector->group(["prefix" => "api"], function (CgRouteCollector $router){
// App::$collector->group(['before' => 'bearer'], function (CgRouteCollector $router){
// $router->rest("post", [\kernel\modules\post\controllers\PostRestController::class]);
// });
//});