BotSharp/src/Plugins/BotSharp.Plugin.ExcelHandler/ExcelHandlerPlugin.cs

34 lines
1.4 KiB
C#
Raw Normal View History

2024-09-26 20:34:16 +00:00
using BotSharp.Abstraction.Plugins;
using BotSharp.Abstraction.Settings;
2024-10-02 21:20:34 +00:00
using BotSharp.Plugin.ExcelHandler.Helpers.MySql;
using BotSharp.Plugin.ExcelHandler.Helpers.Sqlite;
2024-09-26 20:34:16 +00:00
using BotSharp.Plugin.ExcelHandler.Hooks;
2024-10-02 21:20:34 +00:00
using BotSharp.Plugin.ExcelHandler.Services;
2024-09-26 20:34:16 +00:00
using BotSharp.Plugin.ExcelHandler.Settings;
using Microsoft.Extensions.Configuration;
namespace BotSharp.Plugin.ExcelHandler;
public class ExcelHandlerPlugin : IBotSharpPlugin
{
public string Id => "c56a8e29-b16f-4d75-8766-8309342130cb";
public string Name => "Excel Handler";
public string Description => "Load data from excel file and transform it into a list of JSON format.";
2024-10-03 19:09:14 +00:00
public string IconUrl => "https://w7.pngwing.com/pngs/162/301/png-transparent-microsoft-excel-logo-thumbnail.png";
2024-09-26 20:34:16 +00:00
public void RegisterDI(IServiceCollection services, IConfiguration config)
{
services.AddScoped(provider =>
{
var settingService = provider.GetRequiredService<ISettingService>();
return settingService.Bind<ExcelHandlerSettings>("ExcelHandler");
});
services.AddScoped<IAgentUtilityHook, ExcelHandlerUtilityHook>();
2024-10-02 21:20:34 +00:00
services.AddScoped<ISqliteDbHelpers, SqliteDbHelpers>();
services.AddScoped<IMySqlDbHelper, MySqlDbHelpers>();
services.AddScoped<ISqliteService, SqliteService>();
services.AddScoped<IMySqlService, MySqlService>();
2024-09-26 20:34:16 +00:00
}
}