From dfd7e86f6cf69f6160cf0966798aeb697cb89331 Mon Sep 17 00:00:00 2001 From: Mrx <18278715334@163.com> Date: Thu, 7 May 2026 12:39:37 +0800 Subject: [PATCH] f --- internal/shared/middleware/daily_rate_limit.go | 2 +- internal/shared/validator/custom_validators.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/shared/middleware/daily_rate_limit.go b/internal/shared/middleware/daily_rate_limit.go index a486518..5f64058 100644 --- a/internal/shared/middleware/daily_rate_limit.go +++ b/internal/shared/middleware/daily_rate_limit.go @@ -251,7 +251,7 @@ func (m *DailyRateLimitMiddleware) shouldRecordNearLimit(current, max int) bool if max <= 0 { return false } - threshold := int(math.Ceil(float64(max) * 0.8)) + threshold := int(math.Ceil(float64(max) * 0.9)) if threshold < 1 { threshold = 1 } diff --git a/internal/shared/validator/custom_validators.go b/internal/shared/validator/custom_validators.go index 2aedd4d..abbf1cf 100644 --- a/internal/shared/validator/custom_validators.go +++ b/internal/shared/validator/custom_validators.go @@ -9,8 +9,9 @@ import ( "strings" "time" - "github.com/go-playground/validator/v10" "tyapi-server/internal/shared/pdfvalidate" + + "github.com/go-playground/validator/v10" ) // RegisterCustomValidators 注册所有自定义验证器