diff --git a/Newsbot.Collector.Domain/Dto/ArticleDetailsDto.cs b/Newsbot.Collector.Domain/Dto/ArticleDetailsDto.cs index ca1fb6d..9813288 100644 --- a/Newsbot.Collector.Domain/Dto/ArticleDetailsDto.cs +++ b/Newsbot.Collector.Domain/Dto/ArticleDetailsDto.cs @@ -19,8 +19,9 @@ public class ArticleDetailsDto public string? AuthorImage { get; set; } public SourceDto? Source { get; set; } + public AuthorEntity? Author { get; set; } - public static ArticleDetailsDto Convert(ArticlesEntity article, SourceEntity source) + public static ArticleDetailsDto Convert(ArticlesEntity article, SourceEntity source, AuthorEntity? author) { return new ArticleDetailsDto { @@ -34,9 +35,8 @@ public class ArticleDetailsDto VideoWidth = article.VideoWidth, Thumbnail = article.Thumbnail, Description = article.Description, - AuthorName = article.AuthorName, - AuthorImage = article.AuthorImage, - Source = SourceDto.Convert(source) + Source = SourceDto.Convert(source), + }; } } diff --git a/Newsbot.Collector.Domain/Dto/ArticleDto.cs b/Newsbot.Collector.Domain/Dto/ArticleDto.cs index 7a55872..dbd27d1 100644 --- a/Newsbot.Collector.Domain/Dto/ArticleDto.cs +++ b/Newsbot.Collector.Domain/Dto/ArticleDto.cs @@ -7,6 +7,7 @@ public class ArticleDto { public Guid ID { get; set; } public Guid SourceID { get; set; } + public Guid AuthorId { get; set; } public string[]? Tags { get; set; } public string? Title { get; set; } public string? Url { get; set; } @@ -16,8 +17,6 @@ public class ArticleDto public int VideoWidth { get; set; } public string? Thumbnail { get; set; } public string? Description { get; set; } - public string? AuthorName { get; set; } - public string? AuthorImage { get; set; } public static ArticleDto Convert(ArticlesModel article) { return new ArticleDto @@ -33,8 +32,6 @@ public class ArticleDto VideoWidth = article.VideoWidth, Thumbnail = article.Thumbnail, Description = article.Description, - AuthorName = article.AuthorName, - AuthorImage = article.AuthorImage, }; } @@ -44,6 +41,7 @@ public class ArticleDto { ID = article.Id, SourceID = article.SourceId, + AuthorId = article.AuthorId, Tags = article.Tags.Split(','), Title = article.Title, Url = article.Url, @@ -52,9 +50,7 @@ public class ArticleDto VideoHeight = article.VideoHeight, VideoWidth = article.VideoWidth, Thumbnail = article.Thumbnail, - Description = article.Description, - AuthorName = article.AuthorName, - AuthorImage = article.AuthorImage, + Description = article.Description }; } } \ No newline at end of file diff --git a/Newsbot.Collector.Domain/Dto/AuthorDto.cs b/Newsbot.Collector.Domain/Dto/AuthorDto.cs new file mode 100644 index 0000000..b56090b --- /dev/null +++ b/Newsbot.Collector.Domain/Dto/AuthorDto.cs @@ -0,0 +1,9 @@ +namespace Newsbot.Collector.Domain.Dto; + +public class AuthorDto +{ + 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