forked from ddrilling/AsbCloudServer
CS2-6: Изменено имя метода получения uids передеющих скважин
This commit is contained in:
parent
026fbea529
commit
0bfec5dcb1
@ -5,6 +5,6 @@ namespace AsbCloudApp.Services
|
|||||||
public interface ITelemetryTracker
|
public interface ITelemetryTracker
|
||||||
{
|
{
|
||||||
void SaveRequestDate(string uid);
|
void SaveRequestDate(string uid);
|
||||||
IEnumerable<string> GetRequestUids();
|
IEnumerable<string> GetTransmittingTelemetryUids();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ namespace AsbCloudInfrastructure.Services
|
|||||||
DeleteOldRequestDates();
|
DeleteOldRequestDates();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<string> GetRequestUids()
|
public IEnumerable<string> GetTransmittingTelemetryUids()
|
||||||
{
|
{
|
||||||
DeleteOldRequestDates();
|
DeleteOldRequestDates();
|
||||||
return requests.Keys;
|
return requests.Keys;
|
||||||
|
@ -21,7 +21,7 @@ namespace AsbCloudInfrastructure.Services
|
|||||||
public IEnumerable<WellDto> GetTransmittingWells(int idCustomer)
|
public IEnumerable<WellDto> GetTransmittingWells(int idCustomer)
|
||||||
{
|
{
|
||||||
var wells = new List<Well>();
|
var wells = new List<Well>();
|
||||||
IEnumerable<string> activeTelemetriesUids = telemetryTracker.GetRequests();
|
IEnumerable<string> activeTelemetriesUids = telemetryTracker.GetTransmittingTelemetryUids();
|
||||||
if (activeTelemetriesUids.Count() > 0)
|
if (activeTelemetriesUids.Count() > 0)
|
||||||
{
|
{
|
||||||
wells = db.GetWellsByCustomer(idCustomer)
|
wells = db.GetWellsByCustomer(idCustomer)
|
||||||
|
@ -53,7 +53,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
public IActionResult PostInfo(string uid, [FromBody] TelemetryInfoDto info)
|
public IActionResult PostInfo(string uid, [FromBody] TelemetryInfoDto info)
|
||||||
{
|
{
|
||||||
telemetryService.UpdateInfo(uid, info);
|
telemetryService.UpdateInfo(uid, info);
|
||||||
telemetryTracker.SaveRequest(uid);
|
telemetryTracker.SaveRequestDate(uid);
|
||||||
return Ok();
|
return Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
if (wellId != null && dtos.Any())
|
if (wellId != null && dtos.Any())
|
||||||
Task.Run(() => telemetryHubContext.Clients.Group($"well_{wellId}").SendAsync(nameof(ITelemetryHubClient.ReceiveDataSaub), dtos));
|
Task.Run(() => telemetryHubContext.Clients.Group($"well_{wellId}").SendAsync(nameof(ITelemetryHubClient.ReceiveDataSaub), dtos));
|
||||||
|
|
||||||
telemetryTracker.SaveRequest(uid);
|
telemetryTracker.SaveRequestDate(uid);
|
||||||
return Ok();
|
return Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,7 +93,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
if (dtos.Any())
|
if (dtos.Any())
|
||||||
Task.Run(() => telemetryHubContext.Clients.Group($"well_{wellId}").SendAsync(nameof(ITelemetryHubClient.ReceiveMessages), dtos));
|
Task.Run(() => telemetryHubContext.Clients.Group($"well_{wellId}").SendAsync(nameof(ITelemetryHubClient.ReceiveMessages), dtos));
|
||||||
|
|
||||||
telemetryTracker.SaveRequest(uid);
|
telemetryTracker.SaveRequestDate(uid);
|
||||||
return Ok();
|
return Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -108,7 +108,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
public IActionResult PostEvents(string uid, [FromBody] List<EventDto> events)
|
public IActionResult PostEvents(string uid, [FromBody] List<EventDto> events)
|
||||||
{
|
{
|
||||||
eventService.Upsert(uid, events);
|
eventService.Upsert(uid, events);
|
||||||
telemetryTracker.SaveRequest(uid);
|
telemetryTracker.SaveRequestDate(uid);
|
||||||
return Ok();
|
return Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
public IActionResult PostUsers(string uid, [FromBody] List<TelemetryUserDto> users)
|
public IActionResult PostUsers(string uid, [FromBody] List<TelemetryUserDto> users)
|
||||||
{
|
{
|
||||||
telemetryUserService.Upsert(uid, users);
|
telemetryUserService.Upsert(uid, users);
|
||||||
telemetryTracker.SaveRequest(uid);
|
telemetryTracker.SaveRequestDate(uid);
|
||||||
return Ok();
|
return Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user