|
|
|
|
@ -2,6 +2,7 @@ |
|
|
|
|
using Common.Shared.DomainService; |
|
|
|
|
using Microsoft.Extensions.Configuration; |
|
|
|
|
using Microsoft.Extensions.Logging; |
|
|
|
|
using MongoDB.Bson; |
|
|
|
|
using System.Net.Http.Headers; |
|
|
|
|
using System.Net.Http.Json; |
|
|
|
|
using System.Text.Json; |
|
|
|
|
@ -98,16 +99,14 @@ namespace Alarm.DomainService.DahAlarm |
|
|
|
|
MonitorType = "url", |
|
|
|
|
Events = new List<EventConfig> |
|
|
|
|
{ |
|
|
|
|
new EventConfig |
|
|
|
|
{ |
|
|
|
|
new() { |
|
|
|
|
Category = "alarm", |
|
|
|
|
SubscribeAll = 1, |
|
|
|
|
DomainSubscribe = 2, |
|
|
|
|
Authorities = new List<Authority> |
|
|
|
|
{ |
|
|
|
|
new Authority |
|
|
|
|
{ |
|
|
|
|
Types = new List<string> { "4321" } |
|
|
|
|
new() { |
|
|
|
|
Types = ["81"] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -189,13 +188,13 @@ namespace Alarm.DomainService.DahAlarm |
|
|
|
|
/// <param name="dto"></param> |
|
|
|
|
/// <returns></returns> |
|
|
|
|
/// <exception cref="NotImplementedException"></exception> |
|
|
|
|
public async Task<DaHApiResult<bool>> HandleAsync(object dto2) |
|
|
|
|
public async Task<DaHApiResult<bool>> HandleAsync(EventEnvelopeDto dto) |
|
|
|
|
{ |
|
|
|
|
DaHApiResult<bool> result = new() { Code = "200", Msg = "接口调用成功", Data = true }; |
|
|
|
|
_logger.LogWarning($"报警回调的数据{dto2}"); |
|
|
|
|
_logger.LogWarning($"报警回调的数据{dto.ToJson()}"); |
|
|
|
|
try |
|
|
|
|
{ |
|
|
|
|
if (dto2 is null) |
|
|
|
|
if (dto is null) |
|
|
|
|
{ |
|
|
|
|
result.Code = "500"; |
|
|
|
|
result.Msg = "请求参数不能为空"; |
|
|
|
|
@ -203,7 +202,7 @@ namespace Alarm.DomainService.DahAlarm |
|
|
|
|
_logger.LogWarning("大华报警事件订阅回调处理失败,参数不能为空"); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
EventEnvelopeDto dto = dto2 as EventEnvelopeDto; |
|
|
|
|
|
|
|
|
|
if (dto.Info is not null) |
|
|
|
|
{ |
|
|
|
|
//这是大华的残卫报警类型 |
|
|
|
|
|