Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions backend/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -10310,6 +10310,11 @@ const docTemplate = `{
"internal_transport_http_channel.UpdateUpstreamRequest": {
"type": "object",
"properties": {
"addAPIKeys": {
"type": "string",
"maxLength": 10000,
"minLength": 2
},
"apiKeys": {
"type": "string",
"maxLength": 10000,
Expand Down Expand Up @@ -10352,6 +10357,12 @@ const docTemplate = `{
"connectTimeoutMS": {
"type": "integer"
},
"deleteAPIKeyIDs": {
"type": "array",
"items": {
"type": "string"
}
},
"headersJSON": {
"type": "string",
"maxLength": 10000
Expand Down Expand Up @@ -10462,6 +10473,26 @@ const docTemplate = `{
}
}
},
"internal_transport_http_channel.UpstreamAPIKeyResponse": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"index": {
"type": "integer"
},
"keyMasked": {
"type": "string"
},
"note": {
"type": "string"
},
"status": {
"type": "string"
}
}
},
"internal_transport_http_channel.UpstreamDataResponse": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -10683,6 +10714,12 @@ const docTemplate = `{
"activeModelsCount": {
"type": "integer"
},
"apiKeyItems": {
"type": "array",
"items": {
"$ref": "#/definitions/internal_transport_http_channel.UpstreamAPIKeyResponse"
}
},
"apiKeysMasked": {
"type": "string"
},
Expand Down
39 changes: 38 additions & 1 deletion backend/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -10303,6 +10303,11 @@
"internal_transport_http_channel.UpdateUpstreamRequest": {
"type": "object",
"properties": {
"addAPIKeys": {
"type": "string",
"maxLength": 10000,
"minLength": 2
},
"apiKeys": {
"type": "string",
"maxLength": 10000,
Expand Down Expand Up @@ -10345,6 +10350,12 @@
"connectTimeoutMS": {
"type": "integer"
},
"deleteAPIKeyIDs": {
"type": "array",
"items": {
"type": "string"
}
},
"headersJSON": {
"type": "string",
"maxLength": 10000
Expand Down Expand Up @@ -10455,6 +10466,26 @@
}
}
},
"internal_transport_http_channel.UpstreamAPIKeyResponse": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"index": {
"type": "integer"
},
"keyMasked": {
"type": "string"
},
"note": {
"type": "string"
},
"status": {
"type": "string"
}
}
},
"internal_transport_http_channel.UpstreamDataResponse": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -10676,6 +10707,12 @@
"activeModelsCount": {
"type": "integer"
},
"apiKeyItems": {
"type": "array",
"items": {
"$ref": "#/definitions/internal_transport_http_channel.UpstreamAPIKeyResponse"
}
},
"apiKeysMasked": {
"type": "string"
},
Expand Down Expand Up @@ -12381,4 +12418,4 @@
"in": "header"
}
}
}
}
27 changes: 26 additions & 1 deletion backend/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2262,6 +2262,10 @@ definitions:
type: object
internal_transport_http_channel.UpdateUpstreamRequest:
properties:
addAPIKeys:
maxLength: 10000
minLength: 2
type: string
apiKeys:
maxLength: 10000
minLength: 2
Expand Down Expand Up @@ -2293,6 +2297,10 @@ definitions:
type: string
connectTimeoutMS:
type: integer
deleteAPIKeyIDs:
items:
type: string
type: array
headersJSON:
maxLength: 10000
type: string
Expand Down Expand Up @@ -2370,6 +2378,19 @@ definitions:
errorMsg:
type: string
type: object
internal_transport_http_channel.UpstreamAPIKeyResponse:
properties:
id:
type: string
index:
type: integer
keyMasked:
type: string
note:
type: string
status:
type: string
type: object
internal_transport_http_channel.UpstreamDataResponse:
properties:
upstream:
Expand Down Expand Up @@ -2514,6 +2535,10 @@ definitions:
properties:
activeModelsCount:
type: integer
apiKeyItems:
items:
$ref: '#/definitions/internal_transport_http_channel.UpstreamAPIKeyResponse'
type: array
apiKeysMasked:
type: string
baseURL:
Expand Down Expand Up @@ -3640,7 +3665,7 @@ info:
contact: {}
description: DEEIX Chat 后端 API 文档
title: DEEIX Chat API
version: "0.1.2"
version: 0.1.2
paths:
/admin/audit-logs:
get:
Expand Down
10 changes: 10 additions & 0 deletions backend/internal/application/channel/dto.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ type UpstreamView struct {
Compatible string
ProtocolDefaultsJSON string
APIKeysMasked string
APIKeyItems []UpstreamAPIKeyView
Status string
ConnectTimeoutMS int
ReadTimeoutMS int
Expand All @@ -119,6 +120,15 @@ type UpstreamView struct {
UpdatedAt string
}

// UpstreamAPIKeyView 表示脱敏后的上游 API Key 展示项。
type UpstreamAPIKeyView struct {
ID string
Index int
KeyMasked string
Status string
Note string
}

// ModelView 模型展示数据(内部传输,不携带序列化标记)。
type ModelView struct {
ID uint
Expand Down
2 changes: 2 additions & 0 deletions backend/internal/application/channel/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ type UpdateUpstreamInput struct {
Compatible *string
ProtocolDefaultsJSON *string
APIKeys *string
AddAPIKeys *string
DeleteAPIKeyIDs []string
Status *string
ConnectTimeoutMS *int
ReadTimeoutMS *int
Expand Down
Loading
Loading