getLiveUrl($this->userId); return message(1010, true, $urls); } /** * 直播详情 * @param LiveValidator $validator * @return array */ public function getInfo(LiveValidator $validator) { $params = request()->all(); $params = $validator->check($params, 'info'); if (!is_array($params)) { return message($params, false); } if(!$info = LiveService::make()->getInfo($params['id'], $this->userId)){ return message(LiveService::make()->getError(),false); }else{ return message(1010,true, $info); } } /** * 创建直播间(开启直播) * @return array */ public function create(LiveValidator $validator) { $params = request()->all(); $params = $validator->check($params, 'create'); if (!is_array($params)) { return message($params, false); } if(!$result = LiveService::make()->create($this->userId, $params)){ return message(LiveService::make()->getError(),false); }else{ return message(LiveService::make()->getError(),true, $result); } } }