feat(settings): add dynamic N8N webhook URL configuration for News, Sentiment and Analyzer services

This commit is contained in:
2026-08-17 16:10:31 +02:00
parent 75a2510b39
commit 3972507cb0
6 changed files with 68 additions and 24 deletions
+17 -4
View File
@@ -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;
}
}
}
+3
View File
@@ -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");
}