mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-01 15:32:48 +08:00
注解使用全命名空间调用而不是use
This commit is contained in:
@@ -3,12 +3,11 @@
|
||||
namespace app\admin\controller\debug;
|
||||
|
||||
use app\common\controller\AdminController;
|
||||
use app\admin\service\annotation\ControllerAnnotation;
|
||||
use app\admin\service\annotation\NodeAnotation;
|
||||
|
||||
use think\App;
|
||||
|
||||
/**
|
||||
* @ControllerAnnotation(title="debug_log")
|
||||
* @\app\admin\service\annotation\ControllerAnnotation(title="debug_log")
|
||||
*/
|
||||
class Log extends AdminController
|
||||
{
|
||||
|
||||
@@ -7,14 +7,12 @@ namespace app\admin\controller\mall;
|
||||
use app\admin\model\MallCate;
|
||||
use app\admin\traits\Curd;
|
||||
use app\common\controller\AdminController;
|
||||
use app\admin\service\annotation\ControllerAnnotation;
|
||||
use app\admin\service\annotation\NodeAnotation;
|
||||
use think\App;
|
||||
|
||||
/**
|
||||
* Class Admin
|
||||
* @package app\admin\controller\system
|
||||
* @ControllerAnnotation(title="商品分类管理")
|
||||
* @\app\admin\service\annotation\ControllerAnnotation(title="商品分类管理")
|
||||
*/
|
||||
class Cate extends AdminController
|
||||
{
|
||||
|
||||
@@ -7,14 +7,13 @@ namespace app\admin\controller\mall;
|
||||
use app\admin\model\MallGoods;
|
||||
use app\admin\traits\Curd;
|
||||
use app\common\controller\AdminController;
|
||||
use app\admin\service\annotation\ControllerAnnotation;
|
||||
use app\admin\service\annotation\NodeAnotation;
|
||||
|
||||
use think\App;
|
||||
|
||||
/**
|
||||
* Class Goods
|
||||
* @package app\admin\controller\mall
|
||||
* @ControllerAnnotation(title="商城商品管理")
|
||||
* @\app\admin\service\annotation\ControllerAnnotation(title="商城商品管理")
|
||||
*/
|
||||
class Goods extends AdminController
|
||||
{
|
||||
@@ -30,7 +29,7 @@ class Goods extends AdminController
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="列表")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="列表")
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
@@ -61,7 +60,7 @@ class Goods extends AdminController
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="入库")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="入库")
|
||||
*/
|
||||
public function stock($id)
|
||||
{
|
||||
@@ -95,7 +94,7 @@ class Goods extends AdminController
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="导出")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="导出")
|
||||
*/
|
||||
public function export()
|
||||
{
|
||||
|
||||
@@ -3,12 +3,11 @@
|
||||
namespace app\admin\controller\mall;
|
||||
|
||||
use app\common\controller\AdminController;
|
||||
use app\admin\service\annotation\ControllerAnnotation;
|
||||
use app\admin\service\annotation\NodeAnotation;
|
||||
|
||||
use think\App;
|
||||
|
||||
/**
|
||||
* @ControllerAnnotation(title="mall_tag")
|
||||
* @\app\admin\service\annotation\ControllerAnnotation(title="mall_tag")
|
||||
*/
|
||||
class Tag extends AdminController
|
||||
{
|
||||
|
||||
@@ -8,8 +8,6 @@ use app\admin\model\SystemAdmin;
|
||||
use app\admin\service\TriggerService;
|
||||
use app\common\constants\AdminConstant;
|
||||
use app\common\controller\AdminController;
|
||||
use app\admin\service\annotation\ControllerAnnotation;
|
||||
use app\admin\service\annotation\NodeAnotation;
|
||||
use think\App;
|
||||
use think\facade\Validate;
|
||||
use think\validate\ValidateRule;
|
||||
@@ -17,7 +15,7 @@ use think\validate\ValidateRule;
|
||||
/**
|
||||
* Class Admin
|
||||
* @package app\admin\controller\system
|
||||
* @ControllerAnnotation(title="管理员管理")
|
||||
* @\app\admin\service\annotation\ControllerAnnotation(title="管理员管理")
|
||||
*/
|
||||
class Admin extends AdminController
|
||||
{
|
||||
@@ -40,7 +38,7 @@ class Admin extends AdminController
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="列表")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="列表")
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
@@ -70,7 +68,7 @@ class Admin extends AdminController
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="添加")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="添加")
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
@@ -102,7 +100,7 @@ class Admin extends AdminController
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="编辑")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="编辑")
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
@@ -131,7 +129,7 @@ class Admin extends AdminController
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="编辑")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="编辑")
|
||||
*/
|
||||
public function password($id)
|
||||
{
|
||||
@@ -163,7 +161,7 @@ class Admin extends AdminController
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="删除")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="删除")
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
@@ -185,7 +183,7 @@ class Admin extends AdminController
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="属性修改")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="属性修改")
|
||||
*/
|
||||
public function modify()
|
||||
{
|
||||
|
||||
@@ -8,12 +8,11 @@ use app\admin\model\SystemAuth;
|
||||
use app\admin\model\SystemAuthNode;
|
||||
use app\admin\service\TriggerService;
|
||||
use app\common\controller\AdminController;
|
||||
use app\admin\service\annotation\ControllerAnnotation;
|
||||
use app\admin\service\annotation\NodeAnotation;
|
||||
|
||||
use think\App;
|
||||
|
||||
/**
|
||||
* @ControllerAnnotation(title="角色权限管理")
|
||||
* @\app\admin\service\annotation\ControllerAnnotation(title="角色权限管理")
|
||||
* Class Auth
|
||||
* @package app\admin\controller\system
|
||||
*/
|
||||
@@ -34,7 +33,7 @@ class Auth extends AdminController
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="授权")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="授权")
|
||||
*/
|
||||
public function authorize($id)
|
||||
{
|
||||
@@ -49,7 +48,7 @@ class Auth extends AdminController
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="授权保存")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="授权保存")
|
||||
*/
|
||||
public function saveAuthorize()
|
||||
{
|
||||
|
||||
@@ -7,14 +7,13 @@ namespace app\admin\controller\system;
|
||||
use app\admin\model\SystemConfig;
|
||||
use app\admin\service\TriggerService;
|
||||
use app\common\controller\AdminController;
|
||||
use app\admin\service\annotation\ControllerAnnotation;
|
||||
use app\admin\service\annotation\NodeAnotation;
|
||||
|
||||
use think\App;
|
||||
|
||||
/**
|
||||
* Class Config
|
||||
* @package app\admin\controller\system
|
||||
* @ControllerAnnotation(title="系统配置管理")
|
||||
* @\app\admin\service\annotation\ControllerAnnotation(title="系统配置管理")
|
||||
*/
|
||||
class Config extends AdminController
|
||||
{
|
||||
@@ -26,7 +25,7 @@ class Config extends AdminController
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="列表")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="列表")
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
@@ -34,7 +33,7 @@ class Config extends AdminController
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="保存")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="保存")
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
|
||||
@@ -7,15 +7,14 @@ use app\admin\model\SystemMenu;
|
||||
use app\admin\model\SystemNode;
|
||||
use app\admin\service\TriggerService;
|
||||
use app\common\constants\MenuConstant;
|
||||
use app\admin\service\annotation\ControllerAnnotation;
|
||||
use app\admin\service\annotation\NodeAnotation;
|
||||
|
||||
use app\common\controller\AdminController;
|
||||
use think\App;
|
||||
|
||||
/**
|
||||
* Class Menu
|
||||
* @package app\admin\controller\system
|
||||
* @ControllerAnnotation(title="菜单管理",auth=true)
|
||||
* @\app\admin\service\annotation\ControllerAnnotation(title="菜单管理",auth=true)
|
||||
*/
|
||||
class Menu extends AdminController
|
||||
{
|
||||
@@ -36,7 +35,7 @@ class Menu extends AdminController
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="列表")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="列表")
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
@@ -58,7 +57,7 @@ class Menu extends AdminController
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="添加")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="添加")
|
||||
*/
|
||||
public function add($id = null)
|
||||
{
|
||||
@@ -97,7 +96,7 @@ class Menu extends AdminController
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="编辑")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="编辑")
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
@@ -139,7 +138,7 @@ class Menu extends AdminController
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="删除")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="删除")
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
@@ -160,7 +159,7 @@ class Menu extends AdminController
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="属性修改")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="属性修改")
|
||||
*/
|
||||
public function modify()
|
||||
{
|
||||
@@ -199,7 +198,7 @@ class Menu extends AdminController
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="添加菜单提示")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="添加菜单提示")
|
||||
*/
|
||||
public function getMenuTips()
|
||||
{
|
||||
|
||||
@@ -7,13 +7,11 @@ namespace app\admin\controller\system;
|
||||
use app\admin\model\SystemNode;
|
||||
use app\admin\service\TriggerService;
|
||||
use app\common\controller\AdminController;
|
||||
use app\admin\service\annotation\ControllerAnnotation;
|
||||
use app\admin\service\annotation\NodeAnotation;
|
||||
use app\admin\service\NodeService;
|
||||
use think\App;
|
||||
|
||||
/**
|
||||
* @ControllerAnnotation(title="系统节点管理")
|
||||
* @\app\admin\service\annotation\ControllerAnnotation(title="系统节点管理")
|
||||
* Class Node
|
||||
* @package app\admin\controller\system
|
||||
*/
|
||||
@@ -29,7 +27,7 @@ class Node extends AdminController
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="列表")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="列表")
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
@@ -53,7 +51,7 @@ class Node extends AdminController
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="系统节点更新")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="系统节点更新")
|
||||
*/
|
||||
public function refreshNode($force = 0)
|
||||
{
|
||||
@@ -90,7 +88,7 @@ class Node extends AdminController
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="清除失效节点")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="清除失效节点")
|
||||
*/
|
||||
public function clearNode()
|
||||
{
|
||||
|
||||
@@ -6,12 +6,11 @@ namespace app\admin\controller\system;
|
||||
|
||||
use app\admin\model\SystemQuick;
|
||||
use app\common\controller\AdminController;
|
||||
use app\admin\service\annotation\ControllerAnnotation;
|
||||
use app\admin\service\annotation\NodeAnotation;
|
||||
|
||||
use think\App;
|
||||
|
||||
/**
|
||||
* @ControllerAnnotation(title="快捷入口管理")
|
||||
* @\app\admin\service\annotation\ControllerAnnotation(title="快捷入口管理")
|
||||
* Class Quick
|
||||
* @package app\admin\controller\system
|
||||
*/
|
||||
|
||||
@@ -6,12 +6,11 @@ namespace app\admin\controller\system;
|
||||
|
||||
use app\admin\model\SystemUploadfile;
|
||||
use app\common\controller\AdminController;
|
||||
use app\admin\service\annotation\ControllerAnnotation;
|
||||
use app\admin\service\annotation\NodeAnotation;
|
||||
|
||||
use think\App;
|
||||
|
||||
/**
|
||||
* @ControllerAnnotation(title="上传文件管理")
|
||||
* @\app\admin\service\annotation\ControllerAnnotation(title="上传文件管理")
|
||||
* Class Uploadfile
|
||||
* @package app\admin\controller\system
|
||||
*/
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
|
||||
namespace app\admin\traits;
|
||||
|
||||
use app\admin\service\annotation\NodeAnotation;
|
||||
|
||||
|
||||
/**
|
||||
* 后台CURD复用
|
||||
* Trait Curd
|
||||
@@ -16,7 +13,7 @@ trait Curd
|
||||
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="列表")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="列表")
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
@@ -47,7 +44,7 @@ trait Curd
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="添加")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="添加")
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
@@ -66,7 +63,7 @@ trait Curd
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="编辑")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="编辑")
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
@@ -88,7 +85,7 @@ trait Curd
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="删除")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="删除")
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
@@ -104,7 +101,7 @@ trait Curd
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="导出")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="导出")
|
||||
*/
|
||||
public function export()
|
||||
{
|
||||
@@ -132,7 +129,7 @@ trait Curd
|
||||
}
|
||||
|
||||
/**
|
||||
* @NodeAnotation(title="属性修改")
|
||||
* @\app\admin\service\annotation\NodeAnotation(title="属性修改")
|
||||
*/
|
||||
public function modify()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user