|
|
|
@ -13,33 +13,33 @@ namespace Video.API.Controllers.DaHua |
|
|
|
public class VideoManageController : ControllerBase |
|
|
|
public class VideoManageController : ControllerBase |
|
|
|
{ |
|
|
|
{ |
|
|
|
private readonly ILogger<VideoManageController> _logger; |
|
|
|
private readonly ILogger<VideoManageController> _logger; |
|
|
|
private readonly IRootVideoPlaybackService _rootVideoPlaybackService; |
|
|
|
private readonly IDahuaGeneralCtlService _dahGeneralCtlService; |
|
|
|
private readonly IConfiguration _configuration; |
|
|
|
private readonly IConfiguration _configuration; |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
|
/// 构造 |
|
|
|
/// 构造 |
|
|
|
/// </summary> |
|
|
|
/// </summary> |
|
|
|
/// <param name="logger"></param> |
|
|
|
/// <param name="logger"></param> |
|
|
|
/// <param name="rootVideoPlaybackService"></param> |
|
|
|
/// <param name="dahGeneralCtlService"></param> |
|
|
|
/// <param name="configuration"></param> |
|
|
|
/// <param name="configuration"></param> |
|
|
|
public VideoManageController(ILogger<VideoManageController> logger, IRootVideoPlaybackService rootVideoPlaybackService, IConfiguration configuration) |
|
|
|
public VideoManageController(ILogger<VideoManageController> logger, IDahuaGeneralCtlService dahGeneralCtlService, IConfiguration configuration) |
|
|
|
{ |
|
|
|
{ |
|
|
|
_logger = logger; |
|
|
|
_logger = logger; |
|
|
|
_rootVideoPlaybackService = rootVideoPlaybackService; |
|
|
|
_dahGeneralCtlService = dahGeneralCtlService; |
|
|
|
_configuration = configuration; |
|
|
|
_configuration = configuration; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#region 大华视频处理 |
|
|
|
#region 大华视频处理 |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
|
/// 大华视频回放 |
|
|
|
/// 大华hls视频回放 |
|
|
|
/// </summary> |
|
|
|
/// </summary> |
|
|
|
/// <param name="dto"></param> |
|
|
|
/// <param name="dto"></param> |
|
|
|
/// <returns></returns> |
|
|
|
/// <returns></returns> |
|
|
|
[HttpPost("playback/dh")] |
|
|
|
[HttpPost("playback/dh")] |
|
|
|
public async Task<ApiResult<UrlDataDto>> StartAndPlaybackDH([FromBody] PlaybackReqDto dto, [FromQuery] string? ipaddress) |
|
|
|
public async Task<DaHApiResult<UrlDataDto>> StartAndPlaybackDH([FromBody] PlaybackReqDto dto, [FromQuery] string? ipaddress) |
|
|
|
{ |
|
|
|
{ |
|
|
|
return await _rootVideoPlaybackService.GetDaHRecordVideoUrl(dto, ipaddress); |
|
|
|
return await _dahGeneralCtlService.RecordVideoUrl(dto, ipaddress); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
|
@ -48,20 +48,20 @@ namespace Video.API.Controllers.DaHua |
|
|
|
/// <param name="dto"></param> |
|
|
|
/// <param name="dto"></param> |
|
|
|
/// <returns></returns> |
|
|
|
/// <returns></returns> |
|
|
|
[HttpPost("rtspplayback/dh")] |
|
|
|
[HttpPost("rtspplayback/dh")] |
|
|
|
public async Task<ApiResult<UrlDataDto>> RtspPlaybackByTime([FromBody] RtspPlayBackReqDto dto, [FromQuery] string? ipaddress) |
|
|
|
public async Task<DaHApiResult<UrlDataDto>> RtspPlaybackByTime([FromBody] RtspPlayBackReqDto dto, [FromQuery] string? ipaddress) |
|
|
|
{ |
|
|
|
{ |
|
|
|
return await _rootVideoPlaybackService.RtspPlaybackByTime(dto, ipaddress); |
|
|
|
return await _dahGeneralCtlService.RtspPlaybackByTime(dto, ipaddress); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
|
/// 大华视频的实时流地址 |
|
|
|
/// 大华hls视频的实时流地址 |
|
|
|
/// </summary> |
|
|
|
/// </summary> |
|
|
|
/// <param name="dto"></param> |
|
|
|
/// <param name="dto"></param> |
|
|
|
/// <returns></returns> |
|
|
|
/// <returns></returns> |
|
|
|
[HttpPost("realtime/dh")] |
|
|
|
[HttpPost("realtime/dh")] |
|
|
|
public async Task<ApiResult<UrlDataDto>> GetRealtimeUrl([FromBody] StreamReqDto dto, [FromQuery] string? ipaddress) |
|
|
|
public async Task<DaHApiResult<UrlDataDto>> GetRealtimeUrl([FromBody] StreamReqDto dto, [FromQuery] string? ipaddress) |
|
|
|
{ |
|
|
|
{ |
|
|
|
return await _rootVideoPlaybackService.GetRealtimeUrl(dto, ipaddress); |
|
|
|
return await _dahGeneralCtlService.RealtimeStreamUrl(dto, ipaddress); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
|
@ -70,9 +70,9 @@ namespace Video.API.Controllers.DaHua |
|
|
|
/// <param name="dto"></param> |
|
|
|
/// <param name="dto"></param> |
|
|
|
/// <returns></returns> |
|
|
|
/// <returns></returns> |
|
|
|
[HttpPost("rtspstart/dh")] |
|
|
|
[HttpPost("rtspstart/dh")] |
|
|
|
public async Task<ApiResult<UrlDataDto>> RtspStartVideoUrl([FromBody] StreamRtspReqDto dto, [FromQuery] string? ipaddress) |
|
|
|
public async Task<DaHApiResult<UrlDataDto>> RtspStartVideoUrl([FromBody] StreamRtspReqDto dto, [FromQuery] string? ipaddress) |
|
|
|
{ |
|
|
|
{ |
|
|
|
return await _rootVideoPlaybackService.RtspStartVideoUrl(dto, ipaddress); |
|
|
|
return await _dahGeneralCtlService.RtspStartVideoUrl(dto, ipaddress); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
|
@ -81,9 +81,9 @@ namespace Video.API.Controllers.DaHua |
|
|
|
/// <param name="dto"></param> |
|
|
|
/// <param name="dto"></param> |
|
|
|
/// <returns></returns> |
|
|
|
/// <returns></returns> |
|
|
|
[HttpPost("channel/dh")] |
|
|
|
[HttpPost("channel/dh")] |
|
|
|
public async Task<ApiResult<PageInfoDto>> GetChannelCodes(ChannelPageReqDto dto) |
|
|
|
public async Task<DaHApiResult<PageInfoDto>> GetChannelCodes(ChannelPageReqDto dto) |
|
|
|
{ |
|
|
|
{ |
|
|
|
return await _rootVideoPlaybackService.GetChannelCodes(dto); |
|
|
|
return await _dahGeneralCtlService.GetChannelPageList(dto); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
|
@ -135,9 +135,9 @@ namespace Video.API.Controllers.DaHua |
|
|
|
/// <param name="userClient"></param> |
|
|
|
/// <param name="userClient"></param> |
|
|
|
/// <returns></returns> |
|
|
|
/// <returns></returns> |
|
|
|
[HttpGet("logout/dh")] |
|
|
|
[HttpGet("logout/dh")] |
|
|
|
public async Task<ApiResult<object>> Logout(string authorization, string? openId, int? userClient) |
|
|
|
public async Task<DaHApiResult<object>> Logout(string authorization, string? openId, int? userClient) |
|
|
|
{ |
|
|
|
{ |
|
|
|
return await _rootVideoPlaybackService.Logout(authorization, openId, userClient); |
|
|
|
return await _dahGeneralCtlService.Logout(authorization, openId, userClient); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
|
@ -148,7 +148,7 @@ namespace Video.API.Controllers.DaHua |
|
|
|
[HttpPost("download")] |
|
|
|
[HttpPost("download")] |
|
|
|
public async Task<string> GetDownUrl(DownloadReqDto dto) |
|
|
|
public async Task<string> GetDownUrl(DownloadReqDto dto) |
|
|
|
{ |
|
|
|
{ |
|
|
|
return await _rootVideoPlaybackService.Download(dto); |
|
|
|
return await _dahGeneralCtlService.Download(dto); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#endregion 大华视频处理 |
|
|
|
#endregion 大华视频处理 |
|
|
|
|