123456789101112131415161718192021222324252627 |
- using CallCenter.Devices;
- using Microsoft.AspNetCore.Authorization;
- using Microsoft.AspNetCore.Mvc;
- using Microsoft.Extensions.Options;
- namespace CallCenter.Api.Controllers;
- [ApiController]
- [Route("api/report")]
- public class ReportController : ControllerBase
- {
- private readonly IOptionsSnapshot<DeviceConfigs> _options;
- private readonly IDeviceEventHandler _deviceEventHandler;
- public ReportController(IOptionsSnapshot<DeviceConfigs> options, IDeviceEventHandler deviceEventHandler)
- {
- _options = options;
- _deviceEventHandler = deviceEventHandler;
- }
- [AllowAnonymous]
- [HttpGet]
- public async Task ReceiveEvents()
- {
- await _deviceEventHandler.HandleAsync(Request.Body, _options.Value, HttpContext.RequestAborted);
- }
- }
|