50 lines
1.3 KiB
PHP
50 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Controller;
|
|
|
|
use App\Request\SafeRequest;
|
|
use App\Services\SafeService;
|
|
use Psr\Container\ContainerExceptionInterface;
|
|
use Psr\Container\NotFoundExceptionInterface;
|
|
use Psr\Http\Message\ResponseInterface;
|
|
|
|
class SafeController extends AbstractController
|
|
{
|
|
/**
|
|
* 获取oss签名数据
|
|
* @return ResponseInterface
|
|
* @throws ContainerExceptionInterface
|
|
* @throws NotFoundExceptionInterface
|
|
*/
|
|
public function getOssSign(): ResponseInterface
|
|
{
|
|
$request = $this->container->get(SafeRequest::class);
|
|
$request->scene('getOssSign')->validateResolved();
|
|
|
|
$SafeService = new SafeService();
|
|
$data = $SafeService->getOssSign();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 获取im签名数据
|
|
* @return ResponseInterface
|
|
*/
|
|
public function getImSign(): ResponseInterface
|
|
{
|
|
$SafeService = new SafeService();
|
|
$data = $SafeService->getImSign();
|
|
return $this->response->json($data);
|
|
}
|
|
|
|
/**
|
|
* 获取音视频签名数据
|
|
* @return ResponseInterface
|
|
*/
|
|
public function getVideoSign(): ResponseInterface
|
|
{
|
|
$SafeService = new SafeService();
|
|
$data = $SafeService->getVideoSign();
|
|
return $this->response->json($data);
|
|
}
|
|
} |