feat(news): add scraper adapters, article deduplication, blocklist service, and remove tracked publish artifacts

This commit is contained in:
2026-08-24 21:35:33 +02:00
parent 44b161d509
commit 8112598602
400 changed files with 1812 additions and 113367 deletions
@@ -0,0 +1,25 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace FinlyticNews.Entities;
/// <summary>
/// Entity representing a blocked news URL (e.g. duplicates, missing content, or no matched assets).
/// Prevents redundant re-discovery and re-scraping of known bad or duplicate URLs.
/// </summary>
[Table("BlockedNewsUrls")]
public class BlockedNewsUrlEntity
{
[Key]
public Guid Id { get; set; } = Guid.NewGuid();
[Required]
[MaxLength(2048)]
public string Url { get; set; } = string.Empty;
[MaxLength(256)]
public string Reason { get; set; } = string.Empty;
public DateTime BlockedAtUtc { get; set; } = DateTime.UtcNow;
}
+12 -1
View File
@@ -57,11 +57,22 @@ public class NewsArticleEntity
public DateTime PublishedAt { get; set; }
/// <summary>
/// Gets or sets the processing lifecycle state (e.g., "Pending", "Processing", "Completed", "Analyzed", "Failed").
/// Gets or sets the processing lifecycle state (e.g., "Pending", "Processing", "Completed", "Analyzed", "Failed", "Duplicate").
/// </summary>
[Required]
public string Status { get; set; } = "Pending";
/// <summary>
/// Gets or sets the normalized SHA-256 hash of the cleaned title for duplicate detection.
/// </summary>
[MaxLength(64)]
public string? TitleHash { get; set; }
/// <summary>
/// Gets or sets the 64-bit SimHash content fingerprint for fuzzy duplicate text detection.
/// </summary>
public long? SimHash { get; set; }
/// <summary>
/// Gets or sets the list of financial assets matched and associated with this news article.
/// </summary>
@@ -1,47 +0,0 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace FinlyticNews.Entities;
/// <summary>
/// Entity representing global runtime settings for the FinlyticNews microservice.
/// Persisted in PostgreSQL and updated dynamically via Admin Panel MQTT events.
/// </summary>
public class NewsSettingsEntity
{
/// <summary>
/// Gets or sets the primary key for the settings row.
/// </summary>
[Key]
public Guid Id { get; set; }
/// <summary>
/// Frequency in minutes for polling RSS feed sources.
/// </summary>
public int PollingFrequencyMinutes { get; set; } = 15;
/// <summary>
/// Article retention period in days before archival or cleanup.
/// </summary>
public int ArticleRetentionDays { get; set; } = 90;
/// <summary>
/// Default page size for historical news API pagination queries.
/// </summary>
public int DefaultPageSize { get; set; } = 20;
/// <summary>
/// Background scraper interval in minutes.
/// </summary>
public int ScrapingIntervalMinutes { get; set; } = 15;
/// <summary>
/// Webhook URL for n8n AI article analysis.
/// </summary>
public string N8nWebhookUrl { get; set; } = "http://localhost:5678/webhook/finlytic-news";
/// <summary>
/// Timestamp of last modification.
/// </summary>
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
}