2024-11-12 13:36:09 +05:00
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
2024-11-08 18:24:52 +05:00
|
|
|
|
|
|
|
|
|
namespace Persistence.API;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2024-11-12 13:36:09 +05:00
|
|
|
|
/// Интерфейс для API, предназначенного для работы с элементами справочников
|
2024-11-08 18:24:52 +05:00
|
|
|
|
/// </summary>
|
2024-11-14 15:17:43 +05:00
|
|
|
|
public interface IDictionaryElementApi<TDto> where TDto : class, new()
|
2024-11-08 18:24:52 +05:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Получить все данные справочника
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="dictionaryKey">ключ справочника</param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
2024-11-12 13:36:09 +05:00
|
|
|
|
Task<ActionResult<IEnumerable<TDto>>> GetAsync(Guid dictionaryKey, CancellationToken token);
|
2024-11-08 18:24:52 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Добавить элемент в справочник
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="dictionaryKey">ключ справочника</param>
|
|
|
|
|
/// <param name="dto"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
2024-11-12 13:36:09 +05:00
|
|
|
|
Task<ActionResult<Guid>> AddAsync(Guid dictionaryKey, TDto dto, CancellationToken token);
|
2024-11-08 18:24:52 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Изменить одну запись
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="dictionaryKey">ключ справочника</param>
|
|
|
|
|
/// <param name="dictionaryElementKey">ключ элемента в справочнике</param>
|
|
|
|
|
/// <param name="dto"></param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
2024-11-12 13:36:09 +05:00
|
|
|
|
Task<ActionResult<Guid>> UpdateAsync(Guid dictionaryKey, Guid dictionaryElementKey, TDto dto, CancellationToken token);
|
2024-11-08 18:24:52 +05:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Удалить одну запись
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="dictionaryKey">ключ справочника</param>
|
|
|
|
|
/// <param name="dictionaryElementKey">ключ элемента в справочнике</param>
|
|
|
|
|
/// <param name="token"></param>
|
|
|
|
|
/// <returns></returns>
|
2024-11-12 13:36:09 +05:00
|
|
|
|
Task<ActionResult<int>> DeleteAsync(Guid dictionaryKey, Guid dictionaryElementKey, CancellationToken token);
|
2024-11-08 18:24:52 +05:00
|
|
|
|
}
|