## 后端变更 - 删除 21 个 sora_*.go 服务文件(service/handler/repository/routes) - 删除 Sora 相关 migration 文件(046/047/063/090) - 清理 config 中的 sora_* 配置项和平台常量 - 清理 wire 依赖注入中的 Sora 组件 - 修复 wire_gen.go 语法错误(缺少逗号和闭合括号) - 移除 go.mod 中的 go-sora2api 依赖 - 更新 ent schema usage_log.go 注释 ## 前端变更 - 删除 SoraView、SoraAdminView 及 8 个 Sora 子组件 - 删除 sora API 层和路由配置 - 清理 UserEditModal 中的 Sora 存储配额 UI - 清理 types/index.ts 中 Sora 相关类型定义 - 清理 stores/app.ts 默认配置 - 清理 i18n 翻译文件 en.ts/zh.ts (~110 行) - 更新相关测试文件 ## 文档更新 - README.md / README_CN.md / README_JA.md: 移除 Sora 状态说明和配置段落 - PROJECT_DIFF.md: 移除 Sora 相关差异描述 ## 验证结果 - ✅ Go 编译通过 (go build ./...) - ✅ TypeScript 类型检查通过 (vue-tsc --noEmit) - ✅ 后端测试全通过 (0 failures) - ✅ 前端测试全通过 (59 files, 329 tests, 0 failures) - ✅ 前端生产构建成功 (23.81s)
95 lines
4.2 KiB
Go
95 lines
4.2 KiB
Go
package config
|
|
|
|
// GeminiConfig Gemini 配置
|
|
type GeminiConfig struct {
|
|
OAuth GeminiOAuthConfig `mapstructure:"oauth"`
|
|
Quota GeminiQuotaConfig `mapstructure:"quota"`
|
|
}
|
|
|
|
type GeminiOAuthConfig struct {
|
|
ClientID string `mapstructure:"client_id"`
|
|
ClientSecret string `mapstructure:"client_secret"`
|
|
Scopes string `mapstructure:"scopes"`
|
|
}
|
|
|
|
type GeminiQuotaConfig struct {
|
|
Tiers map[string]GeminiTierQuotaConfig `mapstructure:"tiers"`
|
|
Policy string `mapstructure:"policy"`
|
|
}
|
|
|
|
type GeminiTierQuotaConfig struct {
|
|
ProRPD *int64 `mapstructure:"pro_rpd" json:"pro_rpd"`
|
|
FlashRPD *int64 `mapstructure:"flash_rpd" json:"flash_rpd"`
|
|
CooldownMinutes *int `mapstructure:"cooldown_minutes" json:"cooldown_minutes"`
|
|
}
|
|
|
|
// UpdateConfig 更新检查配置
|
|
type UpdateConfig struct {
|
|
ProxyURL string `mapstructure:"proxy_url"` // 访问 GitHub 的代理地址
|
|
}
|
|
|
|
// IdempotencyConfig 幂等性配置
|
|
type IdempotencyConfig struct {
|
|
ObserveOnly bool `mapstructure:"observe_only"`
|
|
DefaultTTLSeconds int `mapstructure:"default_ttl_seconds"`
|
|
SystemOperationTTLSeconds int `mapstructure:"system_operation_ttl_seconds"`
|
|
ProcessingTimeoutSeconds int `mapstructure:"processing_timeout_seconds"`
|
|
FailedRetryBackoffSeconds int `mapstructure:"failed_retry_backoff_seconds"`
|
|
MaxStoredResponseLen int `mapstructure:"max_stored_response_len"`
|
|
CleanupIntervalSeconds int `mapstructure:"cleanup_interval_seconds"`
|
|
CleanupBatchSize int `mapstructure:"cleanup_batch_size"`
|
|
}
|
|
|
|
// LinuxDoConnectConfig LinuxDo 连接配置
|
|
type LinuxDoConnectConfig struct {
|
|
Enabled bool `mapstructure:"enabled"`
|
|
ClientID string `mapstructure:"client_id"`
|
|
ClientSecret string `mapstructure:"client_secret"`
|
|
AuthorizeURL string `mapstructure:"authorize_url"`
|
|
TokenURL string `mapstructure:"token_url"`
|
|
UserInfoURL string `mapstructure:"userinfo_url"`
|
|
Scopes string `mapstructure:"scopes"`
|
|
RedirectURL string `mapstructure:"redirect_url"`
|
|
FrontendRedirectURL string `mapstructure:"frontend_redirect_url"`
|
|
TokenAuthMethod string `mapstructure:"token_auth_method"`
|
|
UsePKCE bool `mapstructure:"use_pkce"`
|
|
UserInfoEmailPath string `mapstructure:"userinfo_email_path"`
|
|
UserInfoIDPath string `mapstructure:"userinfo_id_path"`
|
|
UserInfoUsernamePath string `mapstructure:"userinfo_username_path"`
|
|
}
|
|
|
|
// OIDCConnectConfig OIDC 连接配置
|
|
type OIDCConnectConfig struct {
|
|
Enabled bool `mapstructure:"enabled"`
|
|
ProviderName string `mapstructure:"provider_name"`
|
|
ClientID string `mapstructure:"client_id"`
|
|
ClientSecret string `mapstructure:"client_secret"`
|
|
IssuerURL string `mapstructure:"issuer_url"`
|
|
DiscoveryURL string `mapstructure:"discovery_url"`
|
|
AuthorizeURL string `mapstructure:"authorize_url"`
|
|
TokenURL string `mapstructure:"token_url"`
|
|
UserInfoURL string `mapstructure:"userinfo_url"`
|
|
JWKSURL string `mapstructure:"jwks_url"`
|
|
Scopes string `mapstructure:"scopes"`
|
|
RedirectURL string `mapstructure:"redirect_url"`
|
|
FrontendRedirectURL string `mapstructure:"frontend_redirect_url"`
|
|
TokenAuthMethod string `mapstructure:"token_auth_method"`
|
|
UsePKCE bool `mapstructure:"use_pkce"`
|
|
ValidateIDToken bool `mapstructure:"validate_id_token"`
|
|
AllowedSigningAlgs string `mapstructure:"allowed_signing_algs"`
|
|
ClockSkewSeconds int `mapstructure:"clock_skew_seconds"`
|
|
RequireEmailVerified bool `mapstructure:"require_email_verified"`
|
|
UserInfoEmailPath string `mapstructure:"userinfo_email_path"`
|
|
UserInfoIDPath string `mapstructure:"userinfo_id_path"`
|
|
UserInfoUsernamePath string `mapstructure:"userinfo_username_path"`
|
|
}
|
|
|
|
// TokenRefreshConfig OAuth Token 自动刷新配置
|
|
type TokenRefreshConfig struct {
|
|
Enabled bool `mapstructure:"enabled"`
|
|
CheckIntervalMinutes int `mapstructure:"check_interval_minutes"`
|
|
RefreshBeforeExpiryHours float64 `mapstructure:"refresh_before_expiry_hours"`
|
|
MaxRetries int `mapstructure:"max_retries"`
|
|
RetryBackoffSeconds int `mapstructure:"retry_backoff_seconds"`
|
|
}
|