调整架构,新增系统模块服务

This commit is contained in:
JaguarJack
2020-06-24 09:10:01 +08:00
parent 8c32893c91
commit 0e7453a6fe
4 changed files with 53 additions and 27 deletions

View File

@@ -8,3 +8,24 @@
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ] // | Author: JaguarJack [ njphper@gmail.com ]
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
namespace catchAdmin\system;
use catchAdmin\system\events\AttachmentEvent;
use catcher\ModuleService;
class SystemService extends ModuleService
{
public function loadRouteFrom()
{
// TODO: Implement loadRouteFrom() method.
return __DIR__ . DIRECTORY_SEPARATOR . 'route.php';
}
public function loadEvents()
{
return [
'attachment' => [ AttachmentEvent::class ],
];
}
}

View File

@@ -62,7 +62,7 @@ class DataDictionary extends CatchController
*/ */
public function view($table): \think\response\Json public function view($table): \think\response\Json
{ {
$fields = Db::query('show full columns from ' . $table); $fields = Db::query(' ' . $table);
array_walk($fields, function (&$item){ array_walk($fields, function (&$item){
$item = array_change_key_case($item); $item = array_change_key_case($item);

View File

@@ -4,8 +4,11 @@
"description": "", "description": "",
"keywords": [], "keywords": [],
"order": 2, "order": 2,
"services": [], "services": [
"catchAdmin\\system\\SystemService"
],
"aliases": {}, "aliases": {},
"files": [], "files": [],
"requires": [] "requires": [],
"enable": true
} }

View File

@@ -1,31 +1,33 @@
<?php <?php
// 登录日志 $router->group(function () use ($router){
$router->get('log/login', '\catchAdmin\system\controller\LoginLog@list'); // 登录日志
$router->delete('loginLog/empty', '\catchAdmin\system\controller\LoginLog@empty'); $router->get('log/login', '\catchAdmin\system\controller\LoginLog@list');
// 操作日志 $router->delete('loginLog/empty', '\catchAdmin\system\controller\LoginLog@empty');
$router->get('log/operate', '\catchAdmin\system\controller\OperateLog@list'); // 操作日志
$router->delete('operateLog/empty', '\catchAdmin\system\controller\OperateLog@empty'); $router->get('log/operate', '\catchAdmin\system\controller\OperateLog@list');
$router->delete('operateLog/empty', '\catchAdmin\system\controller\OperateLog@empty');
// 数据字典 // 数据字典
$router->get('tables', '\catchAdmin\system\controller\DataDictionary@tables'); $router->get('tables', '\catchAdmin\system\controller\DataDictionary@tables');
$router->get('table/view/<table>', '\catchAdmin\system\controller\DataDictionary@view'); $router->get('table/view/<table>', '\catchAdmin\system\controller\DataDictionary@view');
$router->post('table/optimize', '\catchAdmin\system\controller\DataDictionary@optimize'); $router->post('table/optimize', '\catchAdmin\system\controller\DataDictionary@optimize');
$router->post('table/backup', '\catchAdmin\system\controller\DataDictionary@backup'); $router->post('table/backup', '\catchAdmin\system\controller\DataDictionary@backup');
// 上传 // 上传
$router->post('upload/image', '\catchAdmin\system\controller\Upload@image'); $router->post('upload/image', '\catchAdmin\system\controller\Upload@image');
$router->post('upload/file', '\catchAdmin\system\controller\Upload@file'); $router->post('upload/file', '\catchAdmin\system\controller\Upload@file');
// 附件 // 附件
$router->resource('attachments', '\catchAdmin\system\controller\Attachments'); $router->resource('attachments', '\catchAdmin\system\controller\Attachments');
// 配置 // 配置
$router->get('config/parent', '\catchAdmin\system\controller\Config@parent'); $router->get('config/parent', '\catchAdmin\system\controller\Config@parent');
$router->resource('config', '\catchAdmin\system\controller\Config'); $router->resource('config', '\catchAdmin\system\controller\Config');
// 代码生成 // 代码生成
$router->post('generate', '\catchAdmin\system\controller\Generate@save'); $router->post('generate', '\catchAdmin\system\controller\Generate@save');
$router->post('generate/preview', '\catchAdmin\system\controller\Generate@preview'); // 预览 $router->post('generate/preview', '\catchAdmin\system\controller\Generate@preview'); // 预览
// 敏感词 // 敏感词
$router->resource('sensitive/word', '\catchAdmin\system\controller\SensitiveWord'); $router->resource('sensitive/word', '\catchAdmin\system\controller\SensitiveWord');
})->middleware('auth');