mirror of
https://github.com/YGGverse/rssto.git
synced 2026-03-31 17:15:29 +00:00
implement contents method
This commit is contained in:
parent
9269ec2a9e
commit
4af10ee153
1 changed files with 10 additions and 0 deletions
|
|
@ -93,6 +93,16 @@ impl Mysql {
|
||||||
Ok(self.connection.last_insert_id())
|
Ok(self.connection.last_insert_id())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn contents(&mut self, limit: Option<usize>) -> Result<Vec<Content>, Error> {
|
||||||
|
self.connection.query_map(
|
||||||
|
format!(
|
||||||
|
"SELECT `content_id`, `channel_item_id`, `source_id`, `title`, `description` FROM `content` LIMIT {}",
|
||||||
|
limit.unwrap_or(DEFAULT_LIMIT)
|
||||||
|
),
|
||||||
|
|(content_id, channel_item_id,source_id, title, description)| Content { content_id, channel_item_id, source_id, title, description },
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn contents_by_channel_item_id_source_id(
|
pub fn contents_by_channel_item_id_source_id(
|
||||||
&mut self,
|
&mut self,
|
||||||
channel_item_id: u64,
|
channel_item_id: u64,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue