diff --git a/backend/internal/handler/dto/types.go b/backend/internal/handler/dto/types.go index 303b9a43cb..fa41d646c9 100644 --- a/backend/internal/handler/dto/types.go +++ b/backend/internal/handler/dto/types.go @@ -193,7 +193,7 @@ type Account struct { ClientAffinityEnabled *bool `json:"client_affinity_enabled,omitempty"` // 亲和客户端数据(仅 admin 列表端点注入,不由 mapper 填充) - AffinityClientCount *int64 `json:"affinity_client_count,omitempty"` + AffinityClientCount *int64 `json:"affinity_client_count,omitempty"` AffinityClients []string `json:"affinity_clients,omitempty"` // API Key 账号配额限制 diff --git a/backend/internal/service/sora_gdrive_storage.go b/backend/internal/service/sora_gdrive_storage.go index 739bbbfe0b..56d745a177 100644 --- a/backend/internal/service/sora_gdrive_storage.go +++ b/backend/internal/service/sora_gdrive_storage.go @@ -153,13 +153,7 @@ func (s *SoraGDriveStorage) buildOAuth2Service(ctx context.Context, profile *Sor } func (s *SoraGDriveStorage) buildServiceAccountService(ctx context.Context, profile *SoraS3Profile) (*drive.Service, error) { - creds, err := google.CredentialsFromJSONWithParams(ctx, []byte(profile.ServiceAccountJSON), google.CredentialsParams{ - Scopes: []string{drive.DriveFileScope}, - }) - if err != nil { - return nil, fmt.Errorf("parse service account json: %w", err) - } - srv, err := drive.NewService(ctx, option.WithCredentials(creds)) + srv, err := drive.NewService(ctx, option.WithCredentialsJSON([]byte(profile.ServiceAccountJSON))) if err != nil { return nil, fmt.Errorf("create gdrive service account service: %w", err) } diff --git a/backend/internal/service/sora_generation_service.go b/backend/internal/service/sora_generation_service.go index 71773e3407..0eba7f91c9 100644 --- a/backend/internal/service/sora_generation_service.go +++ b/backend/internal/service/sora_generation_service.go @@ -47,9 +47,9 @@ func NewSoraGenerationService( quotaService *SoraQuotaService, ) *SoraGenerationService { return &SoraGenerationService{ - genRepo: genRepo, - objectStorage: objectStorage, - quotaService: quotaService, + genRepo: genRepo, + objectStorage: objectStorage, + quotaService: quotaService, } }