Ported 7 commits (3a79d6a..3dcf693) from tangguo_server: - 版本控制: comment out 2FA in admin.go - 支付和广告调试: pay/ad refactor across appg/adser/rechargeser/pingctrl - 对接统计: add bili_sync statistics endpoint - 代码优化: ginUtil improvements - 修改es/修改appID/代码调整: cumulative updates Preserved hgmj-local differences: - ES table prefix stays 91jd_ (not tangguo_) - BillPlatformID stays 91短剧 (not 糖果短剧) - admin googauth label stays @91短剧 - appg.go retains LouFengH5/DataBuriedPoint fields - rechargeser.go retains reportser event reporting Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
58 lines
1.7 KiB
Go
58 lines
1.7 KiB
Go
package recreationctrl
|
|
|
|
import (
|
|
"91jd-server/app/service/adser"
|
|
"91jd-server/common"
|
|
"91jd-server/common/log"
|
|
"91jd-server/common/stderr"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// List doc
|
|
// @Summary 获取娱乐模块列表
|
|
// @Description 获取金主广告列表
|
|
// @Tags PING
|
|
// @Accept mpfd,json
|
|
// @Produce json,html
|
|
// @Success 200 {array} adser.RecreationListRes
|
|
// @Failure 400 {string} json "{"msg": "操作失败"}"
|
|
// @Router /api/app/recreation/list [get]
|
|
func List(ctx *gin.Context) {
|
|
list, err := adser.RecreationFromJt()
|
|
if err != nil {
|
|
log.Error("RecreationFromJt", log.E(err))
|
|
common.ServeJSON(ctx, stderr.Success, nil) // 加载娱乐广告失败可忽略
|
|
return
|
|
}
|
|
common.ServeJSON(ctx, stderr.Success, list)
|
|
}
|
|
|
|
// Click doc
|
|
// @Summary 娱乐模块广告点击
|
|
// @Description 娱乐模块广告点击
|
|
// @Tags PING
|
|
// @Accept mpfd,json
|
|
// @Produce json,html
|
|
// @Param id formData string true "广告数据id"
|
|
// @Param type formData string true "用户点击数据类型,app or adv"
|
|
// @Param sysType formData string true "用户设备类型. ios or android"
|
|
// @Success 200 {string} json "{"msg": "操作成功"}"
|
|
// @Failure 400 {string} json "{"msg": "操作失败"}"
|
|
// @Router /api/app/recreation/click [post]
|
|
func Click(ctx *gin.Context) {
|
|
var p adser.RecreationClickInfo
|
|
if err := ctx.ShouldBind(&p); err != nil {
|
|
common.ServeJSON(ctx, stderr.ErrParamError, err.Error())
|
|
return
|
|
}
|
|
|
|
_, err := common.GetUID(ctx)
|
|
if err != nil {
|
|
common.ServeJSON(ctx, stderr.ErrTokenIsNotExist, "")
|
|
return
|
|
}
|
|
adser.AsyncAdvertiseClick(p.Id)
|
|
common.ServeJSON(ctx, stderr.Success, nil)
|
|
}
|