RSS feed manager in Rust
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
641B

  1. use crate::schema::{rss_feed, rss_item};
  2. #[derive(Identifiable, Queryable, PartialEq, Debug)]
  3. #[table_name = "rss_feed"]
  4. pub struct RSSFeed {
  5. pub id: i32,
  6. pub rss_url: String,
  7. pub url: String,
  8. pub title: String,
  9. pub codename: String,
  10. }
  11. #[derive(Identifiable, Queryable, Associations, PartialEq, Debug)]
  12. #[belongs_to(RSSFeed, foreign_key = "rss_feed_id")]
  13. #[table_name = "rss_item"]
  14. pub struct RSSItem {
  15. pub id: i32,
  16. pub title: String,
  17. pub author: String,
  18. pub url: String,
  19. pub content: String,
  20. pub enclosure_url: Option<String>,
  21. pub enclosure_type: Option<String>,
  22. pub rss_feed_id: i32,
  23. }