From a7a0017aa84e47229a17ca8fb7d54c7c40a56564 Mon Sep 17 00:00:00 2001 From: song Date: Sat, 17 Jan 2026 18:22:43 +0800 Subject: [PATCH] chore: gofmt antigravity gateway service --- .../service/antigravity_gateway_service.go | 66 +++++++++---------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/backend/internal/service/antigravity_gateway_service.go b/backend/internal/service/antigravity_gateway_service.go index 60e81158..40b8e17f 100644 --- a/backend/internal/service/antigravity_gateway_service.go +++ b/backend/internal/service/antigravity_gateway_service.go @@ -33,18 +33,18 @@ const antigravityScopeRateLimitEnv = "GATEWAY_ANTIGRAVITY_429_SCOPE_LIMIT" // antigravityRetryLoopParams 重试循环的参数 type antigravityRetryLoopParams struct { - ctx context.Context - prefix string - account *Account - proxyURL string - accessToken string - action string - body []byte - quotaScope AntigravityQuotaScope - c *gin.Context - httpUpstream HTTPUpstream + ctx context.Context + prefix string + account *Account + proxyURL string + accessToken string + action string + body []byte + quotaScope AntigravityQuotaScope + c *gin.Context + httpUpstream HTTPUpstream settingService *SettingService - handleError func(ctx context.Context, prefix string, account *Account, statusCode int, headers http.Header, body []byte, quotaScope AntigravityQuotaScope) + handleError func(ctx context.Context, prefix string, account *Account, statusCode int, headers http.Header, body []byte, quotaScope AntigravityQuotaScope) } // antigravityRetryLoopResult 重试循环的结果 @@ -769,18 +769,18 @@ func (s *AntigravityGatewayService) Forward(ctx context.Context, c *gin.Context, // 执行带重试的请求 result, err := antigravityRetryLoop(antigravityRetryLoopParams{ - ctx: ctx, - prefix: prefix, - account: account, - proxyURL: proxyURL, - accessToken: accessToken, - action: action, - body: geminiBody, - quotaScope: quotaScope, - c: c, - httpUpstream: s.httpUpstream, + ctx: ctx, + prefix: prefix, + account: account, + proxyURL: proxyURL, + accessToken: accessToken, + action: action, + body: geminiBody, + quotaScope: quotaScope, + c: c, + httpUpstream: s.httpUpstream, settingService: s.settingService, - handleError: s.handleUpstreamError, + handleError: s.handleUpstreamError, }) if err != nil { return nil, s.writeClaudeError(c, http.StatusBadGateway, "upstream_error", "Upstream request failed after retries") @@ -1459,18 +1459,18 @@ func (s *AntigravityGatewayService) ForwardGemini(ctx context.Context, c *gin.Co // 执行带重试的请求 result, err := antigravityRetryLoop(antigravityRetryLoopParams{ - ctx: ctx, - prefix: prefix, - account: account, - proxyURL: proxyURL, - accessToken: accessToken, - action: upstreamAction, - body: wrappedBody, - quotaScope: quotaScope, - c: c, - httpUpstream: s.httpUpstream, + ctx: ctx, + prefix: prefix, + account: account, + proxyURL: proxyURL, + accessToken: accessToken, + action: upstreamAction, + body: wrappedBody, + quotaScope: quotaScope, + c: c, + httpUpstream: s.httpUpstream, settingService: s.settingService, - handleError: s.handleUpstreamError, + handleError: s.handleUpstreamError, }) if err != nil { return nil, s.writeGoogleError(c, http.StatusBadGateway, "Upstream request failed after retries")