feat(settings): add dynamic N8N webhook URL configuration for News, Sentiment and Analyzer services
This commit is contained in:
@@ -51,11 +51,24 @@ public class N8nService : IN8nService
|
||||
|
||||
using (var scope = _scopeFactory.CreateScope())
|
||||
{
|
||||
var settingsDb = scope.ServiceProvider.GetService<ISettingsDbService>();
|
||||
if (settingsDb != null)
|
||||
var settingsService = scope.ServiceProvider.GetService<ISettingsService>();
|
||||
if (settingsService != null)
|
||||
{
|
||||
var settings = await settingsDb.GetSettingsAsync();
|
||||
targetUrl = settings?.N8nWebhookUrl;
|
||||
var dynamicUrl = await settingsService.GetSettingAsync(SettingKeys.N8nArticleExtractionUrl, ct);
|
||||
if (!string.IsNullOrWhiteSpace(dynamicUrl))
|
||||
{
|
||||
targetUrl = dynamicUrl.Trim();
|
||||
}
|
||||
}
|
||||
|
||||
if (string.IsNullOrWhiteSpace(targetUrl))
|
||||
{
|
||||
var settingsDb = scope.ServiceProvider.GetService<ISettingsDbService>();
|
||||
if (settingsDb != null)
|
||||
{
|
||||
var settings = await settingsDb.GetSettingsAsync();
|
||||
targetUrl = settings?.N8nWebhookUrl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,4 +21,7 @@ public static class SettingKeys
|
||||
|
||||
// --- Daten-Retention & Cleanup ---
|
||||
public static readonly SettingKey<int> ArticleRetentionDays = new("Data.ArticleRetentionDays", 90);
|
||||
|
||||
// --- N8N / Webhook-Konfiguration ---
|
||||
public static readonly SettingKey<string> N8nArticleExtractionUrl = new("N8N.ArticleExtractionUrl", "https://n8n.kleidukos.me/webhook/gemini/article/extraction");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user