refactor: align framework cleanup with new bootstrap flow

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
2025-11-19 12:47:25 +08:00
parent 39d14ec093
commit d66323487b
67 changed files with 3020 additions and 3992 deletions

View File

@@ -9,7 +9,6 @@ import (
"github.com/break/junhong_cmp_fiber/pkg/constants"
"github.com/break/junhong_cmp_fiber/pkg/errors"
"github.com/break/junhong_cmp_fiber/pkg/response"
)
// RateLimiter 创建基于 IP 的限流中间件
@@ -23,7 +22,7 @@ func RateLimiter(max int, expiration time.Duration, storage fiber.Storage) fiber
return constants.RedisRateLimitKey(c.IP())
},
LimitReached: func(c *fiber.Ctx) error {
return response.Error(c, 429, errors.CodeTooManyRequests, errors.GetMessage(errors.CodeTooManyRequests, "zh"))
return errors.New(errors.CodeTooManyRequests, errors.GetMessage(errors.CodeTooManyRequests, "zh"))
},
Storage: storage, // 支持内存或 Redis 存储
})