feat(adcenter): 新增 POST /api/app/ads/click 广告点击上报到广告中心

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-10-29 16:19:44 +08:00
co-authored by Claude Opus 4.7
parent f0ddce30ed
commit af473f63dd
5 changed files with 98 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
package adsapi
import (
"videoweb/app/api/proto"
"videoweb/app/service/configser"
"videoweb/pub/common"
"videoweb/pub/common/srvdef"
"github.com/gin-gonic/gin"
)
// Click 广告点击上报
// @Tags 广告
// @Summary 广告点击上报
// @Description 用户点击广告时异步上报到广告中心
// @Accept json
// @Produce json
// @Param param body proto.AdsClickReq true "参数"
// @Success 200 {string} json
// @Router /api/app/ads/click [POST]
func Click(c *gin.Context) {
var req proto.AdsClickReq
if err := c.ShouldBindJSON(&req); err != nil {
common.ServerJSON(c, srvdef.ErrParamError, err.Error())
return
}
configser.AsyncAdvertiseClick(req.AdsId)
common.ServerJSON(c, srvdef.Success, nil)
}