using AsbCloudApp.Data; using AsbCloudApp.Services; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System.Threading; using System.Threading.Tasks; namespace AsbCloudWebApi.Controllers { [Route("api/admin/telemetry")] [ApiController] [Authorize] public class AdminTelemetryController : CrudController> { private readonly ITelemetryService telemetryService; public AdminTelemetryController(ICrudService service, ITelemetryService telemetryService) : base(service) { this.telemetryService = telemetryService; } /// /// Merge telemetries. No body required. /// /// [HttpPost] [Route("/merge/{idFrom}/{idTo}")] [Permission] public async Task MergeTelemetriesAsync(int idFrom, int idTo, CancellationToken token = default) { var count = await telemetryService.MergeAsync(idFrom, idTo, token) .ConfigureAwait(false); return Ok(count); } } }