using HoneyBox.Admin.Business.Models.Upload;
using Microsoft.AspNetCore.Http;

namespace HoneyBox.Admin.Business.Services.Interfaces;

/// <summary>
/// 上传服务接口
/// </summary>
public interface IUploadService
{
    /// <summary>
    /// 上传图片（服务端上传，用于本地存储或不支持直传的场景）
    /// </summary>
    /// <param name="file">上传的文件</param>
    /// <returns>上传响应</returns>
    Task<UploadResponse> UploadImageAsync(IFormFile file);

    /// <summary>
    /// 批量上传图片
    /// </summary>
    /// <param name="files">上传的文件列表</param>
    /// <returns>上传响应列表</returns>
    Task<List<UploadResponse>> UploadImagesAsync(List<IFormFile> files);

    /// <summary>
    /// 上传Base64编码的图片
    /// </summary>
    /// <param name="base64Image">Base64编码的图片数据（可包含data:image/xxx;base64,前缀）</param>
    /// <param name="fileNamePrefix">文件名前缀，如 "avatar"</param>
    /// <returns>上传后的图片URL，失败返回null</returns>
    Task<string?> UploadBase64ImageAsync(string base64Image, string fileNamePrefix = "image");

    /// <summary>
    /// 获取预签名上传URL（客户端直传）
    /// </summary>
    /// <param name="request">请求参数</param>
    /// <returns>预签名URL响应，如果不支持直传则返回null</returns>
    Task<PresignedUrlResponse?> GetPresignedUploadUrlAsync(GetPresignedUrlRequest request);
}
