forked from all_user/stat_center
111 lines
2.8 KiB
Go
111 lines
2.8 KiB
Go
package activityApi
|
|
|
|
import (
|
|
"stat/api/proto"
|
|
"stat/common/stdLog"
|
|
"stat/service/activitySer"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// @Tags 活动管理
|
|
// @Summary h5页面活动信息
|
|
// @Description h5页面活动信息
|
|
// @Accept json
|
|
// @Produce json
|
|
// @Param param body proto.ActivityInfoReq true "参数"
|
|
// @Success 200 {object} proto.ActivityInfoResp "成功"
|
|
// @Success 400 {string} string "失败"
|
|
// @Router /api/stat/activity/h5/info [POST]
|
|
func ActivityInfo(ctx *gin.Context) {
|
|
|
|
var param proto.ActivityInfoReq
|
|
|
|
if err := ctx.ShouldBind(¶m); err != nil {
|
|
stdLog.ServerJSON(ctx, stdLog.ParamError, err)
|
|
return
|
|
}
|
|
code, data, err := activitySer.GetActivityInfo(ctx, param)
|
|
if err != nil {
|
|
stdLog.ServerJSON(ctx, code, err)
|
|
return
|
|
}
|
|
|
|
stdLog.ServerJSON(ctx, code, data)
|
|
}
|
|
|
|
// @Tags 活动管理
|
|
// @Summary h5页面活动奖品信息
|
|
// @Description h5页面活动奖品信息
|
|
// @Accept json
|
|
// @Produce json
|
|
// @Param param body proto.ActivityGiftInfoReq true "参数"
|
|
// @Success 200 {object} proto.ActivityGiftInfoResp "成功"
|
|
// @Success 400 {string} string "失败"
|
|
// @Router /api/stat/activity/h5/giftinfo [POST]
|
|
func ActivityGiftInfo(ctx *gin.Context) {
|
|
param := proto.ActivityGiftInfoReq{}
|
|
if err := ctx.ShouldBindJSON(¶m); err != nil {
|
|
stdLog.ServerJSON(ctx, stdLog.ParamError, err)
|
|
return
|
|
}
|
|
|
|
code, data, err := activitySer.GetActivityGiftInfo(ctx, param)
|
|
if err != nil {
|
|
stdLog.ServerJSON(ctx, code, err)
|
|
return
|
|
}
|
|
|
|
stdLog.ServerJSON(ctx, code, data)
|
|
}
|
|
|
|
// @Tags 活动管理
|
|
// @Summary 抽奖
|
|
// @Description 抽奖
|
|
// @Accept json
|
|
// @Produce json
|
|
// @Param param body proto.DrawReq true "参数"
|
|
// @Success 200 {string} string "成功"
|
|
// @Success 400 {string} string "失败"
|
|
// @Router /api/stat/activity/h5/draw [POST]
|
|
func LuckyDraw(ctx *gin.Context) {
|
|
param := proto.DrawReq{}
|
|
if err := ctx.ShouldBindJSON(¶m); err != nil {
|
|
stdLog.ServerJSON(ctx, stdLog.ParamError, err)
|
|
return
|
|
}
|
|
|
|
code, data, err := activitySer.Draw(ctx, ¶m)
|
|
if err != nil {
|
|
stdLog.ServerJSON(ctx, code, err)
|
|
return
|
|
}
|
|
|
|
stdLog.ServerJSON(ctx, code, data)
|
|
}
|
|
|
|
// @Tags 活动管理
|
|
// @Summary 删除一个活动
|
|
// @Description 删除一个活动
|
|
// @Accept json
|
|
// @Produce json
|
|
// @Param param body proto.DelActivityReq true "参数列表"
|
|
// @Success 200 {string} string "成功"
|
|
// @Failure 400 {string} string "失败"
|
|
// @Security ApiKeyAuth
|
|
// @Router /api/stat/activity/del [POST]
|
|
// func DelOneAct(ctx *gin.Context) {
|
|
// param := proto.DelActivityReq{}
|
|
// if err := ctx.ShouldBind(¶m); err != nil {
|
|
// stdLog.ServerJSON(ctx, stdLog.ParamError, err.Error())
|
|
// return
|
|
// }
|
|
// code, err := activitySer.DeleteOneAct(ctx, param)
|
|
// if err != nil {
|
|
// stdLog.ServerJSON(ctx, code, err)
|
|
// return
|
|
// }
|
|
|
|
// stdLog.ServerJSON(ctx, code, "")
|
|
// }
|