Initial commit

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
fish03
2026-09-23 14:43:16 +07:00
co-authored by Claude Opus 5.5
commit bef9f8b4ed
663 changed files with 81305 additions and 0 deletions
+50
View File
@@ -0,0 +1,50 @@
package web
import (
"net/http"
"strconv"
"strings"
"videoweb/app/service/authser"
"videoweb/app/service/playletser"
"videoweb/pub/common/log"
"videoweb/pub/common/useragent"
"github.com/gin-gonic/gin"
)
// ChapterDetail 代理上游 GET /api/app/playlet/chapter/detail(播放页 CSR 切集)。
func ChapterDetail(c *gin.Context) {
chapterID, _ := strconv.ParseInt(c.Query("chapterId"), 10, 64)
playletID, _ := strconv.ParseInt(c.Query("playletId"), 10, 64)
playletSlug := strings.TrimSpace(c.Query("playletSlug"))
if chapterID <= 0 {
c.JSON(http.StatusOK, gin.H{
"code": 1001,
"msg": "参数错误",
"tip": "缺少 chapterId",
"data": nil,
})
return
}
data, err := playletser.FetchChapterDetail(c, chapterID, playletID, playletSlug)
if err != nil {
log.Error("chapter detail upstream failed", log.E(err))
c.JSON(http.StatusOK, gin.H{
"code": 500,
"msg": "chapter detail failed",
"tip": "获取剧集失败,请稍后重试",
"data": nil,
})
return
}
if data != nil && useragent.TokenFromRequest(c.Request) != "" {
authser.SetRechargeCookie(c, data.Balance)
}
c.JSON(http.StatusOK, gin.H{
"code": 200,
"msg": "success",
"tip": "成功",
"data": data,
})
}