From 6a473aea3eb567d99d5f9200eadd0422db02a206 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E6=AD=86?= <2685475410@qq.com> Date: Fri, 9 Oct 2026 15:12:36 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(build):=20=E8=A1=A5=E4=BA=A4?= =?UTF-8?q?=E8=A2=AB=E8=AF=AF=E5=BF=BD=E7=95=A5=E7=9A=84=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20Linux=20=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 .gitignore 的 *.html 规则收窄为 cover.html,不再误忽略源码模板 - 补交 internal/handlers/templates/review.html 与 status.html,此前未入库导致 Linux 上 go build 报 go:embed no matching files --- .gitignore | 2 +- internal/handlers/templates/review.html | 775 ++++++++++++++++++++++++ internal/handlers/templates/status.html | 757 +++++++++++++++++++++++ 3 files changed, 1533 insertions(+), 1 deletion(-) create mode 100644 internal/handlers/templates/review.html create mode 100644 internal/handlers/templates/status.html diff --git a/.gitignore b/.gitignore index 71ca7e2..db55d4c 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,7 @@ pkg/ *.out # Output of the go coverage tool -*.html +cover.html _coverage/ # Go workspace file diff --git a/internal/handlers/templates/review.html b/internal/handlers/templates/review.html new file mode 100644 index 0000000..fbe04da --- /dev/null +++ b/internal/handlers/templates/review.html @@ -0,0 +1,775 @@ + + + + + + 番茄段评 · 第 {{.ParaPlus1}} 段 + + + + + +
+

段落评论 · {{.Total}} 条

+ + + +
+
最热
+
最新
+
+
+
+{{if not .Comments}}
暂无评论
{{else}}{{range $i, $c := .Comments}}
+ +
{{$c.CommentTextHTML}}
+{{if $c.ImageURL}} 评论图片 +{{end}}
{{$c.CreateTime}}
+
+ {{$c.DiggCount}} + {{$c.ReplyCount}} +
+
+
+{{end}}{{end}}{{if and (not .HasMore) .Comments}} +
没有更多评论了
{{end}} +
+ +
+ × + 图片预览 +
+ +
+ +
+ + + diff --git a/internal/handlers/templates/status.html b/internal/handlers/templates/status.html new file mode 100644 index 0000000..4472675 --- /dev/null +++ b/internal/handlers/templates/status.html @@ -0,0 +1,757 @@ + + + + + 番茄小说API - 运行状态 + + + + +
+
+

番茄小说API

+

运行状态监控面板

+
+ +
+
+
● 运行状态
+
+ 服务器时间 + {{.NowTime}} +
+
+ 运行时长 + {{.Uptime}} +
+
+ 启动时间 + {{.StartTime}} +
+
+ 签名方法 + {{.Signature}} +
+
+ 数据库大小 + {{.DBTotal}} +
+
+ 已用空间 + {{.DBUsed}} +
+
+ 空闲空间 + {{.DBFree}} 立即压缩 +
+
+ +
+
◉ 设备密钥池
+
+ 池状态 + {{.PoolStatus}} +
+
+ 总设备数 + {{.PoolTotal}} +
+
+ 有效设备 + {{.PoolValid}} 可用 +
+
+ 无效设备 + {{.PoolInvalid}} +
+
+ 当前索引 + {{.PoolIndex}} +
+
+ +
+
■ 请求统计
+
+ 总请求数 + {{.StatTotal}} +
+
+ 搜索请求 + {{.StatSearch}} +
+
+ 详情请求 + {{.StatDetail}} +
+
+ 目录请求 + {{.StatCatalog}} +
+
+ 内容请求 + {{.StatContent}} +
+
+ 漫画请求 + {{.StatManga}} +
+
+ 音频请求 + {{.StatAudio}} +
+
+ 视频请求 + {{.StatVideo}} +
+
+ 分类请求 + {{.StatCategory}} +
+
+ +
+
◆ 缓存统计
+
+ 正文缓存数 + {{.CacheCount}} +
+
+ 正文缓存 + {{.CacheStatus}} +
+
+ 自动清理 + {{.CleanupStatus}} +
+
+ 清理间隔 + {{.CleanupInterval}} +
+
+
+ +
+
◈ API 接口文档
+ + +
+
书籍相关
+ +
+
GET/search
+
◆ 搜索书籍
+
+
+ query + 必需 + 搜索关键字 +
+
+ offset + 可选 + 偏移量,默认0 +
+
+ tab_type + 可选 + 类型,默认3 +
+
+
+ +
+
GET/detail
+
◆ 获取书籍详情
+
+
+ book_id + 必需 + 书籍ID +
+
+
+ +
+
GET/catalog
+
◆ 获取书籍目录
+
+
+ book_id + 必需 + 书籍ID +
+
+
+ +
+
GET/multi-detail
+
◆ 批量获取书籍详情
+
+
+ book_id + 必需 + 书籍ID列表,逗号分隔 +
+
+
+
+ + +
+
内容相关
+ +
+
GET/content
+
◆ 获取章节正文内容
+
+
+ item_id + 必需 + 章节ID,支持路径参数或查询参数 +
+
+ text_mode + 可选 + 纯文本模式:1/true=纯文本,0/false=HTML +
+
+ image_mode + 可选 + 图片处理:1/true=保留图片,0/false=移除图片 +
+
+ review + 可选 + 段评功能:1=启用,0=禁用 +
+
+
+ +
+
GET/multi-content
+
◆ 批量获取多个章节正文
+
+
+ book_id + 必需 + 书籍ID +
+
+ item_ids + 必需 + 章节ID列表,多个ID用逗号分隔,如:123,456,789 +
+
+ text_mode + 可选 + 纯文本模式:1/true=纯文本,0/false=HTML +
+
+ image_mode + 可选 + 图片处理:1/true=保留图片,0/false=移除图片 +
+
+ ignore_failed + 可选 + 忽略失败章节:1/true=忽略,0/false=不忽略 +
+
+
+ +
+
GET/item-summary
+
◆ 获取章节摘要信息
+
+
+ book_id + 必需 + 书籍ID +
+
+ item_ids + 必需 + 章节ID列表,逗号分隔 +
+
+
+
+ + +
+
段评相关
+ +
+
GET/review
+
◆ 获取段落评论、回复
+
+
+ item_id + 必需 + 章节ID +
+
+ book_id + 必需 + 书籍ID +
+
+ para + 必需 + 段落索引(从0开始) +
+
+ comment_id + 可选 + 评论ID(获取回复时需要) +
+
+
+ +
+
GET/review_html
+
◆ 获取段落评论HTML页面
+
+
+ item_id + 必需 + 章节ID +
+
+ book_id + 必需 + 书籍ID +
+
+ para + 必需 + 段落索引(从0开始) +
+
+
+
+ + +
+
多媒体
+ +
+
GET/manga
+
◆ 获取漫画内容
+
+
+ item_ids + 必需 + 章节ID +
+
+ output + 可选 + 输出格式:url/proxy/data_uri,默认url +
+
+
+ +
+
GET/audio
+
◆ 获取音频信息
+
+
+ item_ids + 必需 + 章节ID +
+
+ tone_id + 可选 + 音色ID,默认1 +
+
+
+ +
+
GET/video
+
◆ 获取视频信息
+
+
+ item_ids + 必需 + 章节ID +
+
+
+
+ + +
+
分类
+ +
+
GET/category-front
+
◆ 获取分类首页
+
+
+ tab + 可选 + 标签页,默认0 +
+
+
+ +
+
GET/category-landing
+
◆ 获取分类详情页
+
+
+ category_id + 必需 + 分类ID +
+
+ offset + 可选 + 偏移量,默认0 +
+
+ limit + 可选 + 每页数量,默认20 +
+
+
+
+ + +
+
系统
+ +
+
GET/status
+
◆ 系统状态页面(当前页面)
+
+ +
+
GET/self-info
+
◆ 设备信息(包含敏感数据)
+
+
+
+
+ +