|
|
|
@ -33,7 +33,7 @@ namespace Video.DomainService |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
|
/// 录像回放 |
|
|
|
/// hls等录像回放 |
|
|
|
/// </summary> |
|
|
|
/// </summary> |
|
|
|
/// <param name="dto"></param> |
|
|
|
/// <param name="dto"></param> |
|
|
|
/// <returns></returns> |
|
|
|
/// <returns></returns> |
|
|
|
@ -41,7 +41,7 @@ namespace Video.DomainService |
|
|
|
public async Task<DaHApiResult<UrlDataDto>> RecordVideoUrl(PlaybackReqDto dto) |
|
|
|
public async Task<DaHApiResult<UrlDataDto>> RecordVideoUrl(PlaybackReqDto dto) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// 1) 参数校验 + 早退 |
|
|
|
// 1) 参数校验 + 早退 |
|
|
|
if (dto == null || string.IsNullOrWhiteSpace(dto.ChannelId)) |
|
|
|
if (dto == null || string.IsNullOrWhiteSpace(dto.Data.ChannelId)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
_logger.LogWarning("录像请求失败:通道ID不能为空"); |
|
|
|
_logger.LogWarning("录像请求失败:通道ID不能为空"); |
|
|
|
return new DaHApiResult<UrlDataDto> { Success = false, Code = "1007", Msg = "通道ID不能为空" }; |
|
|
|
return new DaHApiResult<UrlDataDto> { Success = false, Code = "1007", Msg = "通道ID不能为空" }; |
|
|
|
@ -77,7 +77,7 @@ namespace Video.DomainService |
|
|
|
_logger.LogWarning("录像请求业务失败: {Body}", body); |
|
|
|
_logger.LogWarning("录像请求业务失败: {Body}", body); |
|
|
|
return new DaHApiResult<UrlDataDto> { Success = false, Code = "1008", Msg = "录像请求失败" }; |
|
|
|
return new DaHApiResult<UrlDataDto> { Success = false, Code = "1008", Msg = "录像请求失败" }; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
result.Data!.Url = result.Data.Url + "?token=" + token; |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
catch (Exception ex) |
|
|
|
@ -238,7 +238,7 @@ namespace Video.DomainService |
|
|
|
_logger.LogWarning("实时流请求业务失败: {Body}", body); |
|
|
|
_logger.LogWarning("实时流请求业务失败: {Body}", body); |
|
|
|
return new DaHApiResult<UrlDataDto> { Success = false, Code = "1010", Msg = "实时流请求失败" }; |
|
|
|
return new DaHApiResult<UrlDataDto> { Success = false, Code = "1010", Msg = "实时流请求失败" }; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
result.Data!.Url = result.Data.Url + "?token=" + token; |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
catch (Exception ex) |
|
|
|
@ -305,10 +305,10 @@ 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<UrlDataDto>> RtspPlaybackByTime(RtspPlaybackReqDto dto) |
|
|
|
public async Task<DaHApiResult<UrlDataDto>> RtspPlaybackByTime(RtspPlayBackReqDto dto) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// 参数校验 + 早退 |
|
|
|
// 参数校验 + 早退 |
|
|
|
if (dto == null || string.IsNullOrWhiteSpace(dto.ChannelId)) |
|
|
|
if (dto == null || string.IsNullOrWhiteSpace(dto.Data.ChannelId)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
_logger.LogWarning("录像请求失败:通道ID不能为空"); |
|
|
|
_logger.LogWarning("录像请求失败:通道ID不能为空"); |
|
|
|
return new DaHApiResult<UrlDataDto> { Success = false, Code = "1007", Msg = "通道ID不能为空" }; |
|
|
|
return new DaHApiResult<UrlDataDto> { Success = false, Code = "1007", Msg = "通道ID不能为空" }; |
|
|
|
@ -343,7 +343,7 @@ namespace Video.DomainService |
|
|
|
_logger.LogWarning("录像请求业务失败: {Body}", body); |
|
|
|
_logger.LogWarning("录像请求业务失败: {Body}", body); |
|
|
|
return new DaHApiResult<UrlDataDto> { Success = false, Code = "1008", Msg = "录像请求失败" }; |
|
|
|
return new DaHApiResult<UrlDataDto> { Success = false, Code = "1008", Msg = "录像请求失败" }; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
result.Data!.Url = result.Data.Url + "?token=" + token; |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
catch (Exception ex) |
|
|
|
@ -390,12 +390,12 @@ namespace Video.DomainService |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var result = JsonSerializer.Deserialize<DaHApiResult<UrlDataDto>>(body); |
|
|
|
var result = JsonSerializer.Deserialize<DaHApiResult<UrlDataDto>>(body); |
|
|
|
if (result == null || !result.Success || result.Code != "100") |
|
|
|
if (result == null || !result.Success) |
|
|
|
{ |
|
|
|
{ |
|
|
|
_logger.LogWarning("实时流请求业务失败: {Body}", body); |
|
|
|
_logger.LogWarning("实时流请求业务失败: {Body}", body); |
|
|
|
return new DaHApiResult<UrlDataDto> { Success = false, Code = "1010", Msg = "实时流请求失败" }; |
|
|
|
return new DaHApiResult<UrlDataDto> { Success = false, Code = "1010", Msg = "实时流请求失败" }; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
result.Data!.Url = result.Data.Url + "?token=" + result.Data!.Token; |
|
|
|
return result; |
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
catch (Exception ex) |
|
|
|
|