using AsbCloudApp.Data; using AsbCloudApp.Services; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; using System.Linq; 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) { service.Incledes.Add("Well"); this.telemetryService = telemetryService; } [HttpGet] [Route("/reduntentUids")] public IActionResult GetRedundentRemoteUids() { var result = telemetryService.GetRedundentRemoteUids().Select(i => new { i.Key, ids = i.Item2 }); return Ok(result); } /// /// merge telemetries /// /// array of ids /// [HttpPost] [Route("/merge")] public IActionResult MergeTelemetries([FromBody] List telemetriesIds) { var count = telemetryService.Merge(telemetriesIds); return Ok(count); } } }