102 lines
3.1 KiB
C#
102 lines
3.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using xFileService.Models.Dtos;
|
|
using xIdentityModels.Models;
|
|
using xIdentityService.Interfaces;
|
|
using XFileDto = xFileService.Models.Dtos.XFileDto;
|
|
|
|
namespace xFileService.Interfaces
|
|
{
|
|
/// <summary>
|
|
/// Implementing XBaseFileProvider ...
|
|
/// </summary>
|
|
/// <typeparam name="TKey"></typeparam>
|
|
public interface IXBaseFileProvider<TKey> : IXIdentityBaseReferencedProvider<XFileDto, TKey>
|
|
{
|
|
//
|
|
#region Props ...
|
|
/// <summary>
|
|
/// Specified Provider Repositroy ...
|
|
/// </summary>
|
|
IXFileProvider FileProvider { get; }
|
|
#endregion
|
|
|
|
//
|
|
#region Tools ...
|
|
/// <summary>
|
|
/// Stream Specified File ...
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <returns></returns>
|
|
Task<FileStreamResult> Stream(Guid id);
|
|
|
|
/// <summary>
|
|
/// Stream Specified File ...
|
|
/// </summary>
|
|
/// <param name="fileName"></param>
|
|
/// <returns></returns>
|
|
Task<FileStreamResult> Stream(string fileName);
|
|
|
|
/// <summary>
|
|
/// Download Specified File ...
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <returns></returns>
|
|
Task<PhysicalFileResult> Download(Guid id);
|
|
|
|
/// <summary>
|
|
/// Download Specified File ...
|
|
/// </summary>
|
|
/// <param name="fileName"></param>
|
|
/// <returns></returns>
|
|
Task<PhysicalFileResult> Download(string fileName);
|
|
|
|
/// <summary>
|
|
/// Upload Files ...
|
|
/// </summary>
|
|
/// <param name="forProvidedId"></param>
|
|
/// <param name="files"></param>
|
|
/// <param name="connectionId"></param>
|
|
/// <param name="userInfo"></param>
|
|
/// <returns></returns>
|
|
Task<IEnumerable<XFileDto>> Upload(
|
|
TKey forProvidedId,
|
|
IFormFileCollection files,
|
|
string connectionId = null,
|
|
XUserClaimsInfoDto userInfo = null
|
|
);
|
|
|
|
/// <summary>
|
|
/// Remove Specified Files ...
|
|
/// </summary>
|
|
/// <param name="forProvidedId"></param>
|
|
/// <param name="ids"></param>
|
|
/// <param name="connectionId"></param>
|
|
/// <param name="userInfo"></param>
|
|
/// <returns></returns>
|
|
Task<IEnumerable<Guid>> RemoveFile(
|
|
TKey forProvidedId,
|
|
string ids = null,
|
|
string connectionId = null,
|
|
XUserClaimsInfoDto userInfo = null
|
|
);
|
|
|
|
/// <summary>
|
|
/// Retrieve Specified File Streaming Info ...
|
|
/// </summary>
|
|
/// <param name="id"></param>
|
|
/// <returns></returns>
|
|
Task<XFileStreamDescriptorDto> GetFileDescriptor(Guid id);
|
|
|
|
/// <summary>
|
|
/// Retrieve Specified File Streaming Info ...
|
|
/// </summary>
|
|
/// <param name="fileName"></param>
|
|
/// <returns></returns>
|
|
Task<XFileStreamDescriptorDto> GetFileDescriptor(string fileName);
|
|
#endregion
|
|
}
|
|
} |