Change get articles to read from database instead of dummy data.
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
pub mod new_feed_item;
|
||||
mod rss_feed_item;
|
||||
pub mod rss_feed_item;
|
||||
|
||||
@@ -1,15 +1,35 @@
|
||||
use crate::models::feed::rss_feed::Feed;
|
||||
use diesel::{Associations, Identifiable, Queryable};
|
||||
|
||||
use crate::schema::feed_item;
|
||||
|
||||
#[derive(Clone, Queryable, Identifiable, Associations)]
|
||||
#[diesel(belongs_to(Feed))]
|
||||
#[diesel(table_name=feed_item)]
|
||||
pub struct Feed {
|
||||
pub struct FeedItem {
|
||||
pub id: i32,
|
||||
pub feed_id: i32,
|
||||
pub title: String,
|
||||
pub url: String,
|
||||
pub content: String,
|
||||
pub read: bool,
|
||||
pub title: String,
|
||||
pub url: String,
|
||||
}
|
||||
|
||||
impl FeedItem {
|
||||
pub fn new(
|
||||
id: i32,
|
||||
feed_id: i32,
|
||||
title: String,
|
||||
url: String,
|
||||
content: String,
|
||||
read: bool,
|
||||
) -> Self {
|
||||
Self {
|
||||
id,
|
||||
feed_id,
|
||||
title,
|
||||
url,
|
||||
content,
|
||||
read,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user