From 7acf3fca99660145b6b961fd2a2c7f3d4fec6b22 Mon Sep 17 00:00:00 2001 From: chenlan <18339827479@163.com> Date: Mon, 21 Jul 2025 16:58:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=A2=84=E9=80=89=E5=8F=82?= =?UTF-8?q?=E6=95=B0-=E7=B3=BB=E7=BB=9F=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/controller/PresetController.php | 17 ++++++++++++++- app/common/logic/SystemsLogic.php | 14 +++++++++++++ app/common/service/SystemsService.php | 24 ++++++++++++++++++++++ config/route.php | 1 + 4 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 app/common/logic/SystemsLogic.php create mode 100644 app/common/service/SystemsService.php diff --git a/app/common/controller/PresetController.php b/app/common/controller/PresetController.php index 964b2a6..a4b2a81 100644 --- a/app/common/controller/PresetController.php +++ b/app/common/controller/PresetController.php @@ -5,11 +5,14 @@ namespace app\common\controller; use support\Request; use app\common\service\CorpService; use app\common\service\CorpFeishuAppService; +use app\common\service\SystemsService; class PresetController extends BaseController { - protected $noNeedLogin = ['corps', 'feishuApp']; + protected $noNeedLogin = ['corps', 'feishuApp', 'systems']; + + protected $noNeedHeaderData = ['corps', 'feishuApp', 'systems']; public function corps() { @@ -33,4 +36,16 @@ class PresetController extends BaseController return $this->error($e->getMessage()); } } + + + + public function systems() + { + try { + $result = (new SystemsService())->getList(); + return $this->success($result, '获取系统列表'); + } catch (\Throwable $e) { + return $this->error($e->getMessage()); + } + } } \ No newline at end of file diff --git a/app/common/logic/SystemsLogic.php b/app/common/logic/SystemsLogic.php new file mode 100644 index 0000000..5411264 --- /dev/null +++ b/app/common/logic/SystemsLogic.php @@ -0,0 +1,14 @@ +orderBy('sort', 'asc')->get(['id', 'name', 'code', 'icon', 'type']); + } +} \ No newline at end of file diff --git a/app/common/service/SystemsService.php b/app/common/service/SystemsService.php new file mode 100644 index 0000000..10b80a3 --- /dev/null +++ b/app/common/service/SystemsService.php @@ -0,0 +1,24 @@ +logic = (new SystemsLogic()); + } + + /** + * 获取系统list + */ + public function getList() + { + return $this->logic->getList(); + } +} \ No newline at end of file diff --git a/config/route.php b/config/route.php index 4ed7455..e5bb7f2 100644 --- a/config/route.php +++ b/config/route.php @@ -47,6 +47,7 @@ Route::group('/common', function () { Route::group('/preset', function () { Route::any('/corps', [app\common\controller\PresetController::class, 'corps']); Route::any('/feishu/app', [app\common\controller\PresetController::class, 'feishuApp']); + Route::any('/systems', [app\common\controller\PresetController::class, 'systems']); }); });