using HoneyBox.Admin.Business.Models.Upload;

namespace HoneyBox.Admin.Business.Services.Interfaces;

/// <summary>
/// 存储提供者接口
/// </summary>
public interface IStorageProvider
{
    /// <summary>
    /// 存储类型标识
    /// "1" = 本地存储
    /// "3" = 腾讯云COS
    /// </summary>
    string StorageType { get; }

    /// <summary>
    /// 是否支持客户端直传
    /// </summary>
    bool SupportsDirectUpload { get; }

    /// <summary>
    /// 上传文件（服务端上传）
    /// </summary>
    /// <param name="fileStream">文件流</param>
    /// <param name="fileName">文件名</param>
    /// <param name="contentType">内容类型</param>
    /// <returns>上传结果</returns>
    Task<UploadResult> UploadAsync(Stream fileStream, string fileName, string contentType);

    /// <summary>
    /// 获取预签名上传URL（客户端直传）
    /// </summary>
    /// <param name="fileName">文件名</param>
    /// <param name="contentType">内容类型</param>
    /// <param name="expiresInSeconds">URL有效期（秒），默认600秒</param>
    /// <returns>预签名URL信息</returns>
    Task<PresignedUrlResponse?> GetPresignedUploadUrlAsync(string fileName, string contentType, int expiresInSeconds = 600);

    /// <summary>
    /// 删除文件
    /// </summary>
    /// <param name="fileUrl">文件URL</param>
    /// <returns>是否成功</returns>
    Task<bool> DeleteAsync(string fileUrl);
}
