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']); }); });