feedsignal/crates/web/src/api/models.rs
Austin Schaefer 7ccc36955a
Some checks failed
CI / check (pull_request) Failing after 1m8s
CI / test (pull_request) Has been skipped
CI / audit (pull_request) Has been skipped
Sweep dto.rs and RelevanceInputs into the models.rs convention
- 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.
2026-09-03 23:24:35 +02:00

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,
}