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

83 lines
2.6 KiB
Go

package web_videocollection
import (
"github.com/gin-gonic/gin"
"videoweb/pub/common"
"videoweb/pub/common/srvdef"
"videoweb/web/service/srv_videocollection"
)
// @Tags 合集管理
// @Summary 获取合集视频列表
// @Description 获取合集视频列表
// @Accept json
// @Produce json
// @Param param body srv_videocollection.GetCollectionMediaListReq true "参数列表"
// @Success 200 {object} srv_videocollection.GetCollectionMediaListResp "成功"
// @Failure 400 {string} string "获取失败的返回结果"
// @Security ApiKeyAuth
// @Router /api/web/videocollection/media/list [POST]
func GetVideoCollectionMediaList(ctx *gin.Context) {
var req = &srv_videocollection.GetCollectionMediaListReq{}
if err := ctx.ShouldBind(req); err != nil {
common.ServerJSON(ctx, srvdef.ErrParamError, nil)
return
}
resp, serr := srv_videocollection.GetCollectionMediaList(ctx, req)
if serr != nil {
common.ServerJSON(ctx, serr.Code, serr.Tips)
return
}
common.ServerJSON(ctx, srvdef.Success, resp)
}
// @Tags 合集管理
// @Summary 修改合集里的视频列表
// @Description 修改合集里的视频列表
// @Accept json
// @Produce json
// @Param param body srv_videocollection.VideoCollectionOptionMediaReq true "参数列表"
// @Success 200 {string} string "成功"
// @Failure 400 {string} string "获取失败的返回结果"
// @Security ApiKeyAuth
// @Router /api/web/videocollection/media/option [POST]
func UpdateVideoCollectionMediaList(ctx *gin.Context) {
var req = &srv_videocollection.VideoCollectionOptionMediaReq{}
if err := ctx.ShouldBind(req); err != nil {
common.ServerJSON(ctx, srvdef.ErrParamError, err)
return
}
serr := srv_videocollection.VideoCollectionOptionMedia(ctx, req)
if serr != nil {
common.ServerJSON(ctx, serr.Code, serr.Tips)
return
}
common.ServerJSON(ctx, srvdef.Success, "")
}
// @Tags 合集管理
// @Summary 修改合集里的视频排序
// @Description 修改合集里的视频排序
// @Accept json
// @Produce json
// @Param param body srv_videocollection.UpdateCollectionMediaRankReq true "参数列表"
// @Success 200 {string} string "成功"
// @Failure 400 {string} string "获取失败的返回结果"
// @Security ApiKeyAuth
// @Router /api/web/videocollection/media/rank [POST]
func UpdateVideoCollectionMediaRank(ctx *gin.Context) {
var req = &srv_videocollection.UpdateCollectionMediaRankReq{}
if err := ctx.ShouldBind(req); err != nil {
common.ServerJSON(ctx, srvdef.ErrParamError, err)
return
}
serr := srv_videocollection.UpdateCollectionMediaRank(ctx, req)
if serr != nil {
common.ServerJSON(ctx, serr.Code, serr.Tips)
return
}
common.ServerJSON(ctx, srvdef.Success, "")
}