Refactor blog module and remove blog-related functionality

- Removed blog router and associated API endpoints.
- Deleted blog persistence functions and related query parameters.
- Removed blog schemas and models from the codebase.
- Introduced common crate for shared types, including DateTimeWithTimeZoneWrapper.
- Added Thought and Follow models with corresponding migrations.
- Updated dependencies in Cargo.toml files to reflect changes.
- Adjusted tests to remove references to the blog module.
This commit is contained in:
2025-09-05 18:10:58 +02:00
parent e5747eaaf3
commit 912259ef54
32 changed files with 543 additions and 333 deletions

View File

@@ -0,0 +1,36 @@
use crate::domains::thought;
use common::DateTimeWithTimeZoneWrapper;
use serde::Serialize;
use utoipa::ToSchema;
#[derive(Serialize, ToSchema)]
pub struct ThoughtSchema {
pub id: i32,
pub author_id: i32,
pub content: String,
pub created_at: DateTimeWithTimeZoneWrapper,
}
impl From<thought::Model> for ThoughtSchema {
fn from(model: thought::Model) -> Self {
Self {
id: model.id,
author_id: model.author_id,
content: model.content,
created_at: model.created_at.into(),
}
}
}
#[derive(Serialize, ToSchema)]
pub struct ThoughtListSchema {
pub thoughts: Vec<ThoughtSchema>,
}
impl From<Vec<thought::Model>> for ThoughtListSchema {
fn from(models: Vec<thought::Model>) -> Self {
Self {
thoughts: models.into_iter().map(ThoughtSchema::from).collect(),
}
}
}