feedsignal/crates/web/src/api/models.rs

24 lines
686 B
Rust
Raw Normal View History

use serde::{Deserialize, Serialize};
/// Article shape sent to the browser — a trimmed view of
/// `feedsignal_core::Article`, kept separate so the wire format can evolve
/// independently of the storage model.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ArticleView {
pub id: String,
pub feed_id: String,
pub title: String,
pub url: String,
pub summary: String,
pub topics: Vec<String>,
pub final_score: Option<f32>,
}
/// Subscribed feed, for the sidebar's feed-navigation list.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct FeedView {
pub id: String,
pub title: String,
pub url: String,
}