This commit is contained in:
2025-08-01 14:29:50 +03:00
parent 2ab819ff30
commit b86b8ff923
54 changed files with 1512 additions and 672 deletions

View File

@@ -49,6 +49,9 @@ class AdminConsoleController extends ConsoleController
$out = $this->migrationService->runAtPath("kernel/modules/secure/migrations");
$this->out->r("create secret_code table", "green");
$out = $this->migrationService->runAtPath("kernel/modules/notification/migrations");
$this->out->r("create notification table", "green");
$this->optionService->createFromParams(
key: "admin_theme_paths",
value: "{\"paths\": [\"{KERNEL_ADMIN_THEMES}\", \"{APP}/admin_themes\"]}",
@@ -170,6 +173,13 @@ class AdminConsoleController extends ConsoleController
]);
$this->out->r("create item menu option", "green");
$this->menuService->createItem([
"label" => "Уведомления",
"url" => "/admin/notification",
"slug" => "notification"
]);
$this->out->r("create notification option", "green");
$user = new CreateUserForm();
$user->load([
'username' => 'admin',

View File

@@ -119,48 +119,4 @@ class ModuleController extends ConsoleController
$this->out->r("Модуль $slug создан", 'green');
}
public function actionConstructController(): void
{
$this->out->r("Введите slug контроллера:", 'yellow');
$slug = substr(fgets(STDIN), 0, -1);
$slug = strtolower($slug);
$this->out->r("Введите model контроллера:", 'yellow');
$model = substr(fgets(STDIN), 0, -1);
$this->out->r("Введите путь контроллера:", 'yellow');
$path = substr(fgets(STDIN), 0, -1);
$path = strtolower($path);
$moduleService = new ModuleService();
$moduleService->createController([
'slug' => $slug,
'model' => $model,
], $path);
$this->out->r("Контроллер $slug создан", 'green');
}
public function actionConstructCRUD(): void
{
$this->out->r("Введите slug для CRUD:", 'yellow');
$slug = substr(fgets(STDIN), 0, -1);
$slug = strtolower($slug);
$this->out->r("Введите model для CRUD:", 'yellow');
$model = substr(fgets(STDIN), 0, -1);
$this->out->r("Введите путь для CRUD:", 'yellow');
$path = substr(fgets(STDIN), 0, -1);
$path = strtolower($path);
$moduleService = new ModuleService();
$moduleService->createCRUD([
'slug' => $slug,
'model' => $model,
], $path);
$this->out->r("CRUD $model создан", 'green');
}
}

View File

@@ -91,14 +91,6 @@ App::$collector->group(["prefix" => "module"], callback: function (RouteCollecto
[\kernel\console\controllers\ModuleController::class, 'actionConstructModule'],
additionalInfo: ['description' => 'Сгенерировать модуль']
);
App::$collector->console('construct/controller',
[\kernel\console\controllers\ModuleController::class, 'actionConstructController'],
additionalInfo: ['description' => 'Сгенерировать контроллер']
);
App::$collector->console('construct/crud',
[\kernel\console\controllers\ModuleController::class, 'actionConstructCRUD'],
additionalInfo: ['description' => 'Сгенерировать CRUD']
);
});
App::$collector->group(["prefix" => "kernel"], callback: function (RouteCollector $router){