forked from ddrilling/AsbCloudServer
76 lines
2.7 KiB
C#
76 lines
2.7 KiB
C#
using System;
|
||
using AsbCloudApp.Data.DetectedOperation;
|
||
using AsbCloudApp.Requests;
|
||
using System.Collections.Generic;
|
||
using System.Threading.Tasks;
|
||
using System.Threading;
|
||
using AsbCloudApp.Services;
|
||
|
||
namespace AsbCloudApp.Repositories;
|
||
|
||
/// <summary>
|
||
/// Таблица автоматически определенных операций
|
||
/// </summary>
|
||
public interface IDetectedOperationRepository : ICrudRepository<DetectedOperationDto>
|
||
{
|
||
/// <summary>
|
||
/// Добавление записей
|
||
/// </summary>
|
||
/// <param name="idUser"></param>
|
||
/// <param name="dtos"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<int> Insert(int? idUser, IEnumerable<DetectedOperationDto> dtos, CancellationToken token);
|
||
|
||
/// <summary>
|
||
/// Получить автоматически определенные операции по телеметрии
|
||
/// </summary>
|
||
/// <param name="request"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<IEnumerable<DetectedOperationDto>> Get(DetectedOperationByTelemetryRequest request, CancellationToken token);
|
||
|
||
/// <summary>
|
||
/// Редактирование записей
|
||
/// </summary>
|
||
/// <param name="idUser"></param>
|
||
/// <param name="dtos"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<int> Update(int idUser, IEnumerable<DetectedOperationDto> dtos, CancellationToken token);
|
||
|
||
/// <summary>
|
||
/// Добавляет Dto у которых id == 0, изменяет dto у которых id != 0
|
||
/// </summary>
|
||
/// <param name="idUser"></param>
|
||
/// <param name="dtos"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<int> UpdateOrInsert(int idUser, IEnumerable<DetectedOperationDto> dtos, CancellationToken token);
|
||
|
||
/// <summary>
|
||
/// Удалить операции
|
||
/// </summary>
|
||
/// <param name="idUser"></param>
|
||
/// <param name="request"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<int> Delete(int idUser, DetectedOperationByTelemetryRequest request, CancellationToken token);
|
||
|
||
/// <summary>
|
||
/// Удаление записей
|
||
/// </summary>
|
||
/// <param name="idUser"></param>
|
||
/// <param name="ids"></param>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<int> DeleteRange(int idUser, IEnumerable<int> ids, CancellationToken token);
|
||
|
||
/// <summary>
|
||
/// Получение дат последних определённых операций
|
||
/// </summary>
|
||
/// <param name="token"></param>
|
||
/// <returns></returns>
|
||
Task<IDictionary<int, DateTimeOffset>> GetLastDetectedDatesAsync(CancellationToken token);
|
||
}
|