feat: add filestorage
This commit is contained in:
parent
8dcb54076e
commit
de3f8dee6d
|
|
@ -0,0 +1,9 @@
|
|||
namespace BotSharp.Abstraction.Repositories.Enums;
|
||||
|
||||
public static class FileStorageEnum
|
||||
{
|
||||
public const string LocalFileStorage = nameof(LocalFileStorage);
|
||||
public const string AmazonS3Storage = nameof(AmazonS3Storage);
|
||||
public const string AzureBlobStorage = nameof(AzureBlobStorage);
|
||||
public const string TencentCosStorage = nameof(TencentCosStorage);
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
namespace BotSharp.Abstraction.Files;
|
||||
|
||||
public class FileStorageSettings
|
||||
{
|
||||
public string Default { get; set; }
|
||||
}
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
using BotSharp.Abstraction.Repositories.Enums;
|
||||
using BotSharp.Core.Files.Services;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
||||
|
|
@ -14,6 +15,12 @@ public class FilePlugin : IBotSharpPlugin
|
|||
|
||||
public void RegisterDI(IServiceCollection services, IConfiguration config)
|
||||
{
|
||||
services.AddScoped<IBotSharpFileService, BotSharpFileService>();
|
||||
var myFileStorageSettings = new FileStorageSettings();
|
||||
config.Bind("FileStorage", myFileStorageSettings);
|
||||
|
||||
if (myFileStorageSettings.Default == FileStorageEnum.LocalFileStorage)
|
||||
{
|
||||
services.AddScoped<IBotSharpFileService, BotSharpFileService>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -230,7 +230,9 @@
|
|||
"FileRepository": "data",
|
||||
"Assemblies": [ "BotSharp.Core" ]
|
||||
},
|
||||
|
||||
"FileStorage": {
|
||||
"Default": "LocalFileStorage"
|
||||
},
|
||||
"Qdrant": {
|
||||
"Url": "",
|
||||
"ApiKey": ""
|
||||
|
|
|
|||
Loading…
Reference in a new issue