From 5379ec3e90b6cea178eb9554a03c94ff1bede676 Mon Sep 17 00:00:00 2001 From: bourdon Date: Sat, 4 Oct 2025 11:48:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9Awebapp=20=E7=BF=BB?= =?UTF-8?q?=E9=A1=B5=E9=80=BB=E8=BE=91=E5=92=8C=E7=BC=96=E8=AF=91=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 前端改进: - 添加 direction 追踪翻页方向(forward/backward) - 使用 startIndex/endIndex 追踪当前显示范围 - topics 列表自动排序 - 移除 currentCenterIndex,改用更清晰的边界索引 后端改进: - 支持 direction 参数控制查询方向 - backward:从 startIndex 向前查询(更早的记录) - forward:从 endIndex 向后查询(更新的记录) - 修复 QueryNewest/QueryOldest 返回值处理 - 正确计算 startRecordIndex(基于查询结果) 修复编译错误: - example/index/main.go:修正 QueryNewest/QueryOldest 返回值数量 - example/webapp/main.go:修正变量重复定义和未定义错误 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- example/webapp/main.go | 148 ++++++++++++++++++++--------------------- 1 file changed, 71 insertions(+), 77 deletions(-) diff --git a/example/webapp/main.go b/example/webapp/main.go index 035f095..a967912 100644 --- a/example/webapp/main.go +++ b/example/webapp/main.go @@ -348,6 +348,9 @@ func handleIndex(w http.ResponseWriter, r *http.Request) {