Files
web_huangguo2_h5/app/api/web/popularRecommend.go
T
谢宇宁andClaude Opus 5.5 0fbdba5ccf Initial commit
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 11:47:47 +07:00

54 lines
1.4 KiB
Go

package web
import (
"fmt"
"videoweb/app/service/playletser"
"github.com/gin-gonic/gin"
)
// PopularRecommend 热播榜页:GET /api/app/playlet/hot/rank/list。
// 文档:http://172.104.181.99:25319/swagger/index.html#/app短剧相关接口/get_api_app_playlet_hot_rank_list
func PopularRecommend(c *gin.Context) {
q := playletser.ParseHotRankQuery(c)
raw := playletser.FetchHotRankListOrEmpty(c, q)
tabTitle := playletser.HotRankTabTitle(q.RankType)
title := tabTitle + " - 黄果短剧"
if raw != nil && raw.SeoInfo.Title != "" {
title = raw.SeoInfo.Title
}
list := []playletser.CommonData(nil)
total := int64(0)
pageNum, pageSize := q.PageNum, q.PageSize
var seo playletser.SeoInfo
if raw != nil {
list = raw.List
total = raw.TotalCount
seo = raw.SeoInfo
if raw.PageNum > 0 {
pageNum = raw.PageNum
}
if raw.PageSize > 0 {
pageSize = raw.PageSize
}
}
HTMLOK(c, "popularRecommend.html", gin.H{
"title": title,
"navActive": "popular",
"seoInfo": seo,
"seoSelections": rankingSEOSelections(tabTitle),
"list": list,
"totalCount": total,
"pageNum": pageNum,
"pageSize": pageSize,
"rankType": q.RankType,
"tabTitle": tabTitle,
"rankTabs": playletser.BuildHotRankTabs(q),
"listCount": fmt.Sprintf("共 %d 部", total),
"pagination": playletser.BuildHotRankPagination(q, total),
"canonicalPath": playletser.HotRankCanonicalPath(q),
})
}