63 lines
1.6 KiB
PHP
63 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace app\common\controller;
|
|
|
|
use support\Request;
|
|
use app\common\service\CorpService;
|
|
use app\common\service\CorpFeishuAppService;
|
|
use app\common\service\SystemsService;
|
|
use app\common\service\UserService;
|
|
|
|
class PresetController extends BaseController
|
|
{
|
|
|
|
protected $noNeedLogin = ['corps', 'feishuApp', 'systems'];
|
|
|
|
protected $noNeedHeaderData = ['corps', 'feishuApp', 'systems'];
|
|
|
|
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());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function systems()
|
|
{
|
|
try {
|
|
$result = (new SystemsService())->getList();
|
|
return $this->success($result, '获取系统列表');
|
|
} catch (\Throwable $e) {
|
|
return $this->error($e->getMessage());
|
|
}
|
|
}
|
|
|
|
|
|
public function users()
|
|
{
|
|
try {
|
|
$result = (new UserService())->getList();
|
|
return $this->success($result, '获取用户列表');
|
|
} catch (\Throwable $e) {
|
|
return $this->error($e->getMessage());
|
|
}
|
|
}
|
|
} |