post(); $pageSize = request()->post('pageSize', 0); $params['is_recommend'] = 1; $datas = VideoService::make()->getIndexList($params, $pageSize,'', $this->userId); return showJson(1010, true, $datas); } catch (\Exception $exception){ RedisService::set("caches:request:error_video_index", ['error'=>$exception->getMessage(),'trace'=>$exception->getTrace()], 7200); return showJson(1018, false, ['error'=>env('APP_DEBUG')? $exception->getMessage() : '']); } } /** * 列表 * @return array */ public function list() { // try { $params = request()->post(); $pageSize = request()->post('pageSize', 0); $datas = VideoService::make()->getDataList($params, $pageSize,'', $this->userId); return showJson(1010, true, $datas); // } catch (\Exception $exception){ // RedisService::set("caches:request:error_video_list", ['error'=>$exception->getMessage(),'trace'=>$exception->getTrace()], 7200); // return showJson(1018, false, ['error'=>env('APP_DEBUG')? $exception->getTrace() : '']); // } } /** * 短剧列表 * @return array */ public function shortList() { try { $params = request()->post(); $pageSize = request()->post('pageSize', 0); $datas = VideoService::make()->getShortlist($params, $pageSize,'', $this->userId); return showJson(1010, true, $datas); } catch (\Exception $exception){ RedisService::set("caches:request:error_video_short_list", ['error'=>$exception->getMessage(),'trace'=>$exception->getTrace()], 7200); return showJson(1018, false, ['error'=>env('APP_DEBUG')? $exception->getTrace() : '']); } } /** * 详情 * @return array */ public function info() { $id = request()->post('id', 0); $info = VideoService::make()->getInfo($id, $this->userId); if($info){ return showJson(1010, true, $info); }else{ return showJson(1009, false); } } /** * 详情 * @return array */ public function shortInfo() { $id = request()->post('id', 0); $info = VideoService::make()->getShortInfo($id, $this->userId); if($info){ return showJson(1010, true, $info); }else{ return showJson(1009, false); } } /** * 发布 * @return array */ public function publish(Request $request) { $params = request()->all(); if(!$result = VideoService::make()->publish($this->userId, $params, $request)){ return showJson(VideoService::make()->getError(), false); }else{ return showJson(VideoService::make()->getError(), true, $result); } } /** * 播放与浏览 * @return array */ public function updatePlay() { $id = request()->post('id',0); if(!$result = VideoService::make()->updatePlay($this->userId, $id)){ return showJson(VideoService::make()->getError(), false); }else{ return showJson(VideoService::make()->getError(), true, $result); } } /** * 点赞 * @return array|mixed */ public function like() { try{ $params = request()->post(); if(!$result = VideoCollectService::make()->collect($this->userId, $params)){ return showJson(VideoCollectService::make()->getError(), false); }else{ return showJson(VideoCollectService::make()->getError(), true, $result); } }catch (\Exception $exception){ return showJson(1003, false,$exception->getMessage()); } } /** * 收藏 * @return array|mixed */ public function collect() { try{ $params = request()->post(); if(!$result = VideoCollectService::make()->collect($this->userId, $params)){ return showJson(VideoCollectService::make()->getError(), false); }else{ return showJson(VideoCollectService::make()->getError(), true, $result); } }catch (\Exception $exception){ return showJson(1003, false,$exception->getMessage()); } } /** * 状态 * @return array|mixed */ public function status() { if(!$result = VideoService::make()->status()){ return showJson(VideoService::make()->getError(), false); }else{ return showJson(VideoService::make()->getError(), true, $result); } } /** * 状态 * @return array|mixed */ public function visible() { if(!$result = VideoService::make()->visible()){ return showJson(VideoService::make()->getError(), false); }else{ return showJson(VideoService::make()->getError(), true, $result); } } /** * 删除 * @return array|mixed */ public function delete() { if(!$result = VideoService::make()->delete()){ return showJson(VideoService::make()->getError(), false); }else{ return showJson(VideoService::make()->getError(), true); } } }