109 lines
4.3 KiB
C#
109 lines
4.3 KiB
C#
using Persistence.Models;
|
||
using Persistence.Models.Requests;
|
||
using Refit;
|
||
|
||
namespace Persistence.Client.Clients;
|
||
|
||
/// <summary>
|
||
/// Интерфейс для тестирования API, предназначенного для работы с записями ChangeLod
|
||
/// </summary>
|
||
public interface IChangeLogClient
|
||
{
|
||
private const string BaseRoute = "/api/ChangeLog";
|
||
|
||
/// <summary>
|
||
/// Импорт с заменой: удаление старых строк и добавление новых
|
||
/// </summary>
|
||
/// <param name="idDiscriminator"></param>
|
||
/// <param name="dtos"></param>
|
||
/// <returns></returns>
|
||
[Post($"{BaseRoute}/replace/{{idDiscriminator}}")]
|
||
Task<IApiResponse<int>> ClearAndAddRange(Guid idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos);
|
||
|
||
/// <summary>
|
||
/// Получение актуальных данных на определенную дату (с пагинацией)
|
||
/// </summary>
|
||
/// <param name="idDiscriminator"></param>
|
||
/// <param name="moment"></param>
|
||
/// <param name="filterRequest">параметры запроса фильтрации</param>
|
||
/// <param name="paginationRequest">параметры запроса пагинации</param>
|
||
/// <returns></returns>
|
||
[Get($"{BaseRoute}/moment/{{idDiscriminator}}")]
|
||
Task<IApiResponse<PaginationContainer<DataWithWellDepthAndSectionDto>>> GetByDate(
|
||
Guid idDiscriminator,
|
||
DateTimeOffset moment,
|
||
[Query] SectionPartRequest filterRequest,
|
||
[Query] PaginationRequest paginationRequest);
|
||
|
||
/// <summary>
|
||
/// Получение исторических данных за определенный период времени
|
||
/// </summary>
|
||
/// <param name="idDiscriminator"></param>
|
||
/// <param name="dateBegin"></param>
|
||
/// <param name="dateEnd"></param>
|
||
/// <returns></returns>
|
||
[Get($"{BaseRoute}/history/{{idDiscriminator}}")]
|
||
Task<IApiResponse<IEnumerable<ChangeLogDto>>> GetChangeLogForInterval(Guid idDiscriminator, DateTimeOffset dateBegin, DateTimeOffset dateEnd);
|
||
|
||
/// <summary>
|
||
/// Добавить одну запись
|
||
/// </summary>
|
||
/// <param name="idDiscriminator"></param>
|
||
/// <param name="dto"></param>
|
||
/// <returns></returns>
|
||
[Post($"{BaseRoute}/{{idDiscriminator}}")]
|
||
Task<IApiResponse<int>> Add(Guid idDiscriminator, DataWithWellDepthAndSectionDto dto);
|
||
|
||
/// <summary>
|
||
/// Добавить несколько записей
|
||
/// </summary>
|
||
/// <param name="idDiscriminator"></param>
|
||
/// <param name="dtos"></param>
|
||
/// <returns></returns>
|
||
[Post($"{BaseRoute}/range/{{idDiscriminator}}")]
|
||
Task<IApiResponse<int>> AddRange(Guid idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos);
|
||
|
||
/// <summary>
|
||
/// Обновить одну запись
|
||
/// </summary>
|
||
/// <param name="idDiscriminator"></param>
|
||
/// <param name="dto"></param>
|
||
/// <returns></returns>
|
||
[Put($"{BaseRoute}/{{idDiscriminator}}")]
|
||
Task<IApiResponse<int>> Update(Guid idDiscriminator, DataWithWellDepthAndSectionDto dto);
|
||
|
||
/// <summary>
|
||
/// Обновить несколько записей
|
||
/// </summary>
|
||
/// <param name="idDiscriminator"></param>
|
||
/// <param name="dtos"></param>
|
||
/// <returns></returns>
|
||
[Put($"{BaseRoute}/range/{{idDiscriminator}}")]
|
||
Task<IApiResponse<int>> UpdateRange(Guid idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos);
|
||
|
||
/// <summary>
|
||
/// Удалить одну запись
|
||
/// </summary>
|
||
/// <param name="id"></param>
|
||
/// <returns></returns>
|
||
[Delete($"{BaseRoute}")]
|
||
Task<IApiResponse<int>> Delete(Guid id);
|
||
|
||
/// <summary>
|
||
/// Удалить несколько записей
|
||
/// </summary>
|
||
/// <param name="ids"></param>
|
||
/// <returns></returns>
|
||
[Delete($"{BaseRoute}/range")]
|
||
Task<IApiResponse<int>> DeleteRange([Body] IEnumerable<Guid> ids);
|
||
|
||
/// <summary>
|
||
/// Получение списка дат, в которые происходили изменения (день, месяц, год, без времени)
|
||
/// </summary>
|
||
/// <param name="idDiscriminator"></param>
|
||
/// <returns></returns>
|
||
[Get($"{BaseRoute}/datesRange")]
|
||
Task<IApiResponse<DatesRangeDto?>> GetDatesRange(Guid idDiscriminator);
|
||
|
||
}
|