mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
84 lines
2.1 KiB
C#
84 lines
2.1 KiB
C#
|
|
/// This file is a part of RSS Bot for Telegram.
|
||
|
|
/// License: MIT
|
||
|
|
/// Author: CrazyHackGUT aka Kruzya (Sergey Gut) <kruzefag@gmail.com>
|
||
|
|
///
|
||
|
|
|
||
|
|
using System;
|
||
|
|
using System.Collections.Generic;
|
||
|
|
using System.ComponentModel;
|
||
|
|
using System.ComponentModel.DataAnnotations;
|
||
|
|
|
||
|
|
namespace Kruzya.TelegramBot.RichSiteSummary.Data
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// Represents a feed in database.
|
||
|
|
/// </summary>
|
||
|
|
public class Feed : RepresentableEntity
|
||
|
|
{
|
||
|
|
#region RepresentableEntity
|
||
|
|
protected override string ViewableText
|
||
|
|
{
|
||
|
|
get => Title;
|
||
|
|
}
|
||
|
|
|
||
|
|
protected override string ViewableUrl
|
||
|
|
{
|
||
|
|
get => HomePage;
|
||
|
|
}
|
||
|
|
#endregion
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// The unique feed id.
|
||
|
|
/// </summary>
|
||
|
|
[Key]
|
||
|
|
public Guid FeedId { get; set; }
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// The feed URL.
|
||
|
|
/// </summary>
|
||
|
|
[Required]
|
||
|
|
public string Url { get; set; }
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// The home page for this feed.
|
||
|
|
/// </summary>
|
||
|
|
[Required]
|
||
|
|
public string HomePage { get; set; }
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Feed title.
|
||
|
|
/// </summary>
|
||
|
|
[MaxLength(256)]
|
||
|
|
[Required]
|
||
|
|
public string Title { get; set; }
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// DateTime when feed fetched successfully in last time.
|
||
|
|
/// </summary>
|
||
|
|
[Required]
|
||
|
|
public DateTime UpdatedAt { get; set; }
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// This flag indicates, bot should monitor changes in post date, or not.
|
||
|
|
/// </summary>
|
||
|
|
[Required]
|
||
|
|
[DefaultValue(false)]
|
||
|
|
public bool WatchPostDate { get; set; }
|
||
|
|
|
||
|
|
public Feed()
|
||
|
|
{
|
||
|
|
FeedId = new Guid();
|
||
|
|
UpdatedAt = DateTime.Now;
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// All posts from this feed.
|
||
|
|
/// </summary>
|
||
|
|
public virtual ICollection<Post> Posts { get; set; }
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// All exists subscriber for this feed.
|
||
|
|
/// </summary>
|
||
|
|
public virtual ICollection<Subscriber> Subscribers { get; set; }
|
||
|
|
}
|
||
|
|
}
|