refactor(feed): 删除热榜响应里从未赋值的游标字段

`ListByPopularityResponse` 里的 `next_latest_*` 三个字段全仓从未被赋值。
它们只在结构体上声明,`omitempty` 下 JSON 里根本不会出现。
删掉后响应只剩 `as_of` / `next_offset` / `ranking_source` / `snapshot_rebuilt` 四个快照字段。
`frontend/src/api/types.ts` 保留废弃声明,因此非浏览器客户端仍可解码。

验证:go build ./... 与 go vet ./... 通过。go test -count=1 ./internal/feed/ ./internal/http/ 全绿。
This commit is contained in:
2026-11-01 15:40:00 +08:00
parent 0fcbf3ae00
commit a0bd798d8a

View File

@@ -1,7 +1,5 @@
package feed
import "time"
type FeedAuthor struct {
ID uint `json:"id"`
Username string `json:"username"`
@@ -79,10 +77,4 @@ type ListByPopularityResponse struct {
// SnapshotRebuilt 为 true 表示服务端刚重建过快照(原来的过期或被驱逐),
// 这一页可能与上一页重叠:客户端应当从 offset 0 重来。
SnapshotRebuilt bool `json:"snapshot_rebuilt"`
// Deprecated: 旧版用 DB 的 (popularity, create_time, id) 游标继续翻页。
// 那套游标与 ZSET 的排名无关(N7),服务端已不再读取,字段仅为兼容保留。
NextLatestPopularity *int64 `json:"next_latest_popularity,omitempty"`
NextLatestBefore *time.Time `json:"next_latest_before,omitempty"`
NextLatestIDBefore *uint `json:"next_latest_id_before,omitempty"`
}