From b69da8ce6811202d8823f72638549624af4c7a69 Mon Sep 17 00:00:00 2001 From: LiuXin Date: Wed, 20 Aug 2025 15:51:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DahAlarm/DahuaGeneralCtlService.cs | 18 ++++----- .../DaHua/VideoManageController.cs | 38 +++++++++---------- .../Dahvision/DahuaGeneralCtlService.cs | 1 - 3 files changed, 28 insertions(+), 29 deletions(-) diff --git a/WeiCloud.Fusion/AlarmService/Alarm.DomainService/DahAlarm/DahuaGeneralCtlService.cs b/WeiCloud.Fusion/AlarmService/Alarm.DomainService/DahAlarm/DahuaGeneralCtlService.cs index b22d34c..b83941a 100644 --- a/WeiCloud.Fusion/AlarmService/Alarm.DomainService/DahAlarm/DahuaGeneralCtlService.cs +++ b/WeiCloud.Fusion/AlarmService/Alarm.DomainService/DahAlarm/DahuaGeneralCtlService.cs @@ -18,7 +18,7 @@ namespace Alarm.DomainService.DahAlarm private readonly IMqttClientService _mqttClientService; private readonly ITokenProviderService _tokenProviderService; - // private readonly HttpClient _http; + private readonly HttpClient _http; private string mqttHostIp; private int mqttHostPort; @@ -50,16 +50,16 @@ namespace Alarm.DomainService.DahAlarm topicName = _configuration["SubscribeMQTT:TopicName"]!; _mqttClientService = mqttClientService; _tokenProviderService = tokenProviderService; - // _http = http; + _http = http; } - /// - /// 开发测试的时候,忽略证书 - /// - private static readonly HttpClient _http = new(new HttpClientHandler - { - ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator, - }); + ///// + ///// 开发测试的时候,忽略证书 + ///// + //private static readonly HttpClient _http = new(new HttpClientHandler + //{ + // ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator, + //}); /// /// 新增报警事件订阅 diff --git a/WeiCloud.Fusion/VideoService/Video.API/Controllers/DaHua/VideoManageController.cs b/WeiCloud.Fusion/VideoService/Video.API/Controllers/DaHua/VideoManageController.cs index e1f0add..ae228ae 100644 --- a/WeiCloud.Fusion/VideoService/Video.API/Controllers/DaHua/VideoManageController.cs +++ b/WeiCloud.Fusion/VideoService/Video.API/Controllers/DaHua/VideoManageController.cs @@ -13,33 +13,33 @@ namespace Video.API.Controllers.DaHua public class VideoManageController : ControllerBase { private readonly ILogger _logger; - private readonly IRootVideoPlaybackService _rootVideoPlaybackService; + private readonly IDahuaGeneralCtlService _dahGeneralCtlService; private readonly IConfiguration _configuration; /// /// 构造 /// /// - /// + /// /// - public VideoManageController(ILogger logger, IRootVideoPlaybackService rootVideoPlaybackService, IConfiguration configuration) + public VideoManageController(ILogger logger, IDahuaGeneralCtlService dahGeneralCtlService, IConfiguration configuration) { _logger = logger; - _rootVideoPlaybackService = rootVideoPlaybackService; + _dahGeneralCtlService = dahGeneralCtlService; _configuration = configuration; } #region 大华视频处理 /// - /// 大华视频回放 + /// 大华hls视频回放 /// /// /// [HttpPost("playback/dh")] - public async Task> StartAndPlaybackDH([FromBody] PlaybackReqDto dto, [FromQuery] string? ipaddress) + public async Task> StartAndPlaybackDH([FromBody] PlaybackReqDto dto, [FromQuery] string? ipaddress) { - return await _rootVideoPlaybackService.GetDaHRecordVideoUrl(dto, ipaddress); + return await _dahGeneralCtlService.RecordVideoUrl(dto, ipaddress); } /// @@ -48,20 +48,20 @@ namespace Video.API.Controllers.DaHua /// /// [HttpPost("rtspplayback/dh")] - public async Task> RtspPlaybackByTime([FromBody] RtspPlayBackReqDto dto, [FromQuery] string? ipaddress) + public async Task> RtspPlaybackByTime([FromBody] RtspPlayBackReqDto dto, [FromQuery] string? ipaddress) { - return await _rootVideoPlaybackService.RtspPlaybackByTime(dto, ipaddress); + return await _dahGeneralCtlService.RtspPlaybackByTime(dto, ipaddress); } /// - /// 大华视频的实时流地址 + /// 大华hls视频的实时流地址 /// /// /// [HttpPost("realtime/dh")] - public async Task> GetRealtimeUrl([FromBody] StreamReqDto dto, [FromQuery] string? ipaddress) + public async Task> GetRealtimeUrl([FromBody] StreamReqDto dto, [FromQuery] string? ipaddress) { - return await _rootVideoPlaybackService.GetRealtimeUrl(dto, ipaddress); + return await _dahGeneralCtlService.RealtimeStreamUrl(dto, ipaddress); } /// @@ -70,9 +70,9 @@ namespace Video.API.Controllers.DaHua /// /// [HttpPost("rtspstart/dh")] - public async Task> RtspStartVideoUrl([FromBody] StreamRtspReqDto dto, [FromQuery] string? ipaddress) + public async Task> RtspStartVideoUrl([FromBody] StreamRtspReqDto dto, [FromQuery] string? ipaddress) { - return await _rootVideoPlaybackService.RtspStartVideoUrl(dto, ipaddress); + return await _dahGeneralCtlService.RtspStartVideoUrl(dto, ipaddress); } /// @@ -81,9 +81,9 @@ namespace Video.API.Controllers.DaHua /// /// [HttpPost("channel/dh")] - public async Task> GetChannelCodes(ChannelPageReqDto dto) + public async Task> GetChannelCodes(ChannelPageReqDto dto) { - return await _rootVideoPlaybackService.GetChannelCodes(dto); + return await _dahGeneralCtlService.GetChannelPageList(dto); } /// @@ -135,9 +135,9 @@ namespace Video.API.Controllers.DaHua /// /// [HttpGet("logout/dh")] - public async Task> Logout(string authorization, string? openId, int? userClient) + public async Task> Logout(string authorization, string? openId, int? userClient) { - return await _rootVideoPlaybackService.Logout(authorization, openId, userClient); + return await _dahGeneralCtlService.Logout(authorization, openId, userClient); } /// @@ -148,7 +148,7 @@ namespace Video.API.Controllers.DaHua [HttpPost("download")] public async Task GetDownUrl(DownloadReqDto dto) { - return await _rootVideoPlaybackService.Download(dto); + return await _dahGeneralCtlService.Download(dto); } #endregion 大华视频处理 diff --git a/WeiCloud.Fusion/VideoService/Video.DomainService/Dahvision/DahuaGeneralCtlService.cs b/WeiCloud.Fusion/VideoService/Video.DomainService/Dahvision/DahuaGeneralCtlService.cs index 15f957c..b60c507 100644 --- a/WeiCloud.Fusion/VideoService/Video.DomainService/Dahvision/DahuaGeneralCtlService.cs +++ b/WeiCloud.Fusion/VideoService/Video.DomainService/Dahvision/DahuaGeneralCtlService.cs @@ -22,7 +22,6 @@ namespace Video.DomainService _tokenProviderService = tokenProviderService; _http = http; - _http = http; } /////