using Model;
using Model.Dto.System;
using SqlSugar;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
namespace Service.Interface
{
///
/// 文件存储管理 服务接口
/// 管理侧:存储配置 CRUD + 设默认 + 连接测试;上传侧:按默认配置上传,登记 sys_file_record
///
public interface IFileStorageService
{
// ==================== 存储配置 ====================
/// 分页查询存储配置(关键字匹配 Name/Provider)
Task>> GetListPagedAsync(int pageIndex, int pageSize, RefAsync total, string? keyword = null);
/// 存储配置详情
Task> GetByIdAsync(long id);
/// 新增存储配置(校验 Provider 支持范围;IsDefault=1 时清零其它默认)
Task> AddAsync(FileStorageConfigDto dto);
/// 修改存储配置(AccessKey/SecretKey 为掩码时保留原值)
Task> UpdateAsync(FileStorageConfigDto dto);
/// 删除存储配置(默认配置禁止删除)
Task DeleteAsync(long id);
/// 设为默认(清零其它默认)
Task SetDefaultAsync(long id);
/// 测试连接(按配置调用对应 Provider 的 TestConnectionAsync)
Task TestAsync(long id);
// ==================== 文件上传/记录 ====================
/// 上传文件(使用默认启用的存储配置;校验大小/扩展名;登记 sys_file_record)
Task> UploadAsync(Stream stream, string originalName, long size, string? bizType = null, string? bizId = null, string? uploader = null);
/// 文件记录分页查询(可按 BizType / 关键字过滤)
Task>> GetFileListPagedAsync(int pageIndex, int pageSize, RefAsync total, string? keyword = null, string? bizType = null);
/// 文件记录详情
Task> GetFileByIdAsync(long id);
}
}