|
|
@@ -3,9 +3,6 @@
|
|
|
namespace App\Http\Controllers\Api\v1;
|
|
|
|
|
|
use App\Http\Controllers\Api\webApp;
|
|
|
-use App\Http\Validator\GoodsValidator;
|
|
|
-use App\Services\Api\GoodsService;
|
|
|
-use App\Services\Api\GoodsCategoryService;
|
|
|
use App\Services\Api\VideoService;
|
|
|
use App\Services\RedisService;
|
|
|
use Illuminate\Http\Request;
|
|
|
@@ -26,23 +23,6 @@ class VideoController extends webApp
|
|
|
try {
|
|
|
$params = request()->post();
|
|
|
$pageSize = request()->post('pageSize', 0);
|
|
|
- $type = request()->post('type', 1);
|
|
|
- // 我的视频
|
|
|
- if($type == 1){
|
|
|
-
|
|
|
- }
|
|
|
- // 喜欢的视频
|
|
|
- else if ($type == 2){
|
|
|
-
|
|
|
- }
|
|
|
- // 收藏的视频
|
|
|
- else if ($type == 3){
|
|
|
-
|
|
|
- }
|
|
|
- // 观看历史
|
|
|
- else if ($type == 4){
|
|
|
-
|
|
|
- }
|
|
|
$datas = VideoService::make()->getDataList($params, $pageSize,'', $this->userId);
|
|
|
return message(1010, true, $datas);
|
|
|
} catch (\Exception $exception){
|
|
|
@@ -60,25 +40,31 @@ class VideoController extends webApp
|
|
|
try {
|
|
|
$params = request()->post();
|
|
|
$pageSize = request()->post('pageSize', 0);
|
|
|
- $datas = VideoService::make()->getDataList($params, $pageSize,'lev_a.*,lev_c.name as merch_name', $this->userId);
|
|
|
+ $type = request()->post('type', 1);
|
|
|
+ // 我的视频
|
|
|
+ if($type == 1){
|
|
|
+ $datas = VideoService::make()->getDataList($params, $pageSize,'', $this->userId);
|
|
|
+ }
|
|
|
+ // 喜欢的视频
|
|
|
+ else if ($type == 2){
|
|
|
+
|
|
|
+ }
|
|
|
+ // 收藏的视频
|
|
|
+ else if ($type == 3){
|
|
|
+
|
|
|
+ }
|
|
|
+ // 观看历史
|
|
|
+ else if ($type == 4){
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
return message(1010, true, $datas);
|
|
|
} catch (\Exception $exception){
|
|
|
- RedisService::set("caches:request:error_goods_index", ['trace'=>$exception->getTrace()], 7200);
|
|
|
+ RedisService::set("caches:request:error_video_list", ['trace'=>$exception->getTrace()], 7200);
|
|
|
return message(1018, false, ['error'=>env('APP_DEBUG')? $exception->getTrace() : '']);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 分类
|
|
|
- * @return array
|
|
|
- */
|
|
|
- public function category()
|
|
|
- {
|
|
|
- $params = request()->post();
|
|
|
- $pageSize = request()->post('pageSize', 99);
|
|
|
- $datas = GoodsCategoryService::make()->getDataList($params, $pageSize);
|
|
|
- return message(1010, true, $datas);
|
|
|
- }
|
|
|
|
|
|
/**
|
|
|
* 详情
|
|
|
@@ -87,7 +73,7 @@ class VideoController extends webApp
|
|
|
public function info()
|
|
|
{
|
|
|
$id = request()->post('id', 0);
|
|
|
- $info = GoodsService::make()->getInfo($id, $this->userId);
|
|
|
+ $info = VideoService::make()->getInfo($id, $this->userId);
|
|
|
return message(1010, true, $info);
|
|
|
}
|
|
|
|