Commit 32b4b139 authored by shaw's avatar shaw
Browse files

fix: 修复因移除 SimpleMode 导致的测试编译错误

- 移除 api_contract_test.go 中的 SettingKeySimpleMode 引用
- 移除期望响应中的 simple_mode 字段
- 修复 NewSettingHandler 调用参数数量
parent 31fef105
...@@ -281,7 +281,6 @@ func TestAPIContracts(t *testing.T) { ...@@ -281,7 +281,6 @@ func TestAPIContracts(t *testing.T) {
service.SettingKeyDefaultConcurrency: "5", service.SettingKeyDefaultConcurrency: "5",
service.SettingKeyDefaultBalance: "1.25", service.SettingKeyDefaultBalance: "1.25",
service.SettingKeySimpleMode: "false",
}) })
}, },
method: http.MethodGet, method: http.MethodGet,
...@@ -310,8 +309,7 @@ func TestAPIContracts(t *testing.T) { ...@@ -310,8 +309,7 @@ func TestAPIContracts(t *testing.T) {
"contact_info": "support", "contact_info": "support",
"doc_url": "https://docs.example.com", "doc_url": "https://docs.example.com",
"default_concurrency": 5, "default_concurrency": 5,
"default_balance": 1.25, "default_balance": 1.25
"simple_mode": false
} }
}`, }`,
}, },
...@@ -387,7 +385,7 @@ func newContractDeps(t *testing.T) *contractDeps { ...@@ -387,7 +385,7 @@ func newContractDeps(t *testing.T) *contractDeps {
authHandler := handler.NewAuthHandler(cfg, nil, userService) authHandler := handler.NewAuthHandler(cfg, nil, userService)
apiKeyHandler := handler.NewAPIKeyHandler(apiKeyService) apiKeyHandler := handler.NewAPIKeyHandler(apiKeyService)
usageHandler := handler.NewUsageHandler(usageService, apiKeyService) usageHandler := handler.NewUsageHandler(usageService, apiKeyService)
adminSettingHandler := adminhandler.NewSettingHandler(settingService, nil, nil) adminSettingHandler := adminhandler.NewSettingHandler(settingService, nil)
jwtAuth := func(c *gin.Context) { jwtAuth := func(c *gin.Context) {
c.Set(string(middleware.ContextKeyUser), middleware.AuthSubject{ c.Set(string(middleware.ContextKeyUser), middleware.AuthSubject{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment