2023-06-23 20:09:57 -07:00
|
|
|
using Newsbot.Collector.Domain.Entities;
|
2023-02-26 09:40:04 -08:00
|
|
|
using Newsbot.Collector.Domain.Models;
|
|
|
|
|
|
|
|
namespace Newsbot.Collector.Domain.Dto;
|
|
|
|
|
|
|
|
public class ArticleDetailsDto
|
|
|
|
{
|
2023-06-23 20:09:57 -07:00
|
|
|
public Guid Id { get; set; }
|
2023-02-26 09:40:04 -08:00
|
|
|
public string[]? Tags { get; set; }
|
|
|
|
public string? Title { get; set; }
|
|
|
|
public string? Url { get; set; }
|
|
|
|
public DateTime PubDate { get; set; }
|
|
|
|
public string? Video { get; set; }
|
|
|
|
public int VideoHeight { get; set; }
|
|
|
|
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 SourceDto? Source { get; set; }
|
|
|
|
|
2023-06-23 20:09:57 -07:00
|
|
|
public static ArticleDetailsDto Convert(ArticlesEntity article, SourceModel source)
|
2023-02-26 09:40:04 -08:00
|
|
|
{
|
|
|
|
return new ArticleDetailsDto
|
|
|
|
{
|
2023-06-23 20:09:57 -07:00
|
|
|
Id = article.Id,
|
2023-02-26 09:40:04 -08:00
|
|
|
Tags = article.Tags.Split(','),
|
|
|
|
Title = article.Title,
|
2023-06-23 20:09:57 -07:00
|
|
|
Url = article.Url,
|
2023-02-26 09:40:04 -08:00
|
|
|
PubDate = article.PubDate,
|
|
|
|
Video = article.Video,
|
|
|
|
VideoHeight = article.VideoHeight,
|
|
|
|
VideoWidth = article.VideoWidth,
|
|
|
|
Thumbnail = article.Thumbnail,
|
|
|
|
Description = article.Description,
|
|
|
|
AuthorName = article.AuthorName,
|
|
|
|
AuthorImage = article.AuthorImage,
|
|
|
|
Source = SourceDto.Convert(source)
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|