persistence/Persistence/API/ISetpointApi.cs

45 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 Microsoft.AspNetCore.Mvc;
using Persistence.Models;
namespace Persistence.API;
/// <summary>
/// Интерфейс для API, предназначенного для работы с уставками
/// </summary>
public interface ISetpointApi
{
/// <summary>
/// Получить актуальные значения уставок
/// </summary>
/// <param name="setpoitKeys">ключи уставок</param>
/// <param name="token"></param>
/// <returns></returns>
Task<ActionResult<IEnumerable<SetpointValueDto>>> GetCurrent(IEnumerable<Guid> setpoitKeys, CancellationToken token);
/// <summary>
/// Получить значения уставок за определенный момент времени
/// </summary>
/// <param name="setpoitKeys">ключи уставок</param>
/// <param name="historyMoment">дата, на которую получаем данные</param>
/// <param name="token"></param>
/// <returns></returns>
Task<ActionResult<IEnumerable<SetpointValueDto>>> GetHistory(IEnumerable<Guid> setpoitKeys, DateTimeOffset historyMoment, CancellationToken token);
/// <summary>
/// Получить историю изменений значений уставок
/// </summary>
/// <param name="setpoitKeys">ключи уставок</param>
/// <param name="token"></param>
/// <returns></returns>
Task<ActionResult<Dictionary<Guid, IEnumerable<SetpointLogDto>>>> GetLog(IEnumerable<Guid> setpoitKeys, CancellationToken token);
/// <summary>
/// Метод сохранения уставки
/// </summary>
/// <param name="setpointKey">ключ уставки</param>
/// <param name="newValue">значение</param>
/// <param name="token"></param>
/// <returns></returns>
Task<ActionResult<int>> Save(Guid setpointKey, object newValue, CancellationToken token);
}