Files
2026-10-26 16:28:14 +08:00

54 lines
1.5 KiB
Go

package home
import (
"videoweb/app/service/homeser"
"videoweb/pub/common"
"videoweb/pub/common/srvdef"
"github.com/gin-gonic/gin"
)
// Home 首页
// @Tags 首页
// @Summary 首页 --by 旺鸣
// @Description 首页分类数据
// @Accept json
// @Produce json
// @Success 200 {object} proto.DataResp "成功"
// @Failure 400 {string} string "获取失败的返回结果"
// @Router /api/app/home [get]
func Home(c *gin.Context) {
data, err := homeser.HomeData(c)
if err != nil {
common.ServerJSON(c, err, "")
return
}
common.JSONWriterCache(c, srvdef.Success, data)
}
// HomeBase 首页公共数据
// @Tags 首页
// @Summary 首页公共数据 --by 旺鸣
// @Description 只返回翻译、配置、底部翻译、广告和公告
// @Accept json
// @Produce json
// @Success 200 {object} proto.HomeBaseResp "成功"
// @Failure 400 {string} string "获取失败的返回结果"
// @Router /api/app/home/base [get]
func HomeBase(c *gin.Context) {
common.JSONWriterCache(c, srvdef.Success, homeser.HomeBaseData(c))
}
// HomeTags 首页标签数据
// @Tags 首页
// @Summary 首页标签数据 --by 旺鸣
// @Description 返回视频、短剧的标签信息,以及基础导航、配置、广告和公告
// @Accept json
// @Produce json
// @Success 200 {object} proto.HomeTagsResp "成功"
// @Failure 400 {string} string "获取失败的返回结果"
// @Router /api/app/home/tags [get]
func HomeTags(c *gin.Context) {
common.JSONWriterCache(c, srvdef.Success, homeser.HomeTagsData(c))
}