Ver código fonte

风险作业接口修改

任敬轩 1 mês atrás
pai
commit
37275fa87e

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

@@ -775,6 +775,7 @@ class CameraApiController extends BaseController
     {
         $parent_id = Input::get('parent_id', '');
         $camera_id = Input::get('camera_id', '');
+        $type = Input::get('type', '');
 
         if (!$parent_id || !$camera_id) {
             return self::errorResponse(ApiEnum::STATUS_CODE_EMPTY);
@@ -817,7 +818,7 @@ class CameraApiController extends BaseController
 //
 //            }
             elseif($parent_id == '6561'){//洗选执法记录仪hls
-                $result = CameraServices::getCameraWssUrl($parent_id, $camera_id);
+                $result = CameraServices::getCameraWssUrl($parent_id, $camera_id,$type);
             }
             elseif($parent_id == '7004'){//鹰骏一矿外网ws
                 $result = CameraServices::getCameraWsUrl($parent_id, $camera_id);

+ 6 - 1
Modules/Camera/Http/Controllers/Api/HaiKangController.php

@@ -303,6 +303,7 @@ class HaiKangController extends BaseController
         $parent_id  = Input::get('parent_id');
         $protocol   = Input::get('protocol', 'hls');
         $streamType = Input::get('streamType', 1);
+        $type = Input::get('type', '');
         $url        = $this->artemis . '/api/video/v2/cameras/previewURLs';
 //        $cameras_info = json_decode($this->getCamerasInfo(Input::all()), true);
         //请求参数
@@ -310,7 +311,11 @@ class HaiKangController extends BaseController
 //        $params['regionIndexCode'] = $request->input('regionIndexCode');
         $params['cameraIndexCode'] = Input::get('cameraIndexCode');
         $params['streamType']      = $streamType;  //0主码流 1子码流 2第三码流
-        $params['protocol']        = 'wss';
+        if($type != ''){
+            $params['protocol']        = 'ws';
+        }else{
+            $params['protocol']        = 'wss';
+        }
         $params['transmode']       = 1;  //0:UDP 1:TCP
         $params['expand'] = 'streamform=rtp';
 

+ 3 - 2
Modules/Camera/Services/CameraServices.php

@@ -1923,7 +1923,7 @@ class CameraServices
     }
 
     //洗选执法记录仪hls
-    public static function getCameraWssUrl($parent_id, $camera_id){
+    public static function getCameraWssUrl($parent_id, $camera_id,$type){
         $result['status'] = true;
         $result['msg']    = ApiEnum::RETURN_SUCCESS;
 
@@ -1939,7 +1939,8 @@ class CameraServices
                 'cameraIndexCode' => $camera->index_code,
                 'streamType'      => CameraEnum::CODE_STREAM_HAK[$camera->code_stream],
                 'protocol'        => 'ws',
-                'parent_id'       => $parent_id
+                'parent_id'       => $parent_id,
+                'type'            => $type
             ]
         );
         $haikang   = new HaiKangController();