using JNPF.Common.Enums; using JNPF.Common.Models; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; namespace JNPF.Common.Core.Manager.Files { public interface IFileManager { #region 导入导出(json文件) /// /// 导出. /// /// json数据. /// 文件名. /// 文件后缀. /// Task Export(string jsonStr, string name, ExportFileType exportFileType = ExportFileType.json); /// /// 导入. /// /// 文件. /// string Import(IFormFile file); #endregion #region OSS /// /// 根据存储类型上传文件. /// /// 文件流. /// 保存文件夹. /// 新文件名. /// Task UploadFileByType(Stream stream, string directoryPath, string fileName); /// /// 根据存储类型下载文件. /// /// 文件路径. /// 文件下载名. /// Task DownloadFileByType(string filePath, string fileDownLoadName); /// /// 获取指定文件夹下所有文件. /// /// 文件前缀. /// Task> GetObjList(string filePath); /// /// 删除文件. /// /// /// Task DeleteFile(string filePath); /// /// 判断文件是否存在. /// /// 文件地址. /// Task ExistsFile(string filePath); /// /// 获取指定文件流. /// /// /// Task GetFileStream(string filePath); /// /// 剪切文件. /// /// 源文件地址. /// 剪切地址. /// Task MoveFile(string filePath, string toFilePath); /// /// 复制文件. /// /// 源文件地址. /// 剪切地址. /// Task CopyFile(string filePath, string toFilePath); #endregion /// /// 根据类型获取文件存储路径. /// /// 文件类型. /// public string GetPathByType(string type); /// /// 分片上传附件. /// /// /// Task UploadChunk([FromForm] ChunkModel input); /// /// 分片组装. /// /// /// Task Merge([FromForm] ChunkModel input); /// /// 获取文件大小. /// /// /// string GetFileSize(long size); /// /// 获取地址和文件名. /// /// /// void GetChunkModel(ChunkModel input, string saveFileName); } }