36 lines
885 B
PHP
36 lines
885 B
PHP
|
|
<?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());
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|