Files
rootandClaude Opus 4.7 79ac89b458 Initial commit
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-11-07 10:47:18 +08:00

36 lines
1007 B
Go

package web_playlet
import (
"videoweb/pub/common"
"videoweb/pub/common/srvdef"
"videoweb/web/api/proto"
"videoweb/web/service/srv_playlet"
"github.com/gin-gonic/gin"
)
// Sales web端短剧销售数据
// @Tags web短剧相关接口
// @Summary web端短剧销售数据
// @Description 按北京时间区间汇总金币解锁、短剧点赞、短剧收藏,最多返回前50条
// @Accept json
// @Produce json
// @Param params query proto.PlayletSalesReq true "销售数据筛选"
// @Success 200 {object} proto.PlayletSalesResp "成功"
// @Failure 400 {string} string "失败"
// @Security ApiKeyAuth
// @Router /api/web/playlet/sales [get]
func Sales(ctx *gin.Context) {
var req proto.PlayletSalesReq
if err := ctx.ShouldBindQuery(&req); err != nil {
common.ServerJSON(ctx, srvdef.ErrParamError, nil)
return
}
resp, err := srv_playlet.ListPlayletSales(ctx, &req)
if err != nil {
common.ServerJSON(ctx, err.Code, err.Tips)
return
}
common.ServerJSON(ctx, srvdef.Success, resp)
}