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
7b5d4067
authored
Oct 03, 2025
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(openai_image): replace json.Marshal with common.Marshal for improved serialization #1961
parent
b89f9296
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
dto/openai_image.go
+7
-6
No files found.
dto/openai_image.go
View file @
7b5d4067
...
@@ -74,14 +74,15 @@ func (r ImageRequest) MarshalJSON() ([]byte, error) {
...
@@ -74,14 +74,15 @@ func (r ImageRequest) MarshalJSON() ([]byte, error) {
return
nil
,
err
return
nil
,
err
}
}
// 不能合并ExtraFields!!!!!!!!
// 合并 ExtraFields
// 合并 ExtraFields
for
k
,
v
:=
range
r
.
Extra
{
//
for k, v := range r.Extra {
if
_
,
exists
:=
baseMap
[
k
];
!
exists
{
//
if _, exists := baseMap[k]; !exists {
baseMap
[
k
]
=
v
//
baseMap[k] = v
}
//
}
}
//
}
return
js
on
.
Marshal
(
baseMap
)
return
comm
on
.
Marshal
(
baseMap
)
}
}
func
GetJSONFieldNames
(
t
reflect
.
Type
)
map
[
string
]
struct
{}
{
func
GetJSONFieldNames
(
t
reflect
.
Type
)
map
[
string
]
struct
{}
{
...
...
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