dev_lx #32

Merged
LiuXin merged 3 commits from dev_lx into main 3 months ago
  1. 2
      WeiCloud.Fusion/Common.SharedService/Common.Shared.Application/Common.Shared.Application.csproj
  2. 2
      WeiCloud.Fusion/Common.SharedService/Common.Shared.Application/DaHua/RequestDto/DahuaVideoQueryDto.cs
  3. 2
      WeiCloud.Fusion/Common.SharedService/Common.Shared.Application/SafetyFirePro/RequestDto/SunPlaceBoardWorkOrderReqDto.cs
  4. 3
      WeiCloud.Fusion/Common.SharedService/Common.Shared.Application/SafetyFirePro/ResponseDto/SunPlaceBoardWorkOrderResDto.cs
  5. 2
      WeiCloud.Fusion/ThirdPartyServices/ThirdPartyServices.Application/ShenZhouShengAn/RequestDto/ThirdPartyProviderQueryDto.cs
  6. 2
      WeiCloud.Fusion/ThirdPartyServices/ThirdPartyServices.DomainService/ShenZhouShengAn/SunPalaceBoardSafetyService.cs
  7. 23
      WeiCloud.Fusion/VideoService/Video.API/Controllers/DaHua/VideoManageController.cs
  8. 12
      WeiCloud.Fusion/VideoService/Video.DomainService/Dahvision/DahuaGeneralCtlService.cs
  9. 2
      WeiCloud.Fusion/VideoService/Video.DomainService/Dahvision/IDahuaGeneralCtlService.cs

@ -7,7 +7,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<PackageId>Common.Shared.Application</PackageId> <PackageId>Common.Shared.Application</PackageId>
<Version>3.0.0</Version> <Version>3.2.0</Version>
<Authors>zrh-lx</Authors> <Authors>zrh-lx</Authors>
<Company>zrh-lx</Company> <!-- 可选 --> <Company>zrh-lx</Company> <!-- 可选 -->
<Description>包含所有公共使用的 DTO、契约、接口模型等,供微服务之间共享使用</Description> <Description>包含所有公共使用的 DTO、契约、接口模型等,供微服务之间共享使用</Description>

@ -289,7 +289,7 @@ namespace Common.Shared.Application.DaHua
/// 码流类型:1-主码流,2-子码流 /// 码流类型:1-主码流,2-子码流
/// </summary> /// </summary>
[JsonPropertyName("streamType")] [JsonPropertyName("streamType")]
public string StreamType { get; set; } = "2"; public string StreamType { get; set; } = "1";
/// <summary> /// <summary>
/// rtsp专用,有datatype没有type,有type没有datatype /// rtsp专用,有datatype没有type,有type没有datatype

@ -86,7 +86,7 @@ namespace Common.Shared.Application.SafetyFirePro.RequestDto
/// <example>10</example> /// <example>10</example>
/// <remarks>不传则默认为10</remarks> /// <remarks>不传则默认为10</remarks>
[JsonPropertyName("page_size")] [JsonPropertyName("page_size")]
public int? PageSize { get; set; } = 20; public int? Page_size { get; set; } = 20;
/// <summary> /// <summary>
/// 作业状态 /// 作业状态

@ -526,6 +526,9 @@ namespace Common.Shared.Application.SafetyFirePro.ResponseDto
[JsonPropertyName("status")] [JsonPropertyName("status")]
public int Status { get; set; } public int Status { get; set; }
[JsonPropertyName("sort")]
public int? Sort { get; set; }
/// <summary> /// <summary>
/// 审批人信息 /// 审批人信息
/// </summary> /// </summary>

@ -68,6 +68,8 @@ namespace ThirdPartyServices.Application.ShenZhouShengAn.RequestDto
public long? P_region_id { get; set; } public long? P_region_id { get; set; }
public long? Region_id { get; set; } public long? Region_id { get; set; }
public int? Page_size { get; set; }
} }
/// <summary> /// <summary>

@ -548,7 +548,7 @@ namespace ThirdPartyServices.DomainService.ShenZhouShengAn
{ {
dto.Status = statusNot[i].ToString(); dto.Status = statusNot[i].ToString();
dto.Page = 1; dto.Page = 1;
dto.PageSize = 1; dto.Page_size = 1;
HttpClientResult<object> riskResult = await _tokenProviderService HttpClientResult<object> riskResult = await _tokenProviderService
.SendAndParseAsync<WorkTaskQueryParamsDto, HttpClientResult<object>>( .SendAndParseAsync<WorkTaskQueryParamsDto, HttpClientResult<object>>(
"https://zrh.szdunan.cn/v1/api/ticket/safe/ledger", "https://zrh.szdunan.cn/v1/api/ticket/safe/ledger",

@ -1,7 +1,13 @@
using Common.Shared.Application.DaHua; using Common.Shared.Application.DaHua;
using Common.Shared.DomainService; using Common.Shared.DomainService;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.OpenApi.Models;
using Org.BouncyCastle.Ocsp;
using System.Text;
using System.Text.Json;
using Video.DomainService; using Video.DomainService;
using Video.DomainService.Dahvision;
using static QRCoder.PayloadGenerator.ShadowSocksConfig;
namespace Video.API.Controllers.DaHua namespace Video.API.Controllers.DaHua
{ {
@ -44,6 +50,12 @@ namespace Video.API.Controllers.DaHua
return await _dahGeneralCtlService.RecordVideoUrl(dto, ipaddress); return await _dahGeneralCtlService.RecordVideoUrl(dto, ipaddress);
} }
// 全局设置(只在测试环境使用!)
private static readonly HttpClient _http = new HttpClient(new HttpClientHandler
{
ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator
});
/// <summary> /// <summary>
/// 大华的录像回放地址(rtsp) /// 大华的录像回放地址(rtsp)
/// </summary> /// </summary>
@ -55,6 +67,17 @@ namespace Video.API.Controllers.DaHua
return await _dahGeneralCtlService.RtspPlaybackByTime(dto, ipaddress); return await _dahGeneralCtlService.RtspPlaybackByTime(dto, ipaddress);
} }
/// <summary>
/// 大华的录像信息列表
/// </summary>
/// <param name="dto"></param>
/// <returns></returns>
[HttpPost]
public async Task<DaHApiResult<RecordsResDto>> QueryRecords([FromBody] RtspPlayBackReqDto dto)
{
return await _dahGeneralCtlService.QueryRecords(dto);
}
/// <summary> /// <summary>
/// 大华hls视频的实时流地址 /// 大华hls视频的实时流地址
/// </summary> /// </summary>

@ -4,6 +4,7 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using NPOI.XWPF.UserModel; using NPOI.XWPF.UserModel;
using System.Net.Http.Json; using System.Net.Http.Json;
using System.Text;
using System.Text.Json; using System.Text.Json;
using Video.DomainService.Dahvision; using Video.DomainService.Dahvision;
@ -106,7 +107,7 @@ namespace Video.DomainService
/// <param name="dto"></param> /// <param name="dto"></param>
/// <returns></returns> /// <returns></returns>
/// <exception cref="NotImplementedException"></exception> /// <exception cref="NotImplementedException"></exception>
public async Task<DaHApiResult<RecordsResDto>> QueryRecords(PlaybackReqDto dto) public async Task<DaHApiResult<RecordsResDto>> QueryRecords(RtspPlayBackReqDto dto)
{ {
// 0) 参数校验 + 早退(按需增加更多必填校验) // 0) 参数校验 + 早退(按需增加更多必填校验)
if (dto == null) if (dto == null)
@ -126,7 +127,7 @@ namespace Video.DomainService
using var req = new HttpRequestMessage(HttpMethod.Post, url) using var req = new HttpRequestMessage(HttpMethod.Post, url)
{ {
Content = JsonContent.Create(dto.Data) // 关键:把 dto 放进请求体 Content = JsonContent.Create(dto) // 关键:把 dto 放进请求体
}; };
req.Headers.TryAddWithoutValidation("Authorization", token); req.Headers.TryAddWithoutValidation("Authorization", token);
@ -352,7 +353,7 @@ namespace Video.DomainService
return new DaHApiResult<UrlDataDto> { Success = false, Code = "1007", Msg = "通道ID不能为空" }; return new DaHApiResult<UrlDataDto> { Success = false, Code = "1007", Msg = "通道ID不能为空" };
} }
// 先用缓存里的 token,不足5分钟过期再刷新(按你之前的口径来) // 先用缓存里的 token,不足5分钟过期再刷新
var clientId = _configuration["DahuaAuth:ClientId"]; var clientId = _configuration["DahuaAuth:ClientId"];
var token = await _tokenProviderService.GetTokenAsync(clientId!); var token = await _tokenProviderService.GetTokenAsync(clientId!);
if (!_tokenProviderService.IsTokenValid(token)) if (!_tokenProviderService.IsTokenValid(token))
@ -360,7 +361,7 @@ namespace Video.DomainService
_logger.LogWarning("rtsp录像回放:token无效"); _logger.LogWarning("rtsp录像回放:token无效");
return new DaHApiResult<UrlDataDto> { Success = false, Code = "1009", Msg = "token无效" }; return new DaHApiResult<UrlDataDto> { Success = false, Code = "1009", Msg = "token无效" };
} }
dto.Data.StreamType = "2";
var url = $"https://{_configuration["DahuaAuth:Host"]}/evo-apigw/admin/API/SS/Playback/StartPlaybackByTime"; var url = $"https://{_configuration["DahuaAuth:Host"]}/evo-apigw/admin/API/SS/Playback/StartPlaybackByTime";
if (ipaddress != null) if (ipaddress != null)
{ {
@ -396,6 +397,7 @@ namespace Video.DomainService
_configuration, _configuration,
"Time" "Time"
) + "?token=" + result.Data.Token; ) + "?token=" + result.Data.Token;
return result; return result;
} }
catch (Exception ex) catch (Exception ex)
@ -428,7 +430,7 @@ namespace Video.DomainService
_logger.LogWarning("rtsp实时预览接口方式:token无效"); _logger.LogWarning("rtsp实时预览接口方式:token无效");
return new DaHApiResult<UrlDataDto> { Success = false, Code = "1009", Msg = "token无效" }; return new DaHApiResult<UrlDataDto> { Success = false, Code = "1009", Msg = "token无效" };
} }
dto.Data.StreamType = "2";
var url = $"https://{_configuration["DahuaAuth:Host"]}/evo-apigw/admin/API/MTS/Video/StartVideo"; var url = $"https://{_configuration["DahuaAuth:Host"]}/evo-apigw/admin/API/MTS/Video/StartVideo";
if (ipaddress != null) if (ipaddress != null)
{ {

@ -12,7 +12,7 @@ namespace Video.DomainService
/// </summary> /// </summary>
/// <param name="dto"></param> /// <param name="dto"></param>
/// <returns></returns> /// <returns></returns>
Task<DaHApiResult<RecordsResDto>> QueryRecords(PlaybackReqDto dto); Task<DaHApiResult<RecordsResDto>> QueryRecords(RtspPlayBackReqDto dto);
/// <summary> /// <summary>
/// HLS、RTMP录像回放(FLV不支持) /// HLS、RTMP录像回放(FLV不支持)

Loading…
Cancel
Save