58 lines
1.8 KiB
Go
58 lines
1.8 KiB
Go
package actressapi
|
|
|
|
import (
|
|
"videoweb/app/api/proto"
|
|
"videoweb/app/service/actressser"
|
|
"videoweb/pub/common"
|
|
"videoweb/pub/common/srvdef"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// QueryActressWorkList 指定女优详情和作品混排列表
|
|
// @Tags 女优相关接口
|
|
// @Summary 指定女优详情和作品列表 -- by 王鸣
|
|
// @Description 查询指定女优详情和作品列表,支持上架时间/观看量/收藏量升降序,每间隔8条作品数据插入一个广告
|
|
// @Accept json
|
|
// @Produce json
|
|
// @Param params query proto.QueryActressWorkListReq true "指定女优作品列表请求"
|
|
// @Success 200 {object} proto.QueryActressWorkListResp{list=[]proto.QueryVideoListItem{VideoInfo=proto.VideoInfo}} "成功"
|
|
// @Failure 400 {string} string "获取失败的返回结果"
|
|
// @Security ApiKeyAuth
|
|
// @Router /api/app/actress/work/list [get]
|
|
func QueryActressWorkList(c *gin.Context) {
|
|
var req proto.QueryActressWorkListReq
|
|
if err := c.ShouldBindQuery(&req); err != nil {
|
|
common.ServerJSON(c, srvdef.ErrParamError, "")
|
|
return
|
|
}
|
|
data, err := actressser.QueryActressWorkList(c, &req)
|
|
if err != nil {
|
|
common.ServerJSON(c, err, "")
|
|
return
|
|
}
|
|
common.ServerJSON(c, srvdef.Success, data)
|
|
}
|
|
|
|
// ActressList 女优榜单列表
|
|
// @Tags 女优相关接口
|
|
// @Summary 女优榜单列表 -- by 王鸣
|
|
// @Description 返回导航、广告和按热度值降序排列的女优列表
|
|
// @Accept json
|
|
// @Produce json
|
|
// @Success 200 {object} proto.QueryActressListResp "成功"
|
|
// @Failure 400 {string} string "获取失败的返回结果"
|
|
// @Router /api/app/actress/list [get]
|
|
func ActressList(c *gin.Context) {
|
|
data, err := actressser.ActressListData(c, c.Request.URL.Path)
|
|
if err != nil {
|
|
common.ServerJSON(c, err, "")
|
|
return
|
|
}
|
|
if data == nil {
|
|
common.ServerJSON(c, srvdef.ErrDbQueryError, "")
|
|
return
|
|
}
|
|
common.ServerJSON(c, srvdef.Success, data)
|
|
}
|