瀏覽代碼

微信分集审核证据

liuzejian 1 年之前
父節點
當前提交
8089c9ba06

+ 17 - 1
modules/Video/Http/Controllers/VideoSeriesWechatCheckController.php

@@ -61,7 +61,7 @@ class VideoSeriesWechatCheckController extends CatchController
     }
 
     /**
-     * 获取微信那边的剧集播放链接
+     * 获取微信的剧集播放链接
      * @param Request $request
      * @return mixed
      * @throws \Illuminate\Validation\ValidationException
@@ -86,4 +86,20 @@ class VideoSeriesWechatCheckController extends CatchController
         Redis::setex($redisKey, 6000, $link);
         return $link;
     }
+
+    public function listEvidence(Request $request) {
+        $this->validate($request, [
+            'series_id' => 'required'
+        ]);
+        $info = DB::table('video_series_wechat_check')
+            ->where([
+                'series_id' => $request->input('series_id'),
+                'is_enabled' => 1
+            ])->orderBy('id', 'desc')
+            ->select('evidence_material_id_list', 'appid')->first();
+        if($info) {
+            $evidence_material_id_lists = \json_decode($info->evidence_material_id_list, true);
+            $accessToken = WechatMiniprogramService::getDuanjuCheckAccessToken($info->appid);
+        }
+    }
 }

+ 2 - 0
modules/Video/Http/Controllers/WechatCheckController.php

@@ -59,6 +59,7 @@ class WechatCheckController extends CatchController
         DB::table('video_wechat_check')
             ->where('id', $request->input('id'))
             ->where('is_enabled', 1)
+            ->whereIn('status', [0,4])
             ->update($data);
         return 'ok';
     }
@@ -70,6 +71,7 @@ class WechatCheckController extends CatchController
     public function delete(Request $request) {
         $this->validate($request, ['id' => 'required']);
         DB::table('video_wechat_check')
+            ->whereIn('status', [0,4])
             ->where([
                 'id' => $request->input('id'),
                 'is_enabled' => 1,

+ 1 - 0
modules/Video/Services/WechatCheckSyncService.php

@@ -34,6 +34,7 @@ class WechatCheckSyncService
      * @throws \GuzzleHttp\Exception\GuzzleException
      */
     public static function getMedialinkInfo($seriesId) {
+        return ['mp4_url' => 'http://www.baidu.com'];
         $syncInfo = DB::table('video_series_wechat_check')
             ->where([
                 'series_id'=> $seriesId,

+ 2 - 0
modules/Video/routes/route.php

@@ -23,8 +23,10 @@ Route::prefix('videoStock')->group(function () {
         Route::post('add', [WechatCheckController::class, 'add']);
         Route::get('list', [WechatCheckController::class, 'list']);
         Route::post('delete', [WechatCheckController::class, 'delete']);
+        Route::post('update', [WechatCheckController::class, 'update']);
         Route::prefix('videoSeries')->group(function(){
             Route::post('syncWechat', [VideoSeriesWechatCheckController::class, 'syncWechat']);
+            Route::post('medialink', [VideoSeriesWechatCheckController::class, 'medialink']);
         });
     });
 

+ 2 - 2
tests/UsedTestCase.php

@@ -13,9 +13,9 @@ abstract class UsedTestCase extends BaseTestCase
     {
         parent::setUp(); // TODO: Change the autogenerated stub
         $tokenInfo = $this->post('http://localhost/api/login', [
-//            'email' => 'catch@admin.com',
+            'email' => 'catch@admin.com',
             'remember' => false,
-            'email' => 'xiaoli@qq.com',
+//            'email' => 'xiaoli@qq.com',
             'password' => 'catchadmin',
 //            'email' => 'aa4@test.com',
         ])->json();

+ 9 - 1
tests/Video/Http/Controllers/VideoSeriesWechatCheckControllerTest.php

@@ -16,7 +16,15 @@ class VideoSeriesWechatCheckControllerTest extends UsedTestCase
         ])->json('post','http://localhost/api/videoStock/wechatCheck/videoSeries/syncWechat', [
             'series_ids' => [81,82,83,84,85],
         ]);
-        $res->dump();
+        $this->dumpJson($res);
+    }
+    public function testmedialink()
+    {
+        $res = $this->withHeaders([
+            'Authorization' => 'Bearer '. $this->token,
+        ])->json('post','http://localhost/api/videoStock/wechatCheck/videoSeries/medialink', [
+            'series_id' => 81,
+        ]);
         $this->dumpJson($res);
     }
 }

+ 1 - 1
tests/Video/Http/Controllers/WechatCheckControllerTest.php

@@ -32,6 +32,6 @@ class WechatCheckControllerTest extends UsedTestCase
             'producer' => 'zzz',
             'playwright' =>  'xxxx',
         ]);
-        $res->dump();
+        $this->dumpJson($res);
     }
 }