|
|
|
|
@ -71,7 +71,7 @@ namespace Video.DomainService |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var result = JsonSerializer.Deserialize<DaHApiResult<UrlDataDto>>(body); |
|
|
|
|
if (result == null || !result.Success || result.Code != "0") |
|
|
|
|
if (result == null || !result.Success) |
|
|
|
|
{ |
|
|
|
|
_logger.LogWarning("录像请求业务失败: {Body}", body); |
|
|
|
|
return new DaHApiResult<UrlDataDto> { Success = false, Code = "1008", Msg = "录像请求失败" }; |
|
|
|
|
@ -124,7 +124,7 @@ namespace Video.DomainService |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var result = JsonSerializer.Deserialize<DaHApiResult<RecordsResDto>>(body); |
|
|
|
|
if (result == null || !result.Success || result.Code != "0") |
|
|
|
|
if (result == null || !result.Success) |
|
|
|
|
{ |
|
|
|
|
_logger.LogWarning("查询录像信息业务失败: {Body}", body); |
|
|
|
|
return new DaHApiResult<RecordsResDto> { Success = false, Code = "1008", Msg = "查询录像信息失败" }; |
|
|
|
|
@ -177,7 +177,7 @@ namespace Video.DomainService |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var result = JsonSerializer.Deserialize<DaHApiResult<PageInfoDto>>(body); |
|
|
|
|
if (result == null || !result.Success || result.Code != "0") |
|
|
|
|
if (result == null || !result.Success) |
|
|
|
|
{ |
|
|
|
|
_logger.LogWarning("通道分页查询业务失败: {Body}", body); |
|
|
|
|
return new DaHApiResult<PageInfoDto> { Success = false, Code = "1007", Msg = $"通道分页查询失败" }; |
|
|
|
|
@ -232,7 +232,7 @@ namespace Video.DomainService |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var result = JsonSerializer.Deserialize<DaHApiResult<UrlDataDto>>(body); |
|
|
|
|
if (result == null || !result.Success || result.Code != "0") |
|
|
|
|
if (result == null || !result.Success) |
|
|
|
|
{ |
|
|
|
|
_logger.LogWarning("实时流请求业务失败: {Body}", body); |
|
|
|
|
return new DaHApiResult<UrlDataDto> { Success = false, Code = "1010", Msg = "实时流请求失败" }; |
|
|
|
|
@ -300,6 +300,7 @@ namespace Video.DomainService |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// rtsp录像回放 |
|
|
|
|
/// (播放命令:ffplay -rtsp_transport tcp -i "rtsp://demo.weienergy.cn:15211/playback/pu/3?token=3")强制走tcp |
|
|
|
|
/// </summary> |
|
|
|
|
/// <param name="dto"></param> |
|
|
|
|
/// <returns></returns> |
|
|
|
|
@ -337,12 +338,12 @@ namespace Video.DomainService |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var result = JsonSerializer.Deserialize<DaHApiResult<UrlDataDto>>(body); |
|
|
|
|
if (result == null || !result.Success || result.Code != "0") |
|
|
|
|
if (result == null || !result.Success) |
|
|
|
|
{ |
|
|
|
|
_logger.LogWarning("录像请求业务失败: {Body}", body); |
|
|
|
|
return new DaHApiResult<UrlDataDto> { Success = false, Code = "1008", Msg = "录像请求失败" }; |
|
|
|
|
} |
|
|
|
|
result.Data!.Url = result.Data.Url + "?token=" + token; |
|
|
|
|
result.Data!.Url = result.Data.Url.Replace(_configuration["DahuaAuth:TimeRootHost"], _configuration["DahuaAuth:TimeReplaceHost"]) + "?token=" + result.Data.Token; |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
catch (Exception ex) |
|
|
|
|
@ -395,7 +396,7 @@ namespace Video.DomainService |
|
|
|
|
_logger.LogWarning("实时流请求业务失败: {Body}", body); |
|
|
|
|
return new DaHApiResult<UrlDataDto> { Success = false, Code = "1010", Msg = "实时流请求失败" }; |
|
|
|
|
} |
|
|
|
|
result.Data!.Url = result.Data.Url + "?token=" + result.Data!.Token; |
|
|
|
|
result.Data!.Url = result.Data.Url.Replace(_configuration["DahuaAuth:RealRootHost"], _configuration["DahuaAuth:RealReplaceHost"]) + "?token=" + result.Data!.Token; |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
catch (Exception ex) |
|
|
|
|
|