feat:添加热榜功能并添加了增加热度的方法。

This commit is contained in:
Leon
2025-12-26 22:49:17 +08:00
parent 14a905e194
commit 328fae5f07
12 changed files with 327 additions and 10 deletions

View File

@@ -1,5 +1,7 @@
package feed
import "time"
type FeedAuthor struct {
ID uint `json:"id"`
Username string `json:"username"`
@@ -56,3 +58,25 @@ type ListByFollowingResponse struct {
NextTime int64 `json:"next_time"`
HasMore bool `json:"has_more"`
}
type ListByPopularityRequest struct {
Limit int `json:"limit"`
AsOf int64 `json:"as_of"` // 服务器返回的分钟时间戳第一页传0
Offset int `json:"offset"` // 下一页从这里开始第一页传0
LatestIDBefore *uint `json:"latest_id_before,omitempty"`
// DB fallback 用(可选)
LatestPopularity int64 `json:"latest_popularity"`
LatestBefore time.Time `json:"latest_before"`
}
type ListByPopularityResponse struct {
VideoList []FeedVideoItem `json:"video_list"`
AsOf int64 `json:"as_of"`
NextOffset int `json:"next_offset"`
HasMore bool `json:"has_more"`
NextLatestPopularity *int64 `json:"next_latest_popularity,omitempty"`
NextLatestBefore *time.Time `json:"next_latest_before,omitempty"`
NextLatestIDBefore *uint `json:"next_latest_id_before,omitempty"`
}