DD.WellWorkover.Cloud/AsbCloudApp/Services/IWitsRepository.cs

50 lines
2.0 KiB
C#
Raw Normal View History

2022-04-08 13:10:06 +05:00
using AsbCloudApp.Data;
using System;
using System.Collections.Generic;
2022-04-01 17:55:44 +05:00
using System.Threading;
using System.Threading.Tasks;
namespace AsbCloudApp.Services
{
2022-06-02 12:35:51 +05:00
/// <summary>
/// The wits record repository.
/// </summary>
2022-04-08 13:10:06 +05:00
public interface IWitsRecordRepository<TDto>
2022-04-11 18:00:34 +05:00
where TDto : ITelemetryData
2022-04-01 17:55:44 +05:00
{
2022-06-02 12:35:51 +05:00
/// <summary>
/// Добавить новые данные
/// </summary>
/// <param name="idTelemetry">The id telemetry.</param>
/// <param name="dtos">The dtos.</param>
/// <param name="token">The token.</param>
/// <returns>A Task.</returns>
2022-04-08 13:10:06 +05:00
Task SaveDataAsync(int idTelemetry, IEnumerable<TDto> dtos, CancellationToken token);
2022-06-02 12:35:51 +05:00
/// <summary>
/// Получить данные по телеметрии за период
/// </summary>
/// <param name="idTelemetry"></param>
/// <param name="begin"></param>
/// <param name="end"></param>
/// <param name="token"></param>
/// <returns></returns>
2022-04-08 13:10:06 +05:00
Task<IEnumerable<TDto>> GetAsync(int idTelemetry, DateTime begin, DateTime end, CancellationToken token);
2022-06-02 12:35:51 +05:00
/// <summary>
/// получить массив из одной записи самой поздней по дате
/// </summary>
/// <param name="idTelemetry">The id telemetry.</param>
/// <param name="token">The token.</param>
/// <returns>A Task.</returns>
Task<IEnumerable<TDto>> GetLastAsync(int idTelemetry, CancellationToken token);
2022-06-02 12:35:51 +05:00
/// <summary>
/// получить статистику по всему архиву: дата самой ранней записи, самой поздней и общее количество
/// </summary>
/// <param name="idTelemetry">The id telemetry.</param>
/// <param name="token">The token.</param>
/// <returns>A Task.</returns>
2022-04-08 13:10:06 +05:00
Task<(DateTime begin, DateTime end, int count)?> GetStatAsync(int idTelemetry, CancellationToken token);
2022-04-01 17:55:44 +05:00
}
}