网站首页 网站源码
website
站点相关全部源代码,隐藏了一些关于服务器的信息
using Dpz.Core.EnumLibrary;
using Dpz.Core.Infrastructure.PublicStruct;
using Dpz.Core.Public.ViewModel;
using Dpz.Core.Public.ViewModel.V4;
using Dpz.Core.Shard.Service;

namespace Dpz.Core.Service.ObjectStorage.Services;

/// <summary>
/// 又拍云储存操作
/// </summary>
public interface IObjectStorageOperation
{
    /// <summary>
    /// 储存筒
    /// </summary>
    string Bucket { get; }

    /// <summary>
    /// 上传文件
    /// </summary>
    /// <param name="stream">文件流</param>
    /// <param name="path">文件夹路径</param>
    /// <param name="filename">文件名</param>
    /// <returns></returns>
    Task<UploadResult> UploadAsync(Stream stream, ICollection<string> path, string filename);

    /// <summary>
    /// 断点续传
    /// </summary>
    /// <param name="file"></param>
    /// <returns></returns>
    Task<FileAddress?> UploadFileAsync(CloudFile file);

    /// <summary>
    /// 上传文件
    /// </summary>
    /// <param name="bytes">bytes</param>
    /// <param name="path">文件夹路径</param>
    /// <param name="filename">文件名</param>
    /// <returns></returns>
    Task<UploadResult> UploadAsync(byte[] bytes, ICollection<string> path, string filename);

    /// <summary>
    /// 下载文件
    /// </summary>
    /// <param name="pathToFile">路径级文件</param>
    /// <returns></returns>
    Task<Stream> DownloadAsync(string pathToFile);

    /// <summary>
    /// 下载文件另存为
    /// </summary>
    /// <param name="pathToFile">路径级文件</param>
    /// <param name="path">保存路径</param>
    /// <returns></returns>
    Task SaveAsAsync(string pathToFile, string path);

    /// <summary>
    /// 删除文件
    /// </summary>
    /// <param name="pathToFile"></param>
    /// <returns></returns>
    Task DeleteAsync(string pathToFile);

    /// <summary>
    /// 获取目录列表文件和文件夹信息
    /// </summary>
    /// <param name="path">路径</param>
    /// <returns></returns>
    Task<IList<FolderResult>> GetFolderListAsync(string path);

    /// <summary>
    /// 获取文件信息
    /// </summary>
    /// <param name="pathToFile"></param>
    /// <returns></returns>
    Task<FileInformation> GetFileInformationAsync(string pathToFile);
}
loading