mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-06 18:12:50 +08:00
注解使用全命名空间调用而不是use
This commit is contained in:
@@ -19,10 +19,8 @@ class NodeService
|
||||
{
|
||||
$basePath = base_path() . 'admin' . DIRECTORY_SEPARATOR . 'controller';
|
||||
$baseNamespace = "app\admin\controller";
|
||||
|
||||
$nodeList = (new Node($basePath, $baseNamespace))
|
||||
->getNodelist();
|
||||
|
||||
return $nodeList;
|
||||
}
|
||||
}
|
||||
@@ -3,12 +3,11 @@
|
||||
namespace {{controllerNamespace}};
|
||||
|
||||
use app\common\controller\AdminController;
|
||||
use app\admin\service\annotation\ControllerAnnotation;
|
||||
use app\admin\service\annotation\NodeAnotation;
|
||||
|
||||
use think\App;
|
||||
|
||||
/**
|
||||
* @ControllerAnnotation(title="{{controllerAnnotation}}")
|
||||
* @\app\admin\service\annotation\ControllerAnnotation(title="{{controllerAnnotation}}")
|
||||
*/
|
||||
class {{controllerName}} extends AdminController
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="导出")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="导出")
|
||||
*/
|
||||
public function export()
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="列表")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="列表")
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
@@ -12,11 +12,12 @@
|
||||
|
||||
namespace app\admin\service\node;
|
||||
|
||||
use app\admin\service\annotation\ControllerAnnotation;
|
||||
use app\admin\service\annotation\NodeAnotation;
|
||||
use Doctrine\Common\Annotations\AnnotationReader;
|
||||
use Doctrine\Common\Annotations\AnnotationRegistry;
|
||||
use Doctrine\Common\Annotations\DocParser;
|
||||
use app\admin\service\annotation\ControllerAnnotation;
|
||||
use app\admin\service\annotation\NodeAnotation;
|
||||
|
||||
use think\helper\Str;
|
||||
|
||||
/**
|
||||
@@ -69,6 +70,7 @@ class Node
|
||||
|
||||
// 获取类和方法的注释信息
|
||||
$reflectionClass = new \ReflectionClass($controller);
|
||||
|
||||
$methods = $reflectionClass->getMethods();
|
||||
$actionList = [];
|
||||
|
||||
@@ -151,7 +153,7 @@ class Node
|
||||
$list[$controllerFormat] = "{$this->baseNamespace}\\{$middleDir}" . $className;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user