forked from ddrilling/AsbCloudServer
50 lines
2.0 KiB
C#
50 lines
2.0 KiB
C#
using AsbCloudApp.Data;
|
|
using AsbCloudApp.Requests;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace AsbCloudApp.Services
|
|
{
|
|
/// <summary>
|
|
/// The wits record repository.
|
|
/// </summary>
|
|
public interface IWitsRecordRepository<TDto> : ITelemetryDataEditorService
|
|
where TDto : ITelemetryData
|
|
{
|
|
/// <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>
|
|
Task SaveDataAsync(int idTelemetry, IEnumerable<TDto> dtos, CancellationToken token);
|
|
|
|
/// <summary>
|
|
/// Получить данные по телеметрии за период
|
|
/// </summary>
|
|
/// <param name="idTelemetry"></param>
|
|
/// <param name="begin"></param>
|
|
/// <param name="end"></param>
|
|
/// <param name="token"></param>
|
|
/// <returns></returns>
|
|
Task<IEnumerable<TDto>> GetAsync(int idTelemetry, DateTime begin, DateTime end, CancellationToken token);
|
|
|
|
/// <summary>
|
|
/// получить массив из одной записи самой поздней по дате
|
|
/// </summary>
|
|
/// <param name="idTelemetry">The id telemetry.</param>
|
|
/// <returns>A Task.</returns>
|
|
TDto? GetLastOrDefault(int idTelemetry);
|
|
|
|
/// <summary>
|
|
/// получить статистику по всему архиву: дата самой ранней записи, самой поздней и общее количество
|
|
/// </summary>
|
|
/// <param name="idTelemetry">The id telemetry.</param>
|
|
/// <param name="token">The token.</param>
|
|
/// <returns>A Task.</returns>
|
|
Task<(DateTime begin, DateTime end, int count)?> GetStatAsync(int idTelemetry, CancellationToken token);
|
|
}
|
|
} |