- 删除 src/hooks/delayed_loading.rs:未在 hooks/mod.rs 注册,已被
DelayedSkeleton 组件取代(mod.rs 注释已说明)
- 删除 src/components/ui.rs 的 EmptyState:零调用者,所有实际用法
都走功能更全的 components/empty_state.rs::EmptyState
- 删除 api/posts/mod.rs 末尾的 render_markdown_enhanced / slug 工具
re-export:调用方均使用完整路径 crate::api::{markdown,slug}::*,
这两个跨模块短路径无引用
- 删除 api/comments/mod.rs 的 render_comment_markdown re-export:
调用方用完整路径 crate::api::comments::markdown::render_comment_markdown
保留 auth.rs::invalidate_user_sessions:有完整文档说明的预留基础设施
(角色变更/封禁场景),非遗留垃圾。
57 lines
1.7 KiB
Rust
57 lines
1.7 KiB
Rust
//! 文章模块:提供文章的 CRUD、列表、搜索、标签聚合与统计等 server function。
|
|
//!
|
|
//! 所有 Dioxus server function 均注册在 `/api` 路径下,供前端与服务端调用。
|
|
//! 仅在 `feature = "server"` 启用的服务端构建中执行数据库操作与缓存失效。
|
|
|
|
#![allow(clippy::unused_unit, deprecated)]
|
|
|
|
mod create;
|
|
mod delete;
|
|
mod helpers;
|
|
mod list;
|
|
mod read;
|
|
mod rebuild;
|
|
mod search;
|
|
mod stats;
|
|
mod tags;
|
|
mod trash;
|
|
mod types;
|
|
mod update;
|
|
|
|
/// 创建新文章。
|
|
#[allow(unused_imports)]
|
|
pub use create::create_post;
|
|
/// 删除指定文章。
|
|
pub use delete::delete_post;
|
|
/// 获取回收站中已软删除的文章列表。
|
|
#[allow(unused_imports)]
|
|
pub use list::list_deleted_posts;
|
|
/// 获取管理员视角的全部文章分页列表。
|
|
#[allow(unused_imports)]
|
|
pub use list::list_posts;
|
|
/// 获取已发布文章分页列表。
|
|
pub use list::{get_posts_by_tag, list_published_posts};
|
|
/// 根据 id 获取文章详情。
|
|
#[allow(unused_imports)]
|
|
pub use read::{get_post_by_id, get_post_by_slug};
|
|
/// 重新渲染文章的 Markdown HTML 与目录。
|
|
pub use rebuild::rebuild_content_html;
|
|
/// 重新渲染指定文章的 Markdown HTML 与目录(单篇)。
|
|
pub use rebuild::rebuild_post_content_html;
|
|
/// 全文搜索已发布文章。
|
|
pub use search::search_posts;
|
|
/// 获取文章统计信息。
|
|
#[allow(unused_imports)]
|
|
pub use stats::get_post_stats;
|
|
/// 获取全部标签及其文章数量。
|
|
pub use tags::list_tags;
|
|
/// 恢复已删除文章。
|
|
#[allow(unused_imports)]
|
|
pub use trash::{batch_purge_posts, batch_restore_posts, empty_trash, purge_post, restore_post};
|
|
/// 文章 API 的请求与响应数据结构。
|
|
pub use types::*;
|
|
/// 更新指定文章。
|
|
#[allow(unused_imports)]
|
|
pub use update::update_post;
|
|
|