@@ -0,0 +1,53 @@
|
||||
package web
|
||||
|
||||
import (
|
||||
"videoweb/app/service/playletser"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// Rank 排行榜页:GET /api/app/playlet/rank。
|
||||
// 文档:http://172.104.181.99:25319/swagger/index.html#/app短剧相关接口/get_api_app_playlet_rank
|
||||
func Rank(c *gin.Context) {
|
||||
q := playletser.ParseRankQuery(c)
|
||||
raw := playletser.FetchRankOrEmpty(c, q)
|
||||
tabTitle := playletser.RankTabTitle(q.SortOrder)
|
||||
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, "rank.html", gin.H{
|
||||
"title": title,
|
||||
"navActive": "rank",
|
||||
"seoInfo": seo,
|
||||
"seoSelections": rankingSEOSelections(tabTitle),
|
||||
"list": list,
|
||||
"totalCount": total,
|
||||
"pageNum": pageNum,
|
||||
"pageSize": pageSize,
|
||||
"sortOrder": q.SortOrder,
|
||||
"tabTitle": tabTitle,
|
||||
"rankTabs": playletser.BuildRankTabs(q),
|
||||
"rankOffset": playletser.RankOffset(q),
|
||||
"isBinge": playletser.IsRankBinge(q.SortOrder),
|
||||
"pagination": playletser.BuildRankPagination(q, total),
|
||||
"canonicalPath": playletser.RankCanonicalPath(q),
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user