删除common/consts包 - 将Redis Key常量迁移到redis/keys.go
This commit is contained in:
@@ -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秒窗口
|
||||
|
||||
Reference in New Issue
Block a user