✨ feat(api): 新增榜单书架历史与搜索续传并重构正文缓存链路
- 新增 /rank 免签名榜单接口(多域名容错)、/bookshelf 与 /read-history(sessionid 登录态,书架支持分组过滤) - 搜索重写:翻页透传上游 passback/search_id/next_offset/corrected_query 并按 book_id 去重,15~20 位纯数字关键词直查详情(ID 直搜) - 删除 /login/check 登录校验端点(login.go、路由与文档同步移除,sessionid 说明改为直接供书架/历史使用) - 正文链路重构:singleflight 合并同章节并发回源防击穿,缓存与解析解耦统一在出口处理,decodeContentBody 按 crypt_status 分支并兜底 500003 明文 - 缓存层:SQL 持久层 TTL 与业务 TTL 解耦(不可变内容过期后由 SQL 回填),动态短缓存只走 Redis,withCache 合并并发 miss - 密钥池:KeyTs 随正文请求上传降低密钥不匹配重试,密钥超 24 小时异步刷新并防刷新风暴,last_used_at 批量落库 - 签名补 X-Helios(与 X-Ladon 同值,对齐书源实现);设备注册版本号统一走 ClientVersionCode/Name - 分类 landing 透传新版标签 selected_items;multi-detail 批量详情供书架/历史复用 - README 与 openapi.yaml 补充新接口文档
This commit is contained in:
1 parent
8ca372050b
commit
84bd3238ab
28 files changed
+1180
-270
No files matched your search
@@ -710,6 +710,10 @@ paths:
|
||||
in: query
|
||||
description: 排序方式,透传上游(0=默认)
|
||||
schema: { type: integer, default: 0 }
|
||||
- name: selected_items
|
||||
in: query
|
||||
description: 新版分类标签自带筛选项(从 /category-front 返回的 category_landpage_url 参数中获取),透传上游
|
||||
schema: { type: string }
|
||||
responses:
|
||||
"200":
|
||||
description: 分类书籍列表(上游转发)
|
||||
@@ -721,6 +725,85 @@ paths:
|
||||
$ref: "#/components/responses/BadRequest"
|
||||
"500":
|
||||
$ref: "#/components/responses/ServerError"
|
||||
/rank:
|
||||
get:
|
||||
tags: [榜单与个人数据]
|
||||
summary: 获取书籍榜单
|
||||
description: 免签名接口,支持五种榜单,每页 20 本,短缓存 10 分钟。
|
||||
operationId: getRank
|
||||
parameters:
|
||||
- name: side_type
|
||||
in: query
|
||||
description: 榜单类型
|
||||
schema:
|
||||
type: integer
|
||||
default: 10
|
||||
enum: [10, 11, 12, 13, 15]
|
||||
x-enum-varnames: [推荐榜, 完结榜, 热搜榜, 黑马榜, 爆更榜]
|
||||
- name: page
|
||||
in: query
|
||||
description: 页码,从 1 起
|
||||
schema: { type: integer, default: 1, minimum: 1 }
|
||||
responses:
|
||||
"200":
|
||||
description: 榜单书籍列表(上游转发,data.result 为书籍数组)
|
||||
content:
|
||||
application/json:
|
||||
schema: { $ref: "#/components/schemas/UpstreamResponse" }
|
||||
"500":
|
||||
$ref: "#/components/responses/ServerError"
|
||||
/bookshelf:
|
||||
get:
|
||||
tags: [榜单与个人数据]
|
||||
summary: 获取我的书架
|
||||
description: 需要番茄网页版登录态;每本书合并详情数据并附带 group_name。个人动态数据不缓存。
|
||||
operationId: getBookshelf
|
||||
parameters:
|
||||
- name: sessionid
|
||||
in: query
|
||||
required: true
|
||||
description: 番茄网页版(fanqienovel.com)登录后的 Cookie sessionid
|
||||
schema: { type: string }
|
||||
- name: group
|
||||
in: query
|
||||
description: 按分组过滤,为空返回全部
|
||||
schema: { type: string }
|
||||
responses:
|
||||
"200":
|
||||
description: 书架书籍列表(data 为数组,每项含书籍详情 + group_name)
|
||||
content:
|
||||
application/json:
|
||||
schema: { $ref: "#/components/schemas/UpstreamResponse" }
|
||||
"400":
|
||||
$ref: "#/components/responses/BadRequest"
|
||||
"500":
|
||||
$ref: "#/components/responses/ServerError"
|
||||
/read-history:
|
||||
get:
|
||||
tags: [榜单与个人数据]
|
||||
summary: 获取阅读历史
|
||||
description: 需要番茄网页版登录态;每页 20 条,每项合并书籍详情并保留原始记录(含阅读进度)于 history 字段。个人动态数据不缓存。
|
||||
operationId: getReadHistory
|
||||
parameters:
|
||||
- name: sessionid
|
||||
in: query
|
||||
required: true
|
||||
description: 番茄网页版(fanqienovel.com)登录后的 Cookie sessionid
|
||||
schema: { type: string }
|
||||
- name: offset
|
||||
in: query
|
||||
description: 偏移量,默认 0,每页 20 条
|
||||
schema: { type: integer, default: 0, minimum: 0 }
|
||||
responses:
|
||||
"200":
|
||||
description: 阅读历史列表(data 为数组)
|
||||
content:
|
||||
application/json:
|
||||
schema: { $ref: "#/components/schemas/UpstreamResponse" }
|
||||
"400":
|
||||
$ref: "#/components/responses/BadRequest"
|
||||
"500":
|
||||
$ref: "#/components/responses/ServerError"
|
||||
/emoji/{file}:
|
||||
get:
|
||||
tags: [静态资源]
|
||||
|
||||
Reference in new issue
Block a user