Procházet zdrojové kódy

大华视频服务器摄像头同步和播放接口

任敬轩 před 1 rokem
rodič
revize
6c0c02c47c

+ 1 - 0
Modules/Camera/Http/Controllers/Api/CameraApiController.php

@@ -645,6 +645,7 @@ class CameraApiController extends BaseController
                 //同步大华视频服务器摄像头
                 $tdwy = new TdwyController();
                 $tdwy->dahuaRtsp($camera_id,$parent_id);
+                $result = $tdwy->dahuaRtsp($camera_id,$parent_id);
             }
             //信息技术中心测试ws协议
 //            elseif($mine_res[0]-> slug == 'XinXiJiShuZhongXin'){

+ 3 - 49
Modules/Camera/Http/Controllers/Api/TdwyController.php

@@ -313,9 +313,9 @@ class TdwyController extends BaseController
 
             //获取public_key
             $url = '/evo-apigw/evo-oauth/1.0.0/oauth/public-key';
-            $result = $this->httpRequest($ip.$url);
-            if($result['data']['publicKey']){
-                $public_key = $result['data']['publicKey'];
+            $result1 = $this->httpRequest($ip.$url);
+            if($result1['data']['publicKey']){
+                $public_key = $result1['data']['publicKey'];
             }else{
                 return;
             }
@@ -364,52 +364,6 @@ class TdwyController extends BaseController
         }
     }
 
-    //大华摄像头
-    public function geturl(Request $request){
-        $ip = 'https://222.75.25.198:8443';
-        $url = '/evo-apigw/evo-oauth/1.0.0/oauth/public-key';
-        $result = $this->httpRequest($ip.$url);
-        $public_key = $result['data']['publicKey'];
-
-        $url2 = '/evo-apigw/evo-oauth/1.0.0/oauth/extend/token';
-        $password = $this->rsaEncode("xxzx!#%246",$public_key);
-        $params = [
-            'grant_type'=>'password',
-            'username'=>'system',
-            'password'=>$password,
-            'client_id'=>'dahua',
-            'client_secret'=>'45815ebb-300c-416f-8adf-da07a07fab8a',
-            'public_key'=>$public_key
-        ];
-        $result2 = $this->httpRequest($ip.$url2,'post',$params);
-        $access_token = $result2['data']['access_token'];
-
-        $url3 = '/evo-apigw/evo-brm/1.2.0/device/channel/subsystem/page';
-        $params2 = [
-            'pageNum'=>1,
-            'pageSize'=>1000,
-            'sortType'=>'ASC',
-            'sort'=>'channelSn',
-//            'isOnline'=>0,
-//            'stat'=>1
-        ];
-//        dd($params2);
-        $result3 = $this->httpRequest($ip.$url3,'post',$params2,$access_token);
-//        dd($result3);
-//        1000006$1$0$0    1000012$1$0$0
-
-        $url4 = '/evo-apigw/admin/API/MTS/Video/StartVideo';
-        $params3['data'] = [
-            'channelId'=>'1000006$1$0$0',
-            'dataType'=>'1',
-            'streamType'=>'1'
-        ];
-//        dd($params3);
-        $result4 = $this->httpRequest($ip.$url4,'post',$params3,$access_token);
-        $result4['access_token'] = $access_token;
-        dd($result4);
-    }
-
     //接口第三方调用
     public function httpRequest($url, $format = 'get', $data = null, $token = null){
         //设置头信息

+ 1 - 2
Modules/Camera/Routes/api.php

@@ -76,6 +76,5 @@ Route::namespace('Api')->group(function () {
     Route::post('task_xixuan/area_work_search', 'CameraApiController@areaWorkSearch');//首頁片区作业查询
 
     //大华视频接口
-    Route::post('task_xixuan/geturl','TdwyController@geturl');
-    Route::post('task_xixuan/dahua_camera','TdwyController@dahuaCamera');
+    Route::post('task_xixuan/dahua_camera','TdwyController@dahuaCamera');//大华手动同步
 });