From d7242c12c855105cc2a30912daafd45b5887c4e3 Mon Sep 17 00:00:00 2001 From: James Tombleson Date: Sun, 23 Jul 2023 22:51:22 -0700 Subject: [PATCH] Created a master config to match the appsettings --- Newsbot.Collector.Domain/Models/Config.cs | 47 ++++++++++++++++--- .../Sources/ConfigSectionRedditModel.cs | 9 ---- 2 files changed, 41 insertions(+), 15 deletions(-) delete mode 100644 Newsbot.Collector.Domain/Models/Config/Sources/ConfigSectionRedditModel.cs diff --git a/Newsbot.Collector.Domain/Models/Config.cs b/Newsbot.Collector.Domain/Models/Config.cs index 77dd469..f9e9cd4 100644 --- a/Newsbot.Collector.Domain/Models/Config.cs +++ b/Newsbot.Collector.Domain/Models/Config.cs @@ -1,13 +1,24 @@ +using Newsbot.Collector.Domain.Models.Config; + namespace Newsbot.Collector.Domain.Models; public class ConfigModel { - public string? ServerAddress { get; set; } - public string? SqlConnectionString { get; set; } - public RedditConfigModel? Reddit { get; set; } + public ConnectionStrings? ConnectionStrings { get; set; } + public RedditConfig? Reddit { get; set; } + public YoutubeConfig? Youtube { get; set; } + public TwitchConfig? Twitch { get; set; } + public BasicSourceConfig? FinalFantasyXiv { get; set; } + public BasicSourceConfig? Rss { get; set; } + public BasicSourceConfig? CodeProjects { get; set; } + public NotificationsConfig? Notifications { get; set; } + public bool EnableSwagger { get; set; } + public bool RunDatabaseMigrationsOnStartup { get; set; } + public List? ApiKeys { get; set; } + public JwtSettings? JwtSettings { get; set; } } -public class RedditConfigModel +public class RedditConfig { public bool IsEnabled { get; set; } public bool PullHot { get; set; } @@ -17,5 +28,29 @@ public class RedditConfigModel public class ConnectionStrings { - public string Database { get; set; } = ""; -} \ No newline at end of file + public string? Database { get; set; } + public string? OpenTelemetry { get; set; } +} + +public class BasicSourceConfig +{ + public bool IsEnabled { get; set; } +} + +public class YoutubeConfig +{ + public bool IsEnabled { get; set; } + public bool Debug { get; set; } +} + +public class TwitchConfig +{ + public bool IsEnabled { get; set; } + public string? ClientId { get; set; } + public string? ClientSecret { get; set; } +} + +public class NotificationsConfig +{ + public BasicSourceConfig? Discord { get; set; } +} diff --git a/Newsbot.Collector.Domain/Models/Config/Sources/ConfigSectionRedditModel.cs b/Newsbot.Collector.Domain/Models/Config/Sources/ConfigSectionRedditModel.cs deleted file mode 100644 index e647630..0000000 --- a/Newsbot.Collector.Domain/Models/Config/Sources/ConfigSectionRedditModel.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Newsbot.Collector.Domain.Models.Config.Sources; - -public class ConfigSectionRedditModel -{ - public bool IsEnabled { get; set; } - public bool PullHot { get; set; } - public bool PullNsfw { get; set; } - public bool PullTop { get; set; } -} \ No newline at end of file