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

Method ParticipateSecondKill

internal/api/lotteryDraw.go:202–223  ·  view source on GitHub ↗

ParticipateSecondKill 参与秒杀活动

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

Source from the content-addressed store, hash-verified

200
201// ParticipateSecondKill 参与秒杀活动
202func (lh *LotteryDrawHandler) ParticipateSecondKill(ctx *gin.Context, req req.ParticipateReq) (Result, error) {
203 uc, ok := requireUser(ctx)
204 if !ok {
205 return Result{
206 Code: ServerRequestError,
207 Msg: "未登录或登录已过期",
208 }, nil
209 }
210
211 err := lh.svc.ParticipateSecondKill(ctx, req.ActivityID, uc.Uid)
212 if err != nil {
213 return Result{
214 Code: ServerRequestError,
215 Msg: ParticipateSecondKillError,
216 }, err
217 }
218
219 return Result{
220 Code: RequestsOK,
221 Msg: ParticipateSecondKillSuccess,
222 }, nil
223}

Callers

nothing calls this directly

Calls 2

requireUserFunction · 0.85
ParticipateSecondKillMethod · 0.65

Tested by

no test coverage detected