From 79c4da89e4da7b195a8bf4f0ab34e59b348ffe38 Mon Sep 17 00:00:00 2001 From: James Tombleson Date: Mon, 19 Jun 2023 15:38:17 -0700 Subject: [PATCH] Entities have been made to isolate db models --- .../Entities/ArticlesEntity.cs | 20 +++++++++++++++++++ .../Entities/AuthorEntity.cs | 9 +++++++++ .../Entities/DiscordQueueEntity.cs | 7 +++++++ .../Entities/DiscordWebhookEntity.cs | 10 ++++++++++ .../Entities/IconEntity.cs | 10 ++++++++++ .../Entities/SourceEntity.cs | 18 +++++++++++++++++ .../Entities/SubscriptionEntity.cs | 11 ++++++++++ 7 files changed, 85 insertions(+) create mode 100644 Newsbot.Collector.Domain/Entities/ArticlesEntity.cs create mode 100644 Newsbot.Collector.Domain/Entities/AuthorEntity.cs create mode 100644 Newsbot.Collector.Domain/Entities/DiscordQueueEntity.cs create mode 100644 Newsbot.Collector.Domain/Entities/DiscordWebhookEntity.cs create mode 100644 Newsbot.Collector.Domain/Entities/IconEntity.cs create mode 100644 Newsbot.Collector.Domain/Entities/SourceEntity.cs create mode 100644 Newsbot.Collector.Domain/Entities/SubscriptionEntity.cs diff --git a/Newsbot.Collector.Domain/Entities/ArticlesEntity.cs b/Newsbot.Collector.Domain/Entities/ArticlesEntity.cs new file mode 100644 index 0000000..626e2c1 --- /dev/null +++ b/Newsbot.Collector.Domain/Entities/ArticlesEntity.cs @@ -0,0 +1,20 @@ +namespace Newsbot.Collector.Domain.Entities; + +public class ArticlesEntity +{ + public Guid Id { get; set; } + public Guid SourceId { get; set; } + public string Tags { get; set; } = ""; + public string Title { get; set; } = ""; + public string? Url { get; set; } + public DateTime PubDate { get; set; } = DateTime.Now; + public string Video { get; set; } = ""; + public int VideoHeight { get; set; } = 0; + public int VideoWidth { get; set; } = 0; + public string Thumbnail { get; set; } = ""; + public string Description { get; set; } = ""; + public string AuthorName { get; set; } = ""; + public string? AuthorImage { get; set; } + public bool CodeIsRelease { get; set; } + public bool CodeIsCommit { get; set; } +} \ No newline at end of file diff --git a/Newsbot.Collector.Domain/Entities/AuthorEntity.cs b/Newsbot.Collector.Domain/Entities/AuthorEntity.cs new file mode 100644 index 0000000..36d06a8 --- /dev/null +++ b/Newsbot.Collector.Domain/Entities/AuthorEntity.cs @@ -0,0 +1,9 @@ +namespace Newsbot.Collector.Domain.Entities; + +public class AuthorEntity +{ + public Guid Id { get; set; } + public Guid SourceId { get; set; } + public string Name { get; set; } = ""; + public string Image { get; set; } = ""; +} \ No newline at end of file diff --git a/Newsbot.Collector.Domain/Entities/DiscordQueueEntity.cs b/Newsbot.Collector.Domain/Entities/DiscordQueueEntity.cs new file mode 100644 index 0000000..9e29842 --- /dev/null +++ b/Newsbot.Collector.Domain/Entities/DiscordQueueEntity.cs @@ -0,0 +1,7 @@ +namespace Newsbot.Collector.Domain.Entities; + +public class DiscordQueueEntity +{ + public Guid Id { get; set; } + public Guid ArticleId { get; set; } +} \ No newline at end of file diff --git a/Newsbot.Collector.Domain/Entities/DiscordWebhookEntity.cs b/Newsbot.Collector.Domain/Entities/DiscordWebhookEntity.cs new file mode 100644 index 0000000..7e7ec40 --- /dev/null +++ b/Newsbot.Collector.Domain/Entities/DiscordWebhookEntity.cs @@ -0,0 +1,10 @@ +namespace Newsbot.Collector.Domain.Entities; + +public class DiscordWebhookEntity +{ + public Guid Id { get; set; } + public string Url { get; set; } = ""; + public string Server { get; set; } = ""; + public string Channel { get; set; } = ""; + public bool Enabled { get; set; } +} \ No newline at end of file diff --git a/Newsbot.Collector.Domain/Entities/IconEntity.cs b/Newsbot.Collector.Domain/Entities/IconEntity.cs new file mode 100644 index 0000000..c4f17b6 --- /dev/null +++ b/Newsbot.Collector.Domain/Entities/IconEntity.cs @@ -0,0 +1,10 @@ +namespace Newsbot.Collector.Domain.Entities; + +public class IconEntity +{ + public Guid Id { get; set; } + public string FileName { get; set; } = ""; + public string Site { get; set; } = ""; + + public Guid SourceId { get; set; } +} \ No newline at end of file diff --git a/Newsbot.Collector.Domain/Entities/SourceEntity.cs b/Newsbot.Collector.Domain/Entities/SourceEntity.cs new file mode 100644 index 0000000..e7bc247 --- /dev/null +++ b/Newsbot.Collector.Domain/Entities/SourceEntity.cs @@ -0,0 +1,18 @@ +namespace Newsbot.Collector.Domain.Entities; + +public class SourceEntity +{ + public Guid Id { get; set; } + public string Site { get; set; } = ""; + public string Name { get; set; } = ""; + + // Source use to define the worker to query with but moving to Type as it was not used really. + public string Source { get; set; } = ""; + public string Type { get; set; } = ""; + public string Value { get; set; } = ""; + public bool Enabled { get; set; } + public string Url { get; set; } = ""; + public string Tags { get; set; } = ""; + public bool Deleted { get; set; } + public string YoutubeId { get; set; } = ""; +} \ No newline at end of file diff --git a/Newsbot.Collector.Domain/Entities/SubscriptionEntity.cs b/Newsbot.Collector.Domain/Entities/SubscriptionEntity.cs new file mode 100644 index 0000000..ae405ed --- /dev/null +++ b/Newsbot.Collector.Domain/Entities/SubscriptionEntity.cs @@ -0,0 +1,11 @@ +namespace Newsbot.Collector.Domain.Entities; + +public class SubscriptionEntity +{ + public Guid Id { get; set; } + public bool CodeAllowReleases { get; set; } + public bool CodeAllowCommits { get; set; } + + public Guid SourceId { get; set; } + public Guid DiscordWebHookId { get; set; } +} \ No newline at end of file