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 _options; private readonly IDeviceEventHandler _deviceEventHandler; public ReportController(IOptionsSnapshot options, IDeviceEventHandler deviceEventHandler) { _options = options; _deviceEventHandler = deviceEventHandler; } [AllowAnonymous] [HttpGet] public async Task ReceiveEvents() { await _deviceEventHandler.HandleAsync(Request.Body, _options.Value, HttpContext.RequestAborted); } }