From 96b6637814f242c7e2add2ab54c5413d27d432e9 Mon Sep 17 00:00:00 2001 From: mzl Date: Fri, 11 Jul 2025 17:16:45 +0800 Subject: [PATCH] Merge branch 'feature/mzl_dev' into develop --- app/common/controller/PresetController.php | 36 +++++++++++++++++++++ app/common/logic/CorpFeishuAppLogic.php | 16 +++++++++ app/common/logic/CorpLogic.php | 14 ++++++++ app/common/service/CorpFeishuAppService.php | 21 ++++++++++++ app/common/service/CorpService.php | 24 ++++++++++++++ config/route.php | 5 +++ config/whitelist.php | 8 +++-- 7 files changed, 121 insertions(+), 3 deletions(-) create mode 100644 app/common/controller/PresetController.php create mode 100644 app/common/logic/CorpFeishuAppLogic.php create mode 100644 app/common/logic/CorpLogic.php create mode 100644 app/common/service/CorpFeishuAppService.php create mode 100644 app/common/service/CorpService.php diff --git a/app/common/controller/PresetController.php b/app/common/controller/PresetController.php new file mode 100644 index 0000000..964b2a6 --- /dev/null +++ b/app/common/controller/PresetController.php @@ -0,0 +1,36 @@ +getList(); + return $this->success($result, '获取公司列表'); + } catch (\Throwable $e) { + return $this->error($e->getMessage()); + } + } + + + + public function feishuApp(Request $request) + { + try { + $corpId = $request->get('corp_id'); + $result = (new CorpFeishuAppService())->getFeishuApp($corpId); + return $this->success($result, '获取飞书应用信息'); + } catch (\Throwable $e) { + return $this->error($e->getMessage()); + } + } +} \ No newline at end of file diff --git a/app/common/logic/CorpFeishuAppLogic.php b/app/common/logic/CorpFeishuAppLogic.php new file mode 100644 index 0000000..2073aac --- /dev/null +++ b/app/common/logic/CorpFeishuAppLogic.php @@ -0,0 +1,16 @@ +first(['id', 'corp_id', 'name', 'app_id', 'r_url', 'state']); + } + +} \ No newline at end of file diff --git a/app/common/logic/CorpLogic.php b/app/common/logic/CorpLogic.php new file mode 100644 index 0000000..cac9672 --- /dev/null +++ b/app/common/logic/CorpLogic.php @@ -0,0 +1,14 @@ +orderBy('sort', 'asc')->get(['id', 'name', 'abbr', 'tenant_key']); + } +} \ No newline at end of file diff --git a/app/common/service/CorpFeishuAppService.php b/app/common/service/CorpFeishuAppService.php new file mode 100644 index 0000000..0c10be8 --- /dev/null +++ b/app/common/service/CorpFeishuAppService.php @@ -0,0 +1,21 @@ +logic = (new CorpFeishuAppLogic()); + } + + public function getFeishuApp(int $corpId) + { + return $this->logic->getFeishuApp($corpId); + } +} \ No newline at end of file diff --git a/app/common/service/CorpService.php b/app/common/service/CorpService.php new file mode 100644 index 0000000..7d18d49 --- /dev/null +++ b/app/common/service/CorpService.php @@ -0,0 +1,24 @@ +logic = (new CorpLogic()); + } + + /** + * 获取公司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 b87f54a..94f8269 100644 --- a/config/route.php +++ b/config/route.php @@ -41,6 +41,11 @@ Route::group('/common', function () { Route::group('/user', function () { Route::any('/info', [app\common\controller\UserController::class, 'info']); }); + + Route::group('/preset', function () { + Route::any('/corps', [app\common\controller\PresetController::class, 'corps']); + Route::any('/feishu/app', [app\common\controller\PresetController::class, 'feishuApp']); + }); }); Route::group('/admin', function () { diff --git a/config/whitelist.php b/config/whitelist.php index d1669b3..e601d30 100644 --- a/config/whitelist.php +++ b/config/whitelist.php @@ -2,8 +2,10 @@ return [ 'basi_cdata' => [ - '/', - '/index/index', - '/index/view' + '/', // 首页 + '/index/index', // 首页 + '/index/view', // 飞书调试 + '/common/preset/corps', // 公司列表 + '/common/preset/feishu/app', // 飞书应用信息 ] ]; \ No newline at end of file