增加预选参数-系统列表

This commit is contained in:
2025-07-21 16:58:22 +08:00
committed by mzl
parent 608a952ffc
commit 7acf3fca99
4 changed files with 55 additions and 1 deletions
+16 -1
View File
@@ -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());
}
}
}
+14
View File
@@ -0,0 +1,14 @@
<?php
namespace app\common\logic;
use app\common\model\Systems;
class SystemsLogic
{
public function getList()
{
return Systems::where('status', 1)->orderBy('sort', 'asc')->get(['id', 'name', 'code', 'icon', 'type']);
}
}
+24
View File
@@ -0,0 +1,24 @@
<?php
namespace app\common\service;
use app\common\logic\SystemsLogic;
class SystemsService
{
protected $logic;
public function __construct()
{
$this->logic = (new SystemsLogic());
}
/**
* 获取系统list
*/
public function getList()
{
return $this->logic->getList();
}
}
+1
View File
@@ -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']);
});
});