Initial commit
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package web
|
||||
|
||||
import (
|
||||
"videoweb/app/service/playletser"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// ThemeIndex 专题列表页:专题数据来自 GET /api/app/theme/list?themeType=2。
|
||||
func ThemeIndex(c *gin.Context) {
|
||||
q := playletser.ParseThemeIndexQuery(c.Param("page"))
|
||||
if redirectCanonical(c, playletser.ThemeIndexCanonicalPath(q)) {
|
||||
return
|
||||
}
|
||||
themes := playletser.FetchThemesOrEmpty(c, 2)
|
||||
list, totalCount := playletser.BuildThemeIndexPage(themes, q)
|
||||
if playletser.PageOutOfRange(q.PageNum, q.PageSize, totalCount) {
|
||||
NotFound(c, "页面不存在")
|
||||
return
|
||||
}
|
||||
|
||||
data := gin.H{
|
||||
"title": "AI成人短剧专题推荐" + playletser.PageTitleSuffix(q.PageNum),
|
||||
"description": "专题集中展示黄果短剧各类精品专题合集,涵盖AI成人短剧、AI色情短剧、擦边短剧、AI换脸、AI魔改等热门主题。内容丰富多样,每日持续更新。",
|
||||
"pageKey": "theme_index",
|
||||
"pageName": "专题",
|
||||
"navActive": "topic",
|
||||
"pageNum": q.PageNum,
|
||||
"pagePath": playletser.ThemeIndexCanonicalPath(q),
|
||||
"list": list,
|
||||
"totalCount": totalCount,
|
||||
"itemListOffset": (q.PageNum - 1) * q.PageSize,
|
||||
"pagination": playletser.BuildThemeIndexPagination(q, totalCount),
|
||||
}
|
||||
if totalCount <= 0 || len(list) == 0 {
|
||||
setNoIndex(data, true)
|
||||
}
|
||||
HTMLOK(c, "themeIndex.html", data)
|
||||
}
|
||||
Reference in New Issue
Block a user