Initial commit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
谢宇宁
2026-10-22 14:47:17 +07:00
co-authored by Claude Opus 5.5
commit 3639d2184a
574 changed files with 61690 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
package web
import (
"strings"
"videoweb/app/service/playletser"
"github.com/gin-gonic/gin"
)
// Detail 详情页 SSR:GET /api/app/playlet/detail;seoInfo 直接注入模板。
func Detail(c *gin.Context) {
key := strings.TrimSpace(c.Param("slug"))
if key == "" {
NotFound(c, "未找到该短剧")
return
}
raw := playletser.FetchDetailOrNilByKey(c, key)
if raw == nil {
NotFound(c, "未找到该短剧")
return
}
// 有 slug 使用 slug,否则保留 ID 路由。
if redirectCanonical(c, playletser.DetailPath(raw.Slug, raw.ID)) {
return
}
HTMLOK(c, "detail.html", gin.H{
"title": raw.Title,
"detail": raw,
"seoInfo": raw.SeoInfo,
"episodeRanges": playletser.BuildEpisodeRanges(raw.PlayletChapterInfo, raw.TotalEpisode, 30),
})
}