forked from ddrilling/AsbCloudServer
64 lines
2.0 KiB
C#
64 lines
2.0 KiB
C#
using System.IO;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace AsbCloudApp.Services;
|
|
|
|
/// <summary>
|
|
/// Сервис для работы c каталогом инструкций
|
|
/// </summary>
|
|
public interface IManualCatalogService
|
|
{
|
|
/// <summary>
|
|
/// Сохранение файла
|
|
/// </summary>
|
|
/// <param name="idDirectory"></param>
|
|
/// <param name="idAuthor"></param>
|
|
/// <param name="name"></param>
|
|
/// <param name="stream"></param>
|
|
/// <param name="cancellationToken"></param>
|
|
/// <returns></returns>
|
|
Task<int> SaveFileAsync(int idDirectory, int idAuthor, string name, Stream stream, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Добавление директории
|
|
/// </summary>
|
|
/// <param name="name"></param>
|
|
/// <param name="idParent"></param>
|
|
/// <param name="cancellationToken"></param>
|
|
/// <returns></returns>
|
|
Task<int> AddDirectoryAsync(string name, int? idParent, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Обновление директории
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <param name="name"></param>
|
|
/// <param name="cancellationToken"></param>
|
|
/// <returns></returns>
|
|
Task UpdateDirectoryAsync(int id, string name, CancellationToken cancellationToken);
|
|
|
|
/// <summary>
|
|
/// Удаление директории
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <param name="cancellationToken"></param>
|
|
/// <returns></returns>
|
|
Task<int> DeleteDirectoryAsync(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);
|
|
} |