refactor(adcenter): /api/app/ads/click 改用 AdsClickInfo,接收并透传 appId
- handler 绑定 proto.AdsClickInfo{appId, adsId, location}
- AsyncAdvertiseClick/AdvertiseClickCenter 新增 appId 参数
- appId<=0 时回落到默认 advertiseAppId=12
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package adsapi
|
||||
|
||||
import (
|
||||
"strconv"
|
||||
|
||||
"videoweb/app/api/proto"
|
||||
"videoweb/app/service/configser"
|
||||
"videoweb/pub/common"
|
||||
@@ -12,18 +14,18 @@ import (
|
||||
// Click 广告点击上报
|
||||
// @Tags 广告
|
||||
// @Summary 广告点击上报
|
||||
// @Description 用户点击广告时异步上报到广告中心
|
||||
// @Description 用户点击广告时异步上报到广告中心。请求可带 appId 覆盖默认,缺省时按本站 appId 上报。
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param param body proto.AdsClickReq true "参数"
|
||||
// @Param param body proto.AdsClickInfo true "参数"
|
||||
// @Success 200 {string} json
|
||||
// @Router /api/app/ads/click [POST]
|
||||
func Click(c *gin.Context) {
|
||||
var req proto.AdsClickReq
|
||||
var req proto.AdsClickInfo
|
||||
if err := c.ShouldBindJSON(&req); err != nil {
|
||||
common.ServerJSON(c, srvdef.ErrParamError, err.Error())
|
||||
return
|
||||
}
|
||||
configser.AsyncAdvertiseClick(req.AdsId)
|
||||
configser.AsyncAdvertiseClick(strconv.FormatInt(req.AdsId, 10), int32(req.AppId))
|
||||
common.ServerJSON(c, srvdef.Success, nil)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user