forked from all_user/stat_center
57 lines
1.6 KiB
Go
57 lines
1.6 KiB
Go
package advertiseApi
|
|
|
|
import (
|
|
"stat/common/stdLog"
|
|
"stat/service/advertiseSer"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// @Tags 广告管理
|
|
// @Summary 广告统计
|
|
// @Description 广告统计
|
|
// @Accept json
|
|
// @Produce json
|
|
// @Param param body advertiseSer.GetAdvertiseStatReq true "参数列表"
|
|
// @Success 200 {object} advertiseSer.GetAdvertiseStatResp "成功"
|
|
// @Failure 400 {string} string "获取失败的返回结果"
|
|
// @Router /api/stat/ads/stat [POST]
|
|
func GetAdvertiseStat(ctx *gin.Context) {
|
|
param := &advertiseSer.GetAdvertiseStatReq{}
|
|
err := ctx.ShouldBind(¶m)
|
|
if err != nil {
|
|
stdLog.ServerJSON(ctx, stdLog.ParamError, err)
|
|
return
|
|
}
|
|
result, err := advertiseSer.GetAdvertiseStatList(ctx, param)
|
|
if err != nil {
|
|
stdLog.ServerJSON(ctx, stdLog.QueryError, err.Error())
|
|
return
|
|
}
|
|
stdLog.ServerJSON(ctx, stdLog.Success, result)
|
|
}
|
|
|
|
// @Tags 广告管理
|
|
// @Summary 广告统计不分时统计
|
|
// @Description 广告统计不分时统计
|
|
// @Accept json
|
|
// @Produce json
|
|
// @Param param body advertiseSer.GetAdvertiseTotalStatReq true "参数列表"
|
|
// @Success 200 {object} advertiseSer.GetAdvertiseTotalStatResp "成功"
|
|
// @Failure 400 {string} string "获取失败的返回结果"
|
|
// @Router /api/stat/ads/stattotal [POST]
|
|
func GetAdvertiseTotalStat(ctx *gin.Context) {
|
|
param := &advertiseSer.GetAdvertiseTotalStatReq{}
|
|
err := ctx.ShouldBind(¶m)
|
|
if err != nil {
|
|
stdLog.ServerJSON(ctx, stdLog.ParamError, err)
|
|
return
|
|
}
|
|
result, err := advertiseSer.GetAdvertiseTotalStatList(ctx, param)
|
|
if err != nil {
|
|
stdLog.ServerJSON(ctx, stdLog.QueryError, err.Error())
|
|
return
|
|
}
|
|
stdLog.ServerJSON(ctx, stdLog.Success, result)
|
|
}
|