Browse Source

fix: 新增直播(断流,推流,异常)回调接口

wh 2 years ago
parent
commit
23ffc91bee
3 changed files with 328 additions and 5 deletions
  1. 8 4
      api/ApiController.php
  2. 2 0
      composer.json
  3. 318 1
      composer.lock

+ 8 - 4
api/ApiController.php

@@ -35,7 +35,6 @@ use App\System\Service\Excel\ExportExcelHandle;
 use Hyperf\Engine\Http\Client;
 use Api\InterfaceApi\v1\HttpClient;
 
-use Monolog\Logger;
 use Psr\Log\LoggerInterface;
 use Hyperf\Logger\LoggerFactory;
 
@@ -203,10 +202,15 @@ class ApiController extends MineApi
     /**
      * 推流回调接口
      */
-    #[PostMapping("notify")]
-    public function notify(): ResponseInterface
+    #[PostMapping("notify/{type}")]
+    public function notify(string $type): ResponseInterface
     {
-        $this->logger->info(var_export($this->request->all(),true ));
+        // 通过事件分发处理
+        
+        //todo
+
+
+        $this->logger->info(var_export(array_merge($this->request->all(),['type'=>$type]),true ));
         return $this->success('',$this->request->all() );
     }
 

+ 2 - 0
composer.json

@@ -13,7 +13,9 @@
     "96qbhy/hyperf-auth": "^3.0",
     "hashids/hashids": "^4.1",
     "phpoffice/phpspreadsheet": "^1.29",
+    "qcloud/vod-sdk-v5": "^2.4",
     "qiniu/php-sdk": "^7.11",
+    "tencentcloud/tencentcloud-sdk-php": "^3.0",
     "xmo/jwt-auth": "0.6.*",
     "xmo/mine-core": "^1.5",
     "xmo/mine-office": "1.*",

+ 318 - 1
composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "aa5b3f75131783698fab5624de7406a2",
+    "content-hash": "b5ab2386c8c3e29f7de5b895da49f5c1",
     "packages": [
         {
             "name": "96qbhy/hyperf-auth",
@@ -945,6 +945,65 @@
             ],
             "time": "2023-11-12T22:16:48+00:00"
         },
+        {
+            "name": "guzzlehttp/command",
+            "version": "1.3.1",
+            "dist": {
+                "type": "zip",
+                "url": "https://mirrors.cloud.tencent.com/repository/composer/guzzlehttp/command/1.3.1/guzzlehttp-command-1.3.1.zip",
+                "reference": "0eebc653784f4902b3272e826fe8e88743d14e77",
+                "shasum": ""
+            },
+            "require": {
+                "guzzlehttp/guzzle": "^7.8",
+                "guzzlehttp/promises": "^1.5.3 || ^2.0.1",
+                "guzzlehttp/psr7": "^1.9.1 || ^2.5.1",
+                "php": "^7.2.5 || ^8.0"
+            },
+            "require-dev": {
+                "bamarni/composer-bin-plugin": "^1.8.2",
+                "phpunit/phpunit": "^8.5.19 || ^9.5.8"
+            },
+            "type": "library",
+            "extra": {
+                "bamarni-bin": {
+                    "bin-links": true,
+                    "forward-command": false
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "GuzzleHttp\\Command\\": "src/"
+                }
+            },
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Graham Campbell",
+                    "email": "hello@gjcampbell.co.uk",
+                    "homepage": "https://github.com/GrahamCampbell"
+                },
+                {
+                    "name": "Michael Dowling",
+                    "email": "mtdowling@gmail.com",
+                    "homepage": "https://github.com/mtdowling"
+                },
+                {
+                    "name": "Jeremy Lindblom",
+                    "email": "jeremeamia@gmail.com",
+                    "homepage": "https://github.com/jeremeamia"
+                },
+                {
+                    "name": "Tobias Nyholm",
+                    "email": "tobias.nyholm@gmail.com",
+                    "homepage": "https://github.com/Nyholm"
+                }
+            ],
+            "description": "Provides the foundation for building command-based web service clients",
+            "time": "2023-12-03T20:46:20+00:00"
+        },
         {
             "name": "guzzlehttp/guzzle",
             "version": "7.8.1",
@@ -1047,6 +1106,69 @@
             ],
             "time": "2023-12-03T20:35:24+00:00"
         },
+        {
+            "name": "guzzlehttp/guzzle-services",
+            "version": "1.4.1",
+            "dist": {
+                "type": "zip",
+                "url": "https://mirrors.cloud.tencent.com/repository/composer/guzzlehttp/guzzle-services/1.4.1/guzzlehttp-guzzle-services-1.4.1.zip",
+                "reference": "bcab7c0d61672b606510a6fe5af3039d04968c0f",
+                "shasum": ""
+            },
+            "require": {
+                "guzzlehttp/command": "^1.3.1",
+                "guzzlehttp/guzzle": "^7.8",
+                "guzzlehttp/psr7": "^1.9.1 || ^2.5.1",
+                "guzzlehttp/uri-template": "^1.0.1",
+                "php": "^7.2.5 || ^8.0"
+            },
+            "require-dev": {
+                "bamarni/composer-bin-plugin": "^1.8.2",
+                "phpunit/phpunit": "^8.5.19 || ^9.5.8"
+            },
+            "suggest": {
+                "gimler/guzzle-description-loader": "^0.0.4"
+            },
+            "type": "library",
+            "extra": {
+                "bamarni-bin": {
+                    "bin-links": true,
+                    "forward-command": false
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "GuzzleHttp\\Command\\Guzzle\\": "src/"
+                }
+            },
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Graham Campbell",
+                    "email": "hello@gjcampbell.co.uk",
+                    "homepage": "https://github.com/GrahamCampbell"
+                },
+                {
+                    "name": "Michael Dowling",
+                    "email": "mtdowling@gmail.com",
+                    "homepage": "https://github.com/mtdowling"
+                },
+                {
+                    "name": "Stefano Kowalke",
+                    "email": "blueduck@mail.org",
+                    "homepage": "https://github.com/Konafets"
+                },
+                {
+                    "name": "Tobias Nyholm",
+                    "email": "tobias.nyholm@gmail.com",
+                    "homepage": "https://github.com/Nyholm"
+                }
+            ],
+            "description": "Provides an implementation of the Guzzle Command library that uses Guzzle service descriptions to describe web services, serialize requests, and parse responses into easy to use model structures.",
+            "time": "2023-12-03T20:48:14+00:00"
+        },
         {
             "name": "guzzlehttp/promises",
             "version": "2.0.2",
@@ -1198,6 +1320,68 @@
             ],
             "time": "2023-12-03T20:05:35+00:00"
         },
+        {
+            "name": "guzzlehttp/uri-template",
+            "version": "v1.0.3",
+            "dist": {
+                "type": "zip",
+                "url": "https://mirrors.cloud.tencent.com/repository/composer/guzzlehttp/uri-template/v1.0.3/guzzlehttp-uri-template-v1.0.3.zip",
+                "reference": "ecea8feef63bd4fef1f037ecb288386999ecc11c",
+                "shasum": ""
+            },
+            "require": {
+                "php": "^7.2.5 || ^8.0",
+                "symfony/polyfill-php80": "^1.24"
+            },
+            "require-dev": {
+                "bamarni/composer-bin-plugin": "^1.8.2",
+                "phpunit/phpunit": "^8.5.36 || ^9.6.15",
+                "uri-template/tests": "1.0.0"
+            },
+            "type": "library",
+            "extra": {
+                "bamarni-bin": {
+                    "bin-links": true,
+                    "forward-command": false
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "GuzzleHttp\\UriTemplate\\": "src"
+                }
+            },
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Graham Campbell",
+                    "email": "hello@gjcampbell.co.uk",
+                    "homepage": "https://github.com/GrahamCampbell"
+                },
+                {
+                    "name": "Michael Dowling",
+                    "email": "mtdowling@gmail.com",
+                    "homepage": "https://github.com/mtdowling"
+                },
+                {
+                    "name": "George Mponos",
+                    "email": "gmponos@gmail.com",
+                    "homepage": "https://github.com/gmponos"
+                },
+                {
+                    "name": "Tobias Nyholm",
+                    "email": "tobias.nyholm@gmail.com",
+                    "homepage": "https://github.com/Nyholm"
+                }
+            ],
+            "description": "A polyfill class for uri_template of PHP",
+            "keywords": [
+                "guzzlehttp",
+                "uri-template"
+            ],
+            "time": "2023-12-03T19:50:20+00:00"
+        },
         {
             "name": "hashids/hashids",
             "version": "4.1.0",
@@ -5514,6 +5698,99 @@
             ],
             "time": "2021-10-29T13:26:27+00:00"
         },
+        {
+            "name": "qcloud/cos-sdk-v5",
+            "version": "v2.6.8",
+            "dist": {
+                "type": "zip",
+                "url": "https://mirrors.cloud.tencent.com/repository/composer/qcloud/cos-sdk-v5/v2.6.8/qcloud-cos-sdk-v5-v2.6.8.zip",
+                "reference": "6bbce32516a4932aca3e7b8cdcc734eb2b1ec5d4",
+                "shasum": ""
+            },
+            "require": {
+                "ext-curl": "*",
+                "ext-json": "*",
+                "ext-mbstring": "*",
+                "ext-simplexml": "*",
+                "guzzlehttp/guzzle": "^6.2.1 || ^7.0",
+                "guzzlehttp/guzzle-services": "^1.1",
+                "guzzlehttp/psr7": "^1.3.1 || ^2.0",
+                "php": ">=5.6"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "2.4-dev"
+                }
+            },
+            "autoload": {
+                "files": [
+                    "src/Common.php"
+                ],
+                "psr-4": {
+                    "Qcloud\\Cos\\": "src/"
+                }
+            },
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "yaozongyou",
+                    "email": "yaozongyou@vip.qq.com"
+                },
+                {
+                    "name": "lewzylu",
+                    "email": "327874225@qq.com"
+                },
+                {
+                    "name": "tuunalai",
+                    "email": "550566181@qq.com"
+                }
+            ],
+            "description": "PHP SDK for QCloud COS",
+            "keywords": [
+                "cos",
+                "php",
+                "qcloud"
+            ],
+            "time": "2023-11-07T07:15:40+00:00"
+        },
+        {
+            "name": "qcloud/vod-sdk-v5",
+            "version": "v2.4.4",
+            "dist": {
+                "type": "zip",
+                "url": "https://mirrors.cloud.tencent.com/repository/composer/qcloud/vod-sdk-v5/v2.4.4/qcloud-vod-sdk-v5-v2.4.4.zip",
+                "reference": "916f6f6e1e65085e4bc407e7afe937947b997aff",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.6.33",
+                "qcloud/cos-sdk-v5": "^v2.0.0",
+                "tencentcloud/tencentcloud-sdk-php": "^3.0.166"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^5.7"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Vod\\": "src/Vod/"
+                }
+            },
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "xujianguo",
+                    "email": "450846733@qq.com"
+                }
+            ],
+            "description": "VOD SDK For PHP",
+            "time": "2021-03-10T11:51:50+00:00"
+        },
         {
             "name": "qiniu/php-sdk",
             "version": "v7.11.0",
@@ -6971,6 +7248,46 @@
             ],
             "time": "2023-07-14T14:15:21+00:00"
         },
+        {
+            "name": "tencentcloud/tencentcloud-sdk-php",
+            "version": "3.0.1044",
+            "dist": {
+                "type": "zip",
+                "url": "https://mirrors.tencent.com/repository/composer/tencentcloud/tencentcloud-sdk-php/3.0.1044/tencentcloud-tencentcloud-sdk-php-3.0.1044.zip",
+                "reference": "b387584a85a30cc651da3ab8831ee8f34b4dcb83",
+                "shasum": ""
+            },
+            "require": {
+                "guzzlehttp/guzzle": "^6.3 || ^7.0",
+                "php": ">=5.6.0"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "^9.5"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "TencentCloud\\": "./src/TencentCloud"
+                },
+                "classmap": [
+                    "src/QcloudApi/QcloudApi.php"
+                ]
+            },
+            "license": [
+                "Apache-2.0"
+            ],
+            "authors": [
+                {
+                    "name": "coolli",
+                    "email": "tencentcloudapi@tencent.com",
+                    "homepage": "https://cloud.tencent.com/document/sdk/PHP",
+                    "role": "Developer"
+                }
+            ],
+            "description": "TencentCloudApi php sdk",
+            "homepage": "https://github.com/TencentCloud/tencentcloud-sdk-php",
+            "time": "2023-12-13T02:22:14+00:00"
+        },
         {
             "name": "thenorthmemory/xml",
             "version": "1.1.1",