Expand description
文章列表查询接口。
提供已发布文章分页、管理员全量列表、以及按标签筛选三种查询能力,
均通过缓存层减少重复数据库访问。
Leptos server function,注册在 /api 路径下。
仅在 feature = "server" 启用的服务端构建中查询数据库。
Structs§
- GetPosts
ByTag - Serialized arguments for the
get_posts_by_tagserver function. - List
Deleted Posts - Serialized arguments for the
list_deleted_postsserver function. - List
Posts - Serialized arguments for the
list_postsserver function. - List
Published Posts - Serialized arguments for the
list_published_postsserver function.
Constants§
- MAX_
PAGE 🔒 - 允许的最大页码。
- MAX_
PER_ 🔒PAGE - 单页允许的最大文章数。
Functions§
- clamp_
pagination 🔒 - 将分页参数钳制到安全范围:页码 1–
MAX_PAGE,每页 1–MAX_PER_PAGE。 - get_
posts_ by_ tag - 获取指定标签下的全部已发布文章(上限 200),用于无分页 UI 的标签详情页。 结果缓存于按标签的键空间。
- list_
deleted_ posts - 获取回收站中已软删除的文章列表。
- list_
posts - 获取后台文章列表(含草稿,不含回收站),按创建时间倒序。
- list_
published_ posts - 获取已发布文章分页列表。