feat(storage): refactor storage service and provider interface, support dynamic registration of storage providers

This commit is contained in:
ShiYu
2025-05-22 16:31:32 +08:00
parent cafe48402e
commit 9243a26189
15 changed files with 237 additions and 105 deletions

View File

@@ -0,0 +1,33 @@
using Foxel.Models.DataBase;
namespace Foxel.Services.Attributes;
public enum StorageType
{
Local = 0,
Telegram = 1,
S3 = 2,
Cos = 3,
}
/// <summary>
/// 标记存储提供者类的特性
/// </summary>
[AttributeUsage(AttributeTargets.Class)]
public class StorageProviderAttribute : Attribute
{
/// <summary>
/// 存储类型
/// </summary>
public StorageType StorageType { get; }
/// <summary>
/// 构造函数
/// </summary>
/// <param name="storageType">存储类型</param>
public StorageProviderAttribute(StorageType storageType)
{
StorageType = storageType;
}
}