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

@@ -5,7 +5,9 @@ using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.EntityFrameworkCore;
using Microsoft.IdentityModel.Tokens;
using System.Text;
using Foxel.Services.Attributes;
using Foxel.Services.StorageProvider;
using System.Reflection;
namespace Foxel.Extensions;
@@ -25,7 +27,7 @@ public static class ServiceCollectionExtensions
services.AddSingleton<TelegramStorageProvider>();
services.AddSingleton<S3StorageProvider>();
services.AddSingleton<CosStorageProvider>();
services.AddSingleton<IStorageProviderFactory, StorageProviderFactory>();
services.AddSingleton<IStorageService, StorageService>();
services.AddSingleton<IDatabaseInitializer, DatabaseInitializer>();
}