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
Unverified
Commit
9ffb85a3
authored
Apr 08, 2026
by
Calcium-Ion
Committed by
GitHub
Apr 08, 2026
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4068 from feitianbubu/seedance-support-duration
Seedance support duration
parents
a057edda
b713e277
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletions
+19
-1
relay/common/relay_info.go
+16
-0
relay/common/relay_utils.go
+3
-1
No files found.
relay/common/relay_info.go
View file @
9ffb85a3
...
@@ -4,6 +4,7 @@ import (
...
@@ -4,6 +4,7 @@ import (
"encoding/json"
"encoding/json"
"errors"
"errors"
"fmt"
"fmt"
"strconv"
"strings"
"strings"
"time"
"time"
...
@@ -690,6 +691,7 @@ func (t *TaskSubmitReq) UnmarshalJSON(data []byte) error {
...
@@ -690,6 +691,7 @@ func (t *TaskSubmitReq) UnmarshalJSON(data []byte) error {
type
Alias
TaskSubmitReq
type
Alias
TaskSubmitReq
aux
:=
&
struct
{
aux
:=
&
struct
{
Metadata
json
.
RawMessage
`json:"metadata,omitempty"`
Metadata
json
.
RawMessage
`json:"metadata,omitempty"`
Duration
json
.
RawMessage
`json:"duration,omitempty"`
*
Alias
*
Alias
}{
}{
Alias
:
(
*
Alias
)(
t
),
Alias
:
(
*
Alias
)(
t
),
...
@@ -699,6 +701,20 @@ func (t *TaskSubmitReq) UnmarshalJSON(data []byte) error {
...
@@ -699,6 +701,20 @@ func (t *TaskSubmitReq) UnmarshalJSON(data []byte) error {
return
err
return
err
}
}
if
len
(
aux
.
Duration
)
>
0
{
var
durationInt
int
if
err
:=
common
.
Unmarshal
(
aux
.
Duration
,
&
durationInt
);
err
==
nil
{
t
.
Duration
=
durationInt
}
else
{
var
durationStr
string
if
err
:=
common
.
Unmarshal
(
aux
.
Duration
,
&
durationStr
);
err
==
nil
&&
durationStr
!=
""
{
if
v
,
err
:=
strconv
.
Atoi
(
durationStr
);
err
==
nil
{
t
.
Duration
=
v
}
}
}
}
if
len
(
aux
.
Metadata
)
>
0
{
if
len
(
aux
.
Metadata
)
>
0
{
var
metadataStr
string
var
metadataStr
string
if
err
:=
common
.
Unmarshal
(
aux
.
Metadata
,
&
metadataStr
);
err
==
nil
&&
metadataStr
!=
""
{
if
err
:=
common
.
Unmarshal
(
aux
.
Metadata
,
&
metadataStr
);
err
==
nil
&&
metadataStr
!=
""
{
...
...
relay/common/relay_utils.go
View file @
9ffb85a3
...
@@ -204,7 +204,9 @@ func ValidateBasicTaskRequest(c *gin.Context, info *RelayInfo, action string) *d
...
@@ -204,7 +204,9 @@ func ValidateBasicTaskRequest(c *gin.Context, info *RelayInfo, action string) *d
if
err
!=
nil
{
if
err
!=
nil
{
return
createTaskError
(
err
,
"invalid_multipart_form"
,
http
.
StatusBadRequest
,
true
)
return
createTaskError
(
err
,
"invalid_multipart_form"
,
http
.
StatusBadRequest
,
true
)
}
}
}
else
if
err
:=
common
.
UnmarshalBodyReusable
(
c
,
&
req
);
err
!=
nil
{
}
// 为了metadata字段的兼容性,统一UnmarshalBodyReusable
if
err
:=
common
.
UnmarshalBodyReusable
(
c
,
&
req
);
err
!=
nil
{
return
createTaskError
(
err
,
"invalid_request"
,
http
.
StatusBadRequest
,
true
)
return
createTaskError
(
err
,
"invalid_request"
,
http
.
StatusBadRequest
,
true
)
}
}
...
...
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