added timestamp for feed items

This commit is contained in:
2023-10-24 19:19:47 +02:00
parent ee80cbd53b
commit e4a65416c7
11 changed files with 128 additions and 26 deletions
+6 -3
View File
@@ -1,8 +1,8 @@
use crate::models::feed::rss_feed::Feed;
use diesel::{Associations, Identifiable, Queryable};
use crate::schema::feed_item;
#[derive(Clone, Queryable, Identifiable, Associations)]
use chrono::NaiveDateTime;
use diesel::{Associations, Identifiable, Queryable};
#[derive(Clone, Identifiable, Queryable, Associations)]
#[diesel(belongs_to(Feed))]
#[diesel(table_name=feed_item)]
pub struct FeedItem {
@@ -12,6 +12,7 @@ pub struct FeedItem {
pub read: bool,
pub title: String,
pub url: String,
pub created_ts: Option<NaiveDateTime>,
}
impl FeedItem {
@@ -22,6 +23,7 @@ impl FeedItem {
url: String,
content: String,
read: bool,
created_ts: Option<NaiveDateTime>,
) -> Self {
Self {
id,
@@ -30,6 +32,7 @@ impl FeedItem {
url,
content,
read,
created_ts,
}
}
}