Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
896f3906
authored
Jul 06, 2025
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🔧
refactor(channel): replace common.ChannelTypeVertexAi with constant.ChannelTypeVertexAi
parent
7ddee5ea
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
9 deletions
+2
-9
controller/channel.go
+2
-9
No files found.
controller/channel.go
View file @
896f3906
...
@@ -437,7 +437,7 @@ func AddChannel(c *gin.Context) {
...
@@ -437,7 +437,7 @@ func AddChannel(c *gin.Context) {
switch
addChannelRequest
.
Mode
{
switch
addChannelRequest
.
Mode
{
case
"multi_to_single"
:
case
"multi_to_single"
:
addChannelRequest
.
Channel
.
ChannelInfo
.
MultiKeyMode
=
true
addChannelRequest
.
Channel
.
ChannelInfo
.
MultiKeyMode
=
true
if
addChannelRequest
.
Channel
.
Type
==
co
mmon
.
ChannelTypeVertexAi
{
if
addChannelRequest
.
Channel
.
Type
==
co
nstant
.
ChannelTypeVertexAi
{
if
!
common
.
IsJsonStr
(
addChannelRequest
.
Channel
.
Key
)
{
if
!
common
.
IsJsonStr
(
addChannelRequest
.
Channel
.
Key
)
{
c
.
JSON
(
http
.
StatusOK
,
gin
.
H
{
c
.
JSON
(
http
.
StatusOK
,
gin
.
H
{
"success"
:
false
,
"success"
:
false
,
...
@@ -464,15 +464,8 @@ func AddChannel(c *gin.Context) {
...
@@ -464,15 +464,8 @@ func AddChannel(c *gin.Context) {
}
}
keys
=
[]
string
{
addChannelRequest
.
Channel
.
Key
}
keys
=
[]
string
{
addChannelRequest
.
Channel
.
Key
}
case
"batch"
:
case
"batch"
:
if
addChannelRequest
.
Channel
.
Type
==
co
mmon
.
ChannelTypeVertexAi
{
if
addChannelRequest
.
Channel
.
Type
==
co
nstant
.
ChannelTypeVertexAi
{
// multi json
// multi json
if
!
common
.
IsJsonStr
(
addChannelRequest
.
Channel
.
Key
)
{
c
.
JSON
(
http
.
StatusOK
,
gin
.
H
{
"success"
:
false
,
"message"
:
"Vertex AI 批量添加模式必须使用标准的JsonArray格式,例如[{key1}, {key2}...],请检查输入"
,
})
return
}
toMap
:=
common
.
StrToMap
(
addChannelRequest
.
Channel
.
Key
)
toMap
:=
common
.
StrToMap
(
addChannelRequest
.
Channel
.
Key
)
if
toMap
==
nil
{
if
toMap
==
nil
{
c
.
JSON
(
http
.
StatusOK
,
gin
.
H
{
c
.
JSON
(
http
.
StatusOK
,
gin
.
H
{
...
...
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