persistence/Persistence/Repositories/ISetpointRepository.cs
2024-11-18 15:05:12 +05:00

47 lines
1.9 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Persistence.Models;
namespace Persistence.Repositories;
/// <summary>
/// Интерфейс по работе с уставками
/// </summary>
public interface ISetpointRepository
{
/// <summary>
/// Получить значения уставок по набору ключей
/// </summary>
/// <param name="setpointKeys"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<IEnumerable<SetpointValueDto>> GetCurrent(IEnumerable<Guid> setpointKeys, CancellationToken token);
/// <summary>
/// Получить значения уставок за определенный момент времени
/// </summary>
/// <param name="setpointKeys"></param>
/// <param name="historyMoment">дата, на которую получаем данные</param>
/// <param name="token"></param>
/// <returns></returns>
Task<IEnumerable<SetpointValueDto>> GetHistory(IEnumerable<Guid> setpointKeys, DateTimeOffset historyMoment, CancellationToken token);
/// <summary>
/// Получить историю изменений значений уставок
/// </summary>
/// <param name="setpointKeys"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<Dictionary<Guid, IEnumerable<SetpointLogDto>>> GetLog(IEnumerable<Guid> setpointKeys, CancellationToken token);
/// <summary>
/// Метод сохранения уставки
/// </summary>
/// <param name="setpointKey">ключ операции</param>
/// <param name="idUser">ключ пользователя</param>
/// <param name="newValue">значение</param>
/// <param name="token"></param>
/// <returns></returns>
/// to do
/// id User учесть в соответствующем методе репозитория
Task<int> Save(Guid setpointKey, object newValue, int idUser, CancellationToken token);
}