Files
rootandClaude Opus 5 8679200f41 Initial commit
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 13:57:10 +08:00

57 lines
1.7 KiB
Go

package recreationctrl
import (
"91porn-server/app/service/adser"
"91porn-server/common"
"91porn-server/common/log"
"91porn-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
}
common.ServeJSON(ctx, stderr.Success, nil)
}