DD.WellWorkover.Cloud/AsbCloudApp/Services/IManualCatalogService.cs

76 lines
2.3 KiB
C#
Raw Normal View History

using System.Collections.Generic;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using AsbCloudApp.Data.Manuals;
namespace AsbCloudApp.Services;
/// <summary>
/// Сервис для работы c каталогом инструкций
/// </summary>
public interface IManualCatalogService
{
/// <summary>
/// Сохранение файла
/// </summary>
/// <param name="idCategory"></param>
/// <param name="idFolder"></param>
/// <param name="name"></param>
/// <param name="stream"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<int> SaveFileAsync(int? idCategory, int? idFolder, string name, Stream stream,
CancellationToken cancellationToken);
/// <summary>
/// Добавление новой папки
/// </summary>
/// <param name="name"></param>
/// <param name="idParent"></param>
/// <param name="idCategory"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<int> AddFolderAsync(string name, int? idParent, int idCategory,
CancellationToken cancellationToken);
/// <summary>
/// Обновление папки
/// </summary>
/// <param name="id"></param>
/// <param name="name"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task UpdateFolderAsync(int id, string name, CancellationToken cancellationToken);
/// <summary>
/// Удаление папки
/// </summary>
/// <param name="id"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<int> DeleteFolderAsync(int id, CancellationToken cancellationToken);
/// <summary>
/// Удаление файла
/// </summary>
/// <param name="id"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<int> DeleteFileAsync(int id, CancellationToken cancellationToken);
/// <summary>
/// Получение файла
/// </summary>
/// <param name="id"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<(Stream stream, string fileName)?> GetFileAsync(int id, CancellationToken cancellationToken);
/// <summary>
/// Получение каталога
/// </summary>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<IEnumerable<CatalogItemManualDto>> GetCatalogAsync(CancellationToken cancellationToken);
}