- crates/web/src/api/dto.rs -> api/models.rs (ArticleView/FeedView were already models-shaped content, just not named models.rs) - crates/core/src/scoring.rs's RelevanceInputs moves into crates/core/src/models.rs alongside the other core domain types, since it's built by score_article's callers, not score_article itself Also picks up an unrelated fmt fix in db/src/articles.rs (import ordering) that landed on disk from elsewhere.
23 lines
686 B
Rust
23 lines
686 B
Rust
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,
|
|
}
|