2024-07-30 16:24:31 +00:00
|
|
|
using BotSharp.Abstraction.Repositories.Enums;
|
2024-07-01 19:31:48 +00:00
|
|
|
using BotSharp.Core.Files.Services;
|
2024-06-06 18:30:39 +00:00
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
|
|
|
|
|
namespace BotSharp.Core.Files;
|
|
|
|
|
|
2024-08-09 21:03:29 +00:00
|
|
|
public class FileCorePlugin : IBotSharpPlugin
|
2024-06-06 18:30:39 +00:00
|
|
|
{
|
|
|
|
|
public string Id => "6a8473c0-04eb-4346-be32-24755ce5973d";
|
|
|
|
|
|
2024-08-09 21:03:29 +00:00
|
|
|
public string Name => "File Core";
|
2024-06-06 18:30:39 +00:00
|
|
|
|
2024-08-08 03:00:18 +00:00
|
|
|
public string Description => "Provides file storage and analysis.";
|
2024-06-06 18:30:39 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
public void RegisterDI(IServiceCollection services, IConfiguration config)
|
|
|
|
|
{
|
2024-08-09 21:03:29 +00:00
|
|
|
var fileCoreSettings = new FileCoreSettings();
|
|
|
|
|
config.Bind("FileCore", fileCoreSettings);
|
|
|
|
|
services.AddSingleton(fileCoreSettings);
|
2024-07-30 16:24:31 +00:00
|
|
|
|
2024-08-09 21:03:29 +00:00
|
|
|
if (fileCoreSettings.Storage == FileStorageEnum.LocalFileStorage)
|
2024-07-30 16:24:31 +00:00
|
|
|
{
|
2024-08-08 01:56:29 +00:00
|
|
|
services.AddScoped<IFileStorageService, LocalFileStorageService>();
|
2024-07-30 16:24:31 +00:00
|
|
|
}
|
2024-08-07 21:56:57 +00:00
|
|
|
services.AddScoped<IFileInstructService, FileInstructService>();
|
2024-06-06 18:30:39 +00:00
|
|
|
}
|
|
|
|
|
}
|