fix(ci): fix backend unit test constructor arg and gofmt issues
This commit is contained in:
@@ -154,8 +154,8 @@ type UpdateSettingsRequest struct {
|
|||||||
SoraClientEnabled bool `json:"sora_client_enabled"`
|
SoraClientEnabled bool `json:"sora_client_enabled"`
|
||||||
|
|
||||||
// 默认配置
|
// 默认配置
|
||||||
DefaultConcurrency int `json:"default_concurrency"`
|
DefaultConcurrency int `json:"default_concurrency"`
|
||||||
DefaultBalance float64 `json:"default_balance"`
|
DefaultBalance float64 `json:"default_balance"`
|
||||||
DefaultSubscriptions []dto.DefaultSubscriptionSetting `json:"default_subscriptions"`
|
DefaultSubscriptions []dto.DefaultSubscriptionSetting `json:"default_subscriptions"`
|
||||||
|
|
||||||
// Model fallback configuration
|
// Model fallback configuration
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ type SystemSettings struct {
|
|||||||
PurchaseSubscriptionURL string `json:"purchase_subscription_url"`
|
PurchaseSubscriptionURL string `json:"purchase_subscription_url"`
|
||||||
SoraClientEnabled bool `json:"sora_client_enabled"`
|
SoraClientEnabled bool `json:"sora_client_enabled"`
|
||||||
|
|
||||||
DefaultConcurrency int `json:"default_concurrency"`
|
DefaultConcurrency int `json:"default_concurrency"`
|
||||||
DefaultBalance float64 `json:"default_balance"`
|
DefaultBalance float64 `json:"default_balance"`
|
||||||
DefaultSubscriptions []DefaultSubscriptionSetting `json:"default_subscriptions"`
|
DefaultSubscriptions []DefaultSubscriptionSetting `json:"default_subscriptions"`
|
||||||
|
|
||||||
// Model fallback configuration
|
// Model fallback configuration
|
||||||
|
|||||||
@@ -56,15 +56,15 @@ type JWTClaims struct {
|
|||||||
|
|
||||||
// AuthService 认证服务
|
// AuthService 认证服务
|
||||||
type AuthService struct {
|
type AuthService struct {
|
||||||
userRepo UserRepository
|
userRepo UserRepository
|
||||||
redeemRepo RedeemCodeRepository
|
redeemRepo RedeemCodeRepository
|
||||||
refreshTokenCache RefreshTokenCache
|
refreshTokenCache RefreshTokenCache
|
||||||
cfg *config.Config
|
cfg *config.Config
|
||||||
settingService *SettingService
|
settingService *SettingService
|
||||||
emailService *EmailService
|
emailService *EmailService
|
||||||
turnstileService *TurnstileService
|
turnstileService *TurnstileService
|
||||||
emailQueueService *EmailQueueService
|
emailQueueService *EmailQueueService
|
||||||
promoService *PromoService
|
promoService *PromoService
|
||||||
defaultSubAssigner DefaultSubscriptionAssigner
|
defaultSubAssigner DefaultSubscriptionAssigner
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,15 +86,15 @@ func NewAuthService(
|
|||||||
defaultSubAssigner DefaultSubscriptionAssigner,
|
defaultSubAssigner DefaultSubscriptionAssigner,
|
||||||
) *AuthService {
|
) *AuthService {
|
||||||
return &AuthService{
|
return &AuthService{
|
||||||
userRepo: userRepo,
|
userRepo: userRepo,
|
||||||
redeemRepo: redeemRepo,
|
redeemRepo: redeemRepo,
|
||||||
refreshTokenCache: refreshTokenCache,
|
refreshTokenCache: refreshTokenCache,
|
||||||
cfg: cfg,
|
cfg: cfg,
|
||||||
settingService: settingService,
|
settingService: settingService,
|
||||||
emailService: emailService,
|
emailService: emailService,
|
||||||
turnstileService: turnstileService,
|
turnstileService: turnstileService,
|
||||||
emailQueueService: emailQueueService,
|
emailQueueService: emailQueueService,
|
||||||
promoService: promoService,
|
promoService: promoService,
|
||||||
defaultSubAssigner: defaultSubAssigner,
|
defaultSubAssigner: defaultSubAssigner,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ func newAuthServiceForRegisterTurnstileTest(settings map[string]string, verifier
|
|||||||
turnstileService,
|
turnstileService,
|
||||||
nil, // emailQueueService
|
nil, // emailQueueService
|
||||||
nil, // promoService
|
nil, // promoService
|
||||||
|
nil, // defaultSubAssigner
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -117,9 +117,9 @@ const (
|
|||||||
SettingKeyPurchaseSubscriptionURL = "purchase_subscription_url" // “购买订阅”页面 URL(作为 iframe src)
|
SettingKeyPurchaseSubscriptionURL = "purchase_subscription_url" // “购买订阅”页面 URL(作为 iframe src)
|
||||||
|
|
||||||
// 默认配置
|
// 默认配置
|
||||||
SettingKeyDefaultConcurrency = "default_concurrency" // 新用户默认并发量
|
SettingKeyDefaultConcurrency = "default_concurrency" // 新用户默认并发量
|
||||||
SettingKeyDefaultBalance = "default_balance" // 新用户默认余额
|
SettingKeyDefaultBalance = "default_balance" // 新用户默认余额
|
||||||
SettingKeyDefaultSubscriptions = "default_subscriptions" // 新用户默认订阅列表(JSON)
|
SettingKeyDefaultSubscriptions = "default_subscriptions" // 新用户默认订阅列表(JSON)
|
||||||
|
|
||||||
// 管理员 API Key
|
// 管理员 API Key
|
||||||
SettingKeyAdminAPIKey = "admin_api_key" // 全局管理员 API Key(用于外部系统集成)
|
SettingKeyAdminAPIKey = "admin_api_key" // 全局管理员 API Key(用于外部系统集成)
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ type SystemSettings struct {
|
|||||||
PurchaseSubscriptionURL string
|
PurchaseSubscriptionURL string
|
||||||
SoraClientEnabled bool
|
SoraClientEnabled bool
|
||||||
|
|
||||||
DefaultConcurrency int
|
DefaultConcurrency int
|
||||||
DefaultBalance float64
|
DefaultBalance float64
|
||||||
DefaultSubscriptions []DefaultSubscriptionSetting
|
DefaultSubscriptions []DefaultSubscriptionSetting
|
||||||
|
|
||||||
// Model fallback configuration
|
// Model fallback configuration
|
||||||
|
|||||||
Reference in New Issue
Block a user