From 0bfec5dcb1a6b6df71202b6ac8af8eb8e10e2afd Mon Sep 17 00:00:00 2001 From: KharchenkoVV Date: Fri, 14 May 2021 10:58:23 +0500 Subject: [PATCH] =?UTF-8?q?CS2-6:=20=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=20=D0=B8=D0=BC=D1=8F=20=D0=BC=D0=B5=D1=82=D0=BE?= =?UTF-8?q?=D0=B4=D0=B0=20=D0=BF=D0=BE=D0=BB=D1=83=D1=87=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20uids=20=D0=BF=D0=B5=D1=80=D0=B5=D0=B4=D0=B5=D1=8E?= =?UTF-8?q?=D1=89=D0=B8=D1=85=20=D1=81=D0=BA=D0=B2=D0=B0=D0=B6=D0=B8=D0=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AsbCloudApp/Services/ITelemetryTracker.cs | 2 +- AsbCloudInfrastructure/Services/TelemetryTracker.cs | 2 +- AsbCloudInfrastructure/Services/WellService.cs | 2 +- AsbCloudWebApi/Controllers/TelemetryController.cs | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/AsbCloudApp/Services/ITelemetryTracker.cs b/AsbCloudApp/Services/ITelemetryTracker.cs index 878f88dd..36f21b8b 100644 --- a/AsbCloudApp/Services/ITelemetryTracker.cs +++ b/AsbCloudApp/Services/ITelemetryTracker.cs @@ -5,6 +5,6 @@ namespace AsbCloudApp.Services public interface ITelemetryTracker { void SaveRequestDate(string uid); - IEnumerable GetRequestUids(); + IEnumerable GetTransmittingTelemetryUids(); } } diff --git a/AsbCloudInfrastructure/Services/TelemetryTracker.cs b/AsbCloudInfrastructure/Services/TelemetryTracker.cs index a2b5d08b..21472af1 100644 --- a/AsbCloudInfrastructure/Services/TelemetryTracker.cs +++ b/AsbCloudInfrastructure/Services/TelemetryTracker.cs @@ -21,7 +21,7 @@ namespace AsbCloudInfrastructure.Services DeleteOldRequestDates(); } - public IEnumerable GetRequestUids() + public IEnumerable GetTransmittingTelemetryUids() { DeleteOldRequestDates(); return requests.Keys; diff --git a/AsbCloudInfrastructure/Services/WellService.cs b/AsbCloudInfrastructure/Services/WellService.cs index 2557d23f..83df1397 100644 --- a/AsbCloudInfrastructure/Services/WellService.cs +++ b/AsbCloudInfrastructure/Services/WellService.cs @@ -21,7 +21,7 @@ namespace AsbCloudInfrastructure.Services public IEnumerable GetTransmittingWells(int idCustomer) { var wells = new List(); - IEnumerable activeTelemetriesUids = telemetryTracker.GetRequests(); + IEnumerable activeTelemetriesUids = telemetryTracker.GetTransmittingTelemetryUids(); if (activeTelemetriesUids.Count() > 0) { wells = db.GetWellsByCustomer(idCustomer) diff --git a/AsbCloudWebApi/Controllers/TelemetryController.cs b/AsbCloudWebApi/Controllers/TelemetryController.cs index b4e26367..128d7751 100644 --- a/AsbCloudWebApi/Controllers/TelemetryController.cs +++ b/AsbCloudWebApi/Controllers/TelemetryController.cs @@ -53,7 +53,7 @@ namespace AsbCloudWebApi.Controllers public IActionResult PostInfo(string uid, [FromBody] TelemetryInfoDto info) { telemetryService.UpdateInfo(uid, info); - telemetryTracker.SaveRequest(uid); + telemetryTracker.SaveRequestDate(uid); return Ok(); } @@ -73,7 +73,7 @@ namespace AsbCloudWebApi.Controllers if (wellId != null && dtos.Any()) Task.Run(() => telemetryHubContext.Clients.Group($"well_{wellId}").SendAsync(nameof(ITelemetryHubClient.ReceiveDataSaub), dtos)); - telemetryTracker.SaveRequest(uid); + telemetryTracker.SaveRequestDate(uid); return Ok(); } @@ -93,7 +93,7 @@ namespace AsbCloudWebApi.Controllers if (dtos.Any()) Task.Run(() => telemetryHubContext.Clients.Group($"well_{wellId}").SendAsync(nameof(ITelemetryHubClient.ReceiveMessages), dtos)); - telemetryTracker.SaveRequest(uid); + telemetryTracker.SaveRequestDate(uid); return Ok(); } @@ -108,7 +108,7 @@ namespace AsbCloudWebApi.Controllers public IActionResult PostEvents(string uid, [FromBody] List events) { eventService.Upsert(uid, events); - telemetryTracker.SaveRequest(uid); + telemetryTracker.SaveRequestDate(uid); return Ok(); } @@ -123,7 +123,7 @@ namespace AsbCloudWebApi.Controllers public IActionResult PostUsers(string uid, [FromBody] List users) { telemetryUserService.Upsert(uid, users); - telemetryTracker.SaveRequest(uid); + telemetryTracker.SaveRequestDate(uid); return Ok(); }