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
39a2d552
authored
Aug 28, 2024
by
CalciumIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 检测vertex渠道部署地区是否填写
parent
5d8151af
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletions
+22
-1
controller/channel.go
+22
-1
No files found.
controller/channel.go
View file @
39a2d552
...
...
@@ -212,7 +212,7 @@ func AddChannel(c *gin.Context) {
if
regionMap
[
"default"
]
==
nil
{
c
.
JSON
(
http
.
StatusOK
,
gin
.
H
{
"success"
:
false
,
"message"
:
"必须包含default字段"
,
"message"
:
"
部署地区
必须包含default字段"
,
})
return
}
...
...
@@ -319,6 +319,27 @@ func UpdateChannel(c *gin.Context) {
})
return
}
if
channel
.
Type
==
common
.
ChannelTypeVertexAi
{
if
channel
.
Other
==
""
{
c
.
JSON
(
http
.
StatusOK
,
gin
.
H
{
"success"
:
false
,
"message"
:
"部署地区不能为空"
,
})
return
}
else
{
if
common
.
IsJsonStr
(
channel
.
Other
)
{
// must have default
regionMap
:=
common
.
StrToMap
(
channel
.
Other
)
if
regionMap
[
"default"
]
==
nil
{
c
.
JSON
(
http
.
StatusOK
,
gin
.
H
{
"success"
:
false
,
"message"
:
"部署地区必须包含default字段"
,
})
return
}
}
}
}
err
=
channel
.
Update
()
if
err
!=
nil
{
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