Confluence
This commit is contained in:
25
LazyBear.MCP/Services/Confluence/ConfluenceClientFactory.cs
Normal file
25
LazyBear.MCP/Services/Confluence/ConfluenceClientFactory.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using RestSharp;
|
||||
|
||||
namespace LazyBear.MCP.Services.Confluence;
|
||||
|
||||
public static class ConfluenceClientFactory
|
||||
{
|
||||
public static RestClient CreateClient(IConfiguration configuration)
|
||||
{
|
||||
var confluenceUrl = configuration["Confluence:Url"] ?? "";
|
||||
|
||||
if (string.IsNullOrWhiteSpace(confluenceUrl))
|
||||
{
|
||||
throw new Exception("Confluence:Url нe задан");
|
||||
}
|
||||
|
||||
var config = new RestClientOptions(confluenceUrl)
|
||||
{
|
||||
UserAgent = "LazyBear-Confluence-MCP",
|
||||
Timeout = TimeSpan.FromMilliseconds(30000)
|
||||
};
|
||||
|
||||
return new RestClient(config);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user