智慧建筑第三方功能集成微服务,目的是聚集所有涉及到第三方厂商调用的功能,按照业务功能划分不同微服务
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
|
using Alarm.Application.ResponeDto;
|
|
|
|
|
|
using Alarm.DomainService.DahAlarm;
|
|
|
|
|
|
using Common.Shared.Application.DaHua;
|
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
using WeiCloud.Core.BaseModels;
|
|
|
|
|
|
|
|
|
|
|
|
namespace AlarmService.API.Controllers
|
|
|
|
|
|
{
|
|
|
|
|
|
[Route("api/[controller]/[action]")]
|
|
|
|
|
|
[ApiController]
|
|
|
|
|
|
public class AlarmController : ControllerBase
|
|
|
|
|
|
{
|
|
|
|
|
|
private readonly ILogger<AlarmController> _logger;
|
|
|
|
|
|
private readonly IDahuaGeneralCtlService _generalCtlService;
|
|
|
|
|
|
|
|
|
|
|
|
public AlarmController(ILogger<AlarmController> logger, IDahuaGeneralCtlService generalCtlService)
|
|
|
|
|
|
{
|
|
|
|
|
|
_logger = logger;
|
|
|
|
|
|
|
|
|
|
|
|
_generalCtlService = generalCtlService;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 订阅报警事件
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
|
public async Task<DaHApiResult<object>> AddSubscribeEvent()
|
|
|
|
|
|
{
|
|
|
|
|
|
return await _generalCtlService.AddSubscribeEvent();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 报警的回调
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="env"></param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost]
|
|
|
|
|
|
public async Task<ApiResult<bool>> DahuaAuthCallback(EventEnvelopeDto env)
|
|
|
|
|
|
{
|
|
|
|
|
|
return await _generalCtlService.HandleAsync(env);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|