refactor: reorganize HtmlPageContext and update imports across modules
Some checks failed
CI / Check / Test (push) Failing after 46m33s

This commit is contained in:
2026-06-30 00:07:20 +02:00
parent 9c06fbd33e
commit 943a0abe54
13 changed files with 31 additions and 32 deletions

View File

@@ -1,5 +1,4 @@
use async_trait::async_trait;
use uuid::Uuid;
use domain::errors::DomainError;
use domain::models::DiaryEntry;
@@ -11,24 +10,6 @@ pub trait ReviewLogger: Send + Sync {
async fn log_review(&self, cmd: LogReviewCommand) -> Result<(), DomainError>;
}
pub struct HtmlPageContext {
pub user_email: Option<String>,
pub user_id: Option<Uuid>,
pub is_admin: bool,
pub register_enabled: bool,
pub rss_url: String,
pub page_title: String,
pub canonical_url: String,
pub csrf_token: String,
pub page_rss_url: Option<String>,
}
impl HtmlPageContext {
pub fn is_current_user(&self, id: Uuid) -> bool {
self.user_id == Some(id)
}
}
pub trait RssFeedRenderer: Send + Sync {
fn render_feed(&self, entries: &[DiaryEntry], title: &str) -> Result<String, String>;
}