mirror of
https://gitee.com/apiadmin/ApiAdmin.git
synced 2025-04-06 03:58:00 +08:00
modified 添加后端路由生成命令
This commit is contained in:
parent
a8563c4b38
commit
3cfffb7ed5
29
application/command/FreshAdminRouter.php
Normal file
29
application/command/FreshAdminRouter.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\command;
|
||||||
|
|
||||||
|
use app\util\RouterTool;
|
||||||
|
use think\console\Command;
|
||||||
|
use think\console\Input;
|
||||||
|
use think\console\Output;
|
||||||
|
|
||||||
|
class FreshAdminRouter extends Command {
|
||||||
|
|
||||||
|
protected function configure() {
|
||||||
|
// 指令配置
|
||||||
|
$this->setName('apiadmin:adminRouter')->setDescription('自动构建后端路由');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* php think apiadmin:adminRouter
|
||||||
|
* @param Input $input
|
||||||
|
* @param Output $output
|
||||||
|
* @return int|void|null
|
||||||
|
* @throws \think\Exception
|
||||||
|
* @author zhaoxiang <zhaoxiang051405@gmail.com>
|
||||||
|
*/
|
||||||
|
protected function execute(Input $input, Output $output) {
|
||||||
|
RouterTool::buildAdminRouter();
|
||||||
|
$output->info('路由构建成功');
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user