2024-05-20 21:50:45 +00:00
|
|
|
using BotSharp.Abstraction.Http.Settings;
|
|
|
|
|
using BotSharp.Abstraction.Settings;
|
2024-01-06 22:24:22 +00:00
|
|
|
using Microsoft.Extensions.Configuration;
|
|
|
|
|
|
|
|
|
|
namespace BotSharp.Plugin.HttpHandler;
|
|
|
|
|
|
|
|
|
|
public class HttpHandlerPlugin : IBotSharpPlugin
|
|
|
|
|
{
|
2024-01-12 22:20:22 +00:00
|
|
|
public string Id => "2c1eb1c4-16e5-4c65-8ee4-032324c26b81";
|
2024-01-06 22:24:22 +00:00
|
|
|
public string Name => "HTTP Handler";
|
|
|
|
|
public string Description => "Empower agent to handle HTTP request in RESTful API or GraphQL";
|
|
|
|
|
public string IconUrl => "https://lirp.cdn-website.com/6f8d6d8a/dms3rep/multi/opt/API_Icon-640w.png";
|
2024-01-13 00:31:25 +00:00
|
|
|
public string[] AgentIds => new[] { "87c458fc-ec5f-40ae-8ed6-05dda8a07523" };
|
2024-01-06 22:24:22 +00:00
|
|
|
|
|
|
|
|
public void RegisterDI(IServiceCollection services, IConfiguration config)
|
|
|
|
|
{
|
2024-05-20 21:50:45 +00:00
|
|
|
services.AddScoped(provider =>
|
|
|
|
|
{
|
|
|
|
|
var settingService = provider.GetRequiredService<ISettingService>();
|
|
|
|
|
return settingService.Bind<HttpSettings>("Http");
|
|
|
|
|
});
|
2024-01-06 22:24:22 +00:00
|
|
|
}
|
|
|
|
|
}
|