@@ -0,0 +1,53 @@
|
||||
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),
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user