Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
陈曦
sub2api
Commits
0fba1901
Commit
0fba1901
authored
Mar 02, 2026
by
PMExtra
Browse files
fix(ci): fix backend unit test constructor arg and gofmt issues
parent
7e020822
Changes
6
Hide whitespace changes
Inline
Side-by-side
backend/internal/handler/admin/setting_handler.go
View file @
0fba1901
...
@@ -154,8 +154,8 @@ type UpdateSettingsRequest struct {
...
@@ -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
...
...
backend/internal/handler/dto/settings.go
View file @
0fba1901
...
@@ -39,8 +39,8 @@ type SystemSettings struct {
...
@@ -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
...
...
backend/internal/service/auth_service.go
View file @
0fba1901
...
@@ -56,15 +56,15 @@ type JWTClaims struct {
...
@@ -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(
...
@@ -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
,
}
}
}
}
...
...
backend/internal/service/auth_service_turnstile_register_test.go
View file @
0fba1901
...
@@ -52,6 +52,7 @@ func newAuthServiceForRegisterTurnstileTest(settings map[string]string, verifier
...
@@ -52,6 +52,7 @@ func newAuthServiceForRegisterTurnstileTest(settings map[string]string, verifier
turnstileService
,
turnstileService
,
nil
,
// emailQueueService
nil
,
// emailQueueService
nil
,
// promoService
nil
,
// promoService
nil
,
// defaultSubAssigner
)
)
}
}
...
...
backend/internal/service/domain_constants.go
View file @
0fba1901
...
@@ -117,9 +117,9 @@ const (
...
@@ -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(用于外部系统集成)
...
...
backend/internal/service/settings_view.go
View file @
0fba1901
...
@@ -41,8 +41,8 @@ type SystemSettings struct {
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment