详情页评论改推荐列表
This commit is contained in:
@@ -1,43 +0,0 @@
|
||||
package web
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"strconv"
|
||||
"videoweb/app/service/commentser"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// CommentList BFF:代理 GET /api/app/comment/list。
|
||||
// 文档:http://172.104.181.99:25319/swagger/index.html#/评论APP/get_api_app_comment_list
|
||||
func CommentList(c *gin.Context) {
|
||||
objectID, _ := strconv.ParseInt(c.Query("objectId"), 10, 64)
|
||||
objectType, _ := strconv.Atoi(c.Query("objectType"))
|
||||
pageNum, _ := strconv.Atoi(c.Query("pageNum"))
|
||||
pageSize, _ := strconv.Atoi(c.Query("pageSize"))
|
||||
sortOrder, _ := strconv.Atoi(c.Query("sortOrder"))
|
||||
if objectID <= 0 {
|
||||
c.JSON(http.StatusBadRequest, gin.H{
|
||||
"code": 400,
|
||||
"msg": "objectId required",
|
||||
"tip": "缺少评论对象",
|
||||
"data": nil,
|
||||
})
|
||||
return
|
||||
}
|
||||
data := commentser.FetchListOrEmpty(c, commentser.ListQuery{
|
||||
ObjectID: objectID,
|
||||
ObjectType: objectType,
|
||||
PageNum: pageNum,
|
||||
PageSize: pageSize,
|
||||
SortOrder: sortOrder,
|
||||
})
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"code": 200,
|
||||
"msg": "ok",
|
||||
"tip": "成功",
|
||||
"data": data,
|
||||
})
|
||||
}
|
||||
|
||||
// CommentSend BFF:代理 POST /api/app/comment/send。
|
||||
+4
-6
@@ -10,14 +10,12 @@ import (
|
||||
func Help(c *gin.Context) {
|
||||
HTMLOK(c, "help.html", gin.H{
|
||||
"faqItems": []seoser.FAQItem{
|
||||
{Question: "黄果短剧网页版可以看全集吗?", Answer: "可以。免费集直接观看,付费集可用金币按集解锁,解锁后永久有效。"},
|
||||
{Question: "解锁过的剧集还需要再付费吗?", Answer: "不需要。已解锁的剧集可在登录后继续观看,无需重复付费。"},
|
||||
{Question: "如何充值金币?", Answer: "登录后进入个人中心,选择金币充值,即可查看可用的充值方式。"},
|
||||
{Question: "支持哪些支付方式?", Answer: "可用的支付方式会在充值页面列出,请以页面显示为准。"},
|
||||
{Question: "忘记密码怎么办?", Answer: "请通过意见反馈联系我们,提交账号信息后由客服协助处理。"},
|
||||
{Question: "黄果短剧网页版可以看全集吗?", Answer: "免费集可直接在网页观看;标记为 App 专享的剧集,下载黄果短剧 App 即可免费观看完整内容。"},
|
||||
{Question: "网页版需要注册账号吗?", Answer: "不需要。网页版无需注册或登录,打开即可浏览和观看。"},
|
||||
{Question: "如何下载黄果短剧 App?", Answer: "点击页面顶部或播放页的「下载 App」按钮,按提示完成安装即可。"},
|
||||
{Question: "网站打不开怎么办?", Answer: "请收藏页脚的最新地址、备用地址与海外永久地址,任一地址均可访问。"},
|
||||
{Question: "内容多久更新一次?", Answer: "黄果短剧持续更新内容,欢迎关注首页的新剧和最近上新。"},
|
||||
{Question: "如何联系客服或洽谈合作?", Answer: "请发送邮件至 support@huanguoai.net,我们会尽快回复。"},
|
||||
{Question: "如何注销账号?", Answer: "请通过意见反馈或客服邮箱提交注销申请。"},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
+52
-118
@@ -2,7 +2,6 @@ package web
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"videoweb/app/service/commentser"
|
||||
"videoweb/app/service/playletser"
|
||||
"videoweb/app/service/videoser"
|
||||
|
||||
@@ -76,20 +75,6 @@ func Play(c *gin.Context) {
|
||||
})
|
||||
}
|
||||
|
||||
commentObjectID := playlet.ID
|
||||
commentObjectType := commentser.ObjectTypePlaylet
|
||||
if chapterID > 0 {
|
||||
commentObjectID = chapterID
|
||||
commentObjectType = commentser.ObjectTypeChapter
|
||||
}
|
||||
comments := commentser.FetchListOrEmpty(c, commentser.ListQuery{
|
||||
ObjectID: commentObjectID,
|
||||
ObjectType: commentObjectType,
|
||||
PageNum: 1,
|
||||
PageSize: 4,
|
||||
SortOrder: commentser.SortHot,
|
||||
})
|
||||
|
||||
canWatch := false
|
||||
episode := 0
|
||||
if chapter != nil {
|
||||
@@ -119,45 +104,36 @@ func Play(c *gin.Context) {
|
||||
}
|
||||
|
||||
data := gin.H{
|
||||
"title": title,
|
||||
"navActive": "list",
|
||||
"seoInfo": seo,
|
||||
"playlet": playlet,
|
||||
"chapter": chapter,
|
||||
"chapterID": chapterID,
|
||||
"episode": episode,
|
||||
"canWatch": canWatch,
|
||||
"mainURL": mainURL,
|
||||
"previewURL": previewURL,
|
||||
"hasPreview": previewURL != "",
|
||||
"nextChapterID": playletser.NextChapterID(playlet, chapterID),
|
||||
"advitise": playlet.Advitise,
|
||||
"related": playlet.RelatedRecommendData,
|
||||
"guessLike": guessLike.List,
|
||||
"guessPage": guessLike.PageNum,
|
||||
"guessPageSize": guessLike.PageSize,
|
||||
"guessTotal": guessLike.TotalCount,
|
||||
"hotList": hotList,
|
||||
"hotMoreURL": playletser.AllListURL("all", 0, 0, 2, 1),
|
||||
"comments": comments.List,
|
||||
"commentTotal": comments.TotalCount,
|
||||
"commentPage": comments.PageNum,
|
||||
"commentSize": comments.PageSize,
|
||||
"commentObjectID": commentObjectID,
|
||||
"commentObjectType": commentObjectType,
|
||||
"title": title,
|
||||
"navActive": "list",
|
||||
"seoInfo": seo,
|
||||
"playlet": playlet,
|
||||
"chapter": chapter,
|
||||
"chapterID": chapterID,
|
||||
"episode": episode,
|
||||
"canWatch": canWatch,
|
||||
"mainURL": mainURL,
|
||||
"previewURL": previewURL,
|
||||
"hasPreview": previewURL != "",
|
||||
"nextChapterID": playletser.NextChapterID(playlet, chapterID),
|
||||
"advitise": playlet.Advitise,
|
||||
"related": playlet.RelatedRecommendData,
|
||||
"guessLike": guessLike.List,
|
||||
"guessPage": guessLike.PageNum,
|
||||
"guessPageSize": guessLike.PageSize,
|
||||
"guessTotal": guessLike.TotalCount,
|
||||
"hotList": hotList,
|
||||
"hotMoreURL": playletser.AllListURL("all", 0, 0, 2, 1),
|
||||
"playResponse": gin.H{
|
||||
"playlet": playlet,
|
||||
"chapter": chapter,
|
||||
"chapterID": chapterID,
|
||||
"canWatch": canWatch,
|
||||
"mainURL": mainURL,
|
||||
"previewURL": previewURL,
|
||||
"hasPreview": previewURL != "",
|
||||
"guessLike": guessLike,
|
||||
"hotList": hotList,
|
||||
"comments": comments,
|
||||
"commentObjectID": commentObjectID,
|
||||
"commentObjectType": commentObjectType,
|
||||
"playlet": playlet,
|
||||
"chapter": chapter,
|
||||
"chapterID": chapterID,
|
||||
"canWatch": canWatch,
|
||||
"mainURL": mainURL,
|
||||
"previewURL": previewURL,
|
||||
"hasPreview": previewURL != "",
|
||||
"guessLike": guessLike,
|
||||
"hotList": hotList,
|
||||
},
|
||||
}
|
||||
data["canonicalPath"] = playletser.PlayPath(playlet.Slug, playlet.ID)
|
||||
@@ -192,27 +168,6 @@ func SeriesPlay(c *gin.Context) {
|
||||
videoURL := strings.TrimSpace(video.Video.URL)
|
||||
canWatch := videoURL != ""
|
||||
|
||||
commentObjectID := video.ID
|
||||
// 视频评论:objectType=20(swagger:10-短剧 11-短剧剧集 20-视频)
|
||||
commentObjectType := commentser.ObjectTypeVideo
|
||||
comments := commentser.FetchListOrEmpty(c, commentser.ListQuery{
|
||||
ObjectID: commentObjectID,
|
||||
ObjectType: commentObjectType,
|
||||
PageNum: 1,
|
||||
PageSize: 4,
|
||||
SortOrder: commentser.SortHot,
|
||||
})
|
||||
if comments.PageNum <= 0 {
|
||||
comments.PageNum = 1
|
||||
}
|
||||
if comments.PageSize <= 0 {
|
||||
comments.PageSize = 4
|
||||
}
|
||||
commentTotal := comments.TotalCount
|
||||
if commentTotal <= 0 && video.CountComment > 0 {
|
||||
commentTotal = video.CountComment
|
||||
}
|
||||
|
||||
hot := playletser.FetchAllListOrEmpty(c, playletser.AllListQuery{
|
||||
PageNum: 1,
|
||||
PageSize: 8,
|
||||
@@ -245,51 +200,30 @@ func SeriesPlay(c *gin.Context) {
|
||||
}
|
||||
|
||||
data := gin.H{
|
||||
"title": title,
|
||||
"navActive": "aiSeries",
|
||||
"seoInfo": video.SeoInfo,
|
||||
"video": video,
|
||||
"videoID": video.ID,
|
||||
"videoSlug": video.Slug,
|
||||
"cover": cover,
|
||||
"videoURL": videoURL,
|
||||
"canWatch": canWatch,
|
||||
"guessLike": guessLike.List,
|
||||
"guessPage": guessLike.PageNum,
|
||||
"guessPageSize": guessLike.PageSize,
|
||||
"guessTotal": guessLike.TotalCount,
|
||||
"guessPlayletID": guessPlayletID,
|
||||
"advitise": video.Advitise,
|
||||
"comments": comments.List,
|
||||
"commentTotal": commentTotal,
|
||||
"commentPage": comments.PageNum,
|
||||
"commentSize": comments.PageSize,
|
||||
"commentObjectID": commentObjectID,
|
||||
"commentObjectType": commentObjectType,
|
||||
"hotList": hotList,
|
||||
"hotMoreURL": playletser.AllListURL("all", 0, 0, 2, 1),
|
||||
"title": title,
|
||||
"navActive": "aiSeries",
|
||||
"seoInfo": video.SeoInfo,
|
||||
"video": video,
|
||||
"videoID": video.ID,
|
||||
"videoSlug": video.Slug,
|
||||
"cover": cover,
|
||||
"videoURL": videoURL,
|
||||
"canWatch": canWatch,
|
||||
"guessLike": guessLike.List,
|
||||
"guessPage": guessLike.PageNum,
|
||||
"guessPageSize": guessLike.PageSize,
|
||||
"guessTotal": guessLike.TotalCount,
|
||||
"guessPlayletID": guessPlayletID,
|
||||
"advitise": video.Advitise,
|
||||
"hotList": hotList,
|
||||
"hotMoreURL": playletser.AllListURL("all", 0, 0, 2, 1),
|
||||
"videoResponse": gin.H{
|
||||
"video": video,
|
||||
"videoURL": videoURL,
|
||||
"canWatch": canWatch,
|
||||
"comments": comments,
|
||||
"hotList": hotList,
|
||||
"guessLike": guessLike,
|
||||
"guessPlayletID": guessPlayletID,
|
||||
"commentObjectID": commentObjectID,
|
||||
"commentObjectType": commentObjectType,
|
||||
},
|
||||
"commentDebug": gin.H{
|
||||
"path": "/api/app/comment/list",
|
||||
"objectId": commentObjectID,
|
||||
"objectType": commentObjectType, // 20-视频
|
||||
"pageNum": comments.PageNum,
|
||||
"pageSize": comments.PageSize,
|
||||
"totalCount": commentTotal,
|
||||
"list": comments.List,
|
||||
"apis": []string{
|
||||
"GET /api/app/comment/list",
|
||||
},
|
||||
"video": video,
|
||||
"videoURL": videoURL,
|
||||
"canWatch": canWatch,
|
||||
"hotList": hotList,
|
||||
"guessLike": guessLike,
|
||||
"guessPlayletID": guessPlayletID,
|
||||
},
|
||||
"playDebug": gin.H{
|
||||
"canWatch": canWatch,
|
||||
|
||||
Reference in New Issue
Block a user