Merge branch 'feature/mzl_dev' into develop

This commit is contained in:
mzl
2025-07-11 17:16:45 +08:00
parent 3ef2957db3
commit 96b6637814
7 changed files with 121 additions and 3 deletions
@@ -0,0 +1,36 @@
<?php
namespace app\common\controller;
use support\Request;
use app\common\service\CorpService;
use app\common\service\CorpFeishuAppService;
class PresetController extends BaseController
{
protected $noNeedLogin = ['corps', 'feishuApp'];
public function corps()
{
try {
$result = (new CorpService())->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());
}
}
}
+16
View File
@@ -0,0 +1,16 @@
<?php
namespace app\common\logic;
use app\common\model\CorpFeishuApp;
class CorpFeishuAppLogic
{
public function getFeishuApp($corpId)
{
return CorpFeishuApp::where('corp_id', $corpId)->first(['id', 'corp_id', 'name', 'app_id', 'r_url', 'state']);
}
}
+14
View File
@@ -0,0 +1,14 @@
<?php
namespace app\common\logic;
use app\common\model\Corp;
class CorpLogic
{
public function getList()
{
return Corp::where('status', 1)->orderBy('sort', 'asc')->get(['id', 'name', 'abbr', 'tenant_key']);
}
}
@@ -0,0 +1,21 @@
<?php
namespace app\common\service;
use app\common\logic\CorpFeishuAppLogic;
class CorpFeishuAppService
{
protected $logic;
public function __construct()
{
$this->logic = (new CorpFeishuAppLogic());
}
public function getFeishuApp(int $corpId)
{
return $this->logic->getFeishuApp($corpId);
}
}
+24
View File
@@ -0,0 +1,24 @@
<?php
namespace app\common\service;
use app\common\logic\CorpLogic;
class CorpService
{
protected $logic;
public function __construct()
{
$this->logic = (new CorpLogic());
}
/**
* 获取公司list
*/
public function getList()
{
return $this->logic->getList();
}
}