Files
fdesk/app/common/controller/PresetController.php
T

63 lines
1.6 KiB
PHP
Raw Normal View History

2025-07-17 10:42:43 +08:00
<?php
namespace app\common\controller;
use support\Request;
use app\common\service\CorpService;
use app\common\service\CorpFeishuAppService;
2025-07-21 16:58:22 +08:00
use app\common\service\SystemsService;
2025-07-23 17:06:48 +08:00
use app\common\service\UserService;
2025-07-17 10:42:43 +08:00
class PresetController extends BaseController
{
2025-07-21 16:58:22 +08:00
protected $noNeedLogin = ['corps', 'feishuApp', 'systems'];
protected $noNeedHeaderData = ['corps', 'feishuApp', 'systems'];
2025-07-17 10:42:43 +08:00
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());
}
}
2025-07-21 16:58:22 +08:00
public function systems()
{
try {
$result = (new SystemsService())->getList();
return $this->success($result, '获取系统列表');
} catch (\Throwable $e) {
return $this->error($e->getMessage());
}
}
2025-07-23 17:06:48 +08:00
public function users()
{
try {
$result = (new UserService())->getList();
return $this->success($result, '获取用户列表');
} catch (\Throwable $e) {
return $this->error($e->getMessage());
}
}
2025-07-17 10:42:43 +08:00
}