Expand description
文章详情查询接口。
提供按 id(管理员)与按 slug(公开)两种方式获取文章,
其中按 slug 查询包含上下篇导航并启用缓存。
Leptos server function,注册在 /api 路径下。
仅在 feature = "server" 启用的服务端构建中查询数据库。
Structs§
- GetPost
ById - Serialized arguments for the
get_post_by_idserver function. - GetPost
BySlug - Serialized arguments for the
get_post_by_slugserver function. - GetPost
Preview - Serialized arguments for the
get_post_previewserver function. - GetPublic
Post BySlug - Serialized arguments for the
get_public_post_by_slugserver function.
Functions§
- get_
post_ by_ id - 根据文章 id 获取详情。
- get_
post_ by_ slug - 根据 slug 获取公开文章详情。
- get_
post_ preview - 管理员按 slug 预览文章(含草稿),不缓存、不带上下篇导航。
- get_
public_ post_ by_ slug - 阅读页使用独立协议,避免新部署破坏已打开页面的旧客户端。