Files
web_huangguo_web/app/api/web/today_update.go
T
2026-09-23 16:50:34 +07:00

35 lines
1.1 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package web
import (
"videoweb/app/service/playletser"
"github.com/gin-gonic/gin"
)
// TodayUpdate 今日更新页 SSR:GET /api/app/playlet/today-update,列表用接口字段渲染。
func TodayUpdate(c *gin.Context) {
q := playletser.ParseTodayUpdateQuery(routeOrQuery(c, "page", "page"))
if redirectCanonical(c, playletser.TodayUpdateCanonicalPath(q)) {
return
}
raw := playletser.FetchTodayUpdateOrEmpty(c, q)
if playletser.PageOutOfRange(q.PageNum, q.PageSize, raw.TotalCount) {
NotFound(c, "页面不存在")
return
}
data := gin.H{
"title": "今日更新",
"pageName": "今日更新",
"description": "黄果短剧今日更新:第一时间追更最新上线短剧与连载剧集,不错过每日精彩更新。",
"navActive": "todayUpdate",
"seoInfo": raw.SeoInfo,
"list": raw.List,
"itemListOffset": (q.PageNum - 1) * q.PageSize,
"pagination": playletser.BuildTodayUpdatePagination(q, raw.TotalCount),
}
if raw.TotalCount <= 0 || len(raw.List) == 0 {
setNoIndex(data, true)
}
HTMLOK(c, "todayUpdate.html", data)
}