pc tag search finish

This commit is contained in:
mubai
2023-07-08 00:10:58 +08:00
parent 92a853a196
commit 21e1a00bd4
17 changed files with 630 additions and 42 deletions

View File

@@ -188,6 +188,7 @@ func FilmTagSearch(c *gin.Context) {
current, _ := strconv.Atoi(currentStr)
page := model.Page{PageSize: 49, Current: current}
logic.IL.GetFilmsByTags(params, &page)
// 获取当前分类Title
// 返回对应信息
c.JSON(http.StatusOK, gin.H{
"status": StatusOk,
@@ -208,3 +209,29 @@ func FilmTagSearch(c *gin.Context) {
"page": page,
})
}
// FilmClassify 影片分类首页数据展示
func FilmClassify(c *gin.Context) {
pidStr := c.DefaultQuery("Pid", "")
if pidStr == "" {
c.JSON(http.StatusOK, gin.H{
"status": StatusFailed,
"message": "缺少分类信息",
})
return
}
// 1. 顶部Title数据
pid, _ := strconv.ParseInt(pidStr, 10, 64)
title := logic.IL.GetPidCategory(pid)
// 2. 设置分页信息
page := model.Page{PageSize: 21, Current: 1}
// 3. 获取当前分类下的 最新上映, 排行榜, 最近更新 影片信息
c.JSON(http.StatusOK, gin.H{
"status": StatusOk,
"data": gin.H{
"title": title,
"content": logic.IL.GetFilmClassify(pid, &page),
},
"page": page,
})
}