MCPcopy Create free account
hub / github.com/GoSimplicity/LinkMe / ParticipateLotteryDraw

Method ParticipateLotteryDraw

internal/api/lotteryDraw.go:116–137  ·  view source on GitHub ↗

ParticipateLotteryDraw 参与抽奖活动

(ctx *gin.Context, req req.ParticipateReq)

Source from the content-addressed store, hash-verified

114
115// ParticipateLotteryDraw 参与抽奖活动
116func (lh *LotteryDrawHandler) ParticipateLotteryDraw(ctx *gin.Context, req req.ParticipateReq) (Result, error) {
117 uc, ok := requireUser(ctx)
118 if !ok {
119 return Result{
120 Code: ServerRequestError,
121 Msg: "未登录或登录已过期",
122 }, nil
123 }
124
125 err := lh.svc.ParticipateLotteryDraw(ctx, req.ActivityID, uc.Uid)
126 if err != nil {
127 return Result{
128 Code: ServerRequestError,
129 Msg: ParticipateLotteryDrawError,
130 }, err
131 }
132
133 return Result{
134 Code: RequestsOK,
135 Msg: ParticipateLotteryDrawSuccess,
136 }, nil
137}
138
139// ListKillEvents 获取所有秒杀活动
140func (lh *LotteryDrawHandler) ListKillEvents(ctx *gin.Context, req req.GetAllSecondKillEventsReq) (Result, error) {

Callers

nothing calls this directly

Calls 2

requireUserFunction · 0.85

Tested by

no test coverage detected