删除common/consts包 - 将Redis Key常量迁移到redis/keys.go

This commit is contained in:
Cold
2026-01-04 14:24:45 +08:00
committed by 张斌
parent c2574b0f9c
commit ae28ac1497
3 changed files with 9 additions and 10 deletions

View File

@@ -190,7 +190,7 @@ func WalletTransferLimiter(r *ghttp.Request) {
return
}
key := fmt.Sprintf(consts.RateLimitKeyTransfer, userId)
key := fmt.Sprintf(redis.RateLimitKeyTransfer, userId)
// 限制: 每个用户每分钟最多转账5次
count, err := redis.IncrRateLimit(r.GetCtx(), key, 60) // 60秒窗口
@@ -252,7 +252,7 @@ func OSSUploadLimiter(r *ghttp.Request) {
return
}
key := fmt.Sprintf(consts.RateLimitKeyUpload, userId)
key := fmt.Sprintf(redis.RateLimitKeyUpload, userId)
// 限制: 每个用户每分钟最多上传10个文件
count, err := redis.IncrRateLimit(r.GetCtx(), key, 60) // 60秒窗口