|
|
|
@ -544,7 +544,7 @@ namespace Video.DomainService |
|
|
|
/// <param name="deviceCode"></param> |
|
|
|
/// <param name="deviceCode"></param> |
|
|
|
/// <returns></returns> |
|
|
|
/// <returns></returns> |
|
|
|
/// <exception cref="NotImplementedException"></exception> |
|
|
|
/// <exception cref="NotImplementedException"></exception> |
|
|
|
public async Task<DaHApiResult<SnapshotResDto>> InvokeSnapshot(string deviceCode, long id) |
|
|
|
public async Task<DaHApiResult<SnapshotResDto>> InvokeSnapshot(string deviceCode, long id, int channelId) |
|
|
|
{ |
|
|
|
{ |
|
|
|
DaHApiResult<SnapshotResDto> apiResult = new DaHApiResult<SnapshotResDto>() { Code = "200", Msg = "接口调用成功", Data = new SnapshotResDto() }; |
|
|
|
DaHApiResult<SnapshotResDto> apiResult = new DaHApiResult<SnapshotResDto>() { Code = "200", Msg = "接口调用成功", Data = new SnapshotResDto() }; |
|
|
|
var clientId = _configuration["DahuaAuth:ClientId"]; |
|
|
|
var clientId = _configuration["DahuaAuth:ClientId"]; |
|
|
|
@ -557,7 +557,7 @@ namespace Video.DomainService |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var url = $"https://{_configuration["DahuaAuth:Host"]}/evo-apigw/admin/API/EVO/invoke/DMS"; |
|
|
|
var url = $"https://{_configuration["DahuaAuth:Host"]}/evo-apigw/admin/API/EVO/invoke/DMS"; |
|
|
|
DeviceOperationReqDto dto = new DeviceOperationReqDto(deviceCode, id); |
|
|
|
DeviceOperationReqDto dto = new DeviceOperationReqDto(deviceCode, id, channelId); |
|
|
|
|
|
|
|
|
|
|
|
using var req = new HttpRequestMessage(HttpMethod.Post, url) |
|
|
|
using var req = new HttpRequestMessage(HttpMethod.Post, url) |
|
|
|
{ |
|
|
|
{ |
|
|
|
@ -577,6 +577,11 @@ namespace Video.DomainService |
|
|
|
return new DaHApiResult<SnapshotResDto> { Success = false, Code = "1014", Msg = $"抓拍错误 {(int)resp.StatusCode}" }; |
|
|
|
return new DaHApiResult<SnapshotResDto> { Success = false, Code = "1014", Msg = $"抓拍错误 {(int)resp.StatusCode}" }; |
|
|
|
} |
|
|
|
} |
|
|
|
var outer = JsonSerializer.Deserialize<DaHApiResult<string>>(body); |
|
|
|
var outer = JsonSerializer.Deserialize<DaHApiResult<string>>(body); |
|
|
|
|
|
|
|
if (outer == null || !outer.Success) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
_logger.LogWarning("抓拍请求业务失败: {Body}", body); |
|
|
|
|
|
|
|
return new DaHApiResult<SnapshotResDto> { Success = false, Code = "1013", Msg = "抓拍请求失败" }; |
|
|
|
|
|
|
|
} |
|
|
|
var result = JsonSerializer.Deserialize<SnapResponseVO>(outer.Data); |
|
|
|
var result = JsonSerializer.Deserialize<SnapResponseVO>(outer.Data); |
|
|
|
if (result == null) |
|
|
|
if (result == null) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|