Updata:解决冲突

This commit is contained in:
jiaji.H 2026-01-15 11:34:54 +08:00
commit ab79cd8833
2 changed files with 1063 additions and 806 deletions

File diff suppressed because it is too large Load Diff

View File

@ -34,6 +34,18 @@ func CreateCompetitiveReport(ctx *gin.Context) {
service.Error(ctx, err)
return
}
loginInfo := login.GetUserInfoFromC(ctx)
lockKey := fmt.Sprintf("lock_create_competitive_report_%d", loginInfo.ID)
reply := cache.RedisClient.SetNX(lockKey, time.Now().Format("2006-01-02 15:04:05"), time.Second*5)
if !reply.Val() {
service.Error(ctx, errors.New("请勿重复提交"))
return
}
defer func() {
cache.RedisClient.Del(lockKey)
}()
newCtx := NewCtxWithUserInfo(ctx)
artistID, _ := strconv.ParseUint(req.ArtistID, 10, 64)