来源:hgdjnet-server 9bfbafe10d417deea959bd53117bc88a10e60a83 项目身份 HKDJ / JHA-216,独立官网仓库,Jenkins 守卫键 hkdjnet 测试目录 /server/hkdj_net,App/Web API 30331/30332 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
36 lines
1.0 KiB
Go
36 lines
1.0 KiB
Go
package web_playlet
|
|
|
|
import (
|
|
"hkdj-web-server/pub/common"
|
|
"hkdj-web-server/pub/common/srvdef"
|
|
"hkdj-web-server/web/api/proto"
|
|
"hkdj-web-server/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)
|
|
}
|