<?php
declare(strict_types=1);
namespace App\Controller\Admin;
use App\Controller\BaseController;
use Hyperf\HttpServer\Annotation\Controller;
use Hyperf\HttpServer\Annotation\PostMapping;
use Hyperf\HttpServer\Annotation\Middleware;
use Hyperf\HttpServer\Annotation\Middlewares;
use App\Middleware\LoginAuthMiddleware;
use App\Middleware\AdminAuthMiddleware;
class LiveController extends BaseController
{
public function index()
{
$reqParam = $this->request->all();
$list = $this->liveRepo->getLiveList($reqParam);
$data = [
'pages' => $list['pages'],
'list' => $list['data'],
];
return $this->success($data);
}
public function store()
{
$reqParam = $this->request->all();
$id = $this->liveRepo->saveLive($reqParam);
return $this->success($id);
}
public function getInfo()
{
$reqParam = $this->request->all();
$info = $this->liveRepo->getInfo($reqParam['id']);
$data = [
'info' => $info,
];
return $this->success($data);
}
public function destroy()
{
$reqParam = $this->request->all();
$this->liveRepo->deleteInfo($reqParam['id']);
return $this->success('ok');
}
public function getStreamInfo()
{
$reqParam = $this->request->all();
$info = $this->liveRepo->getStreamInfo($reqParam['id']);
$data = [
'info' => $info,
];
return $this->success($data);
}
public function searchLecturer()
{
$reqParam = $this->request->all();
$list = $this->liveRepo->searchLecturer($reqParam);
return $this->success($list);
}
}