refactor(openai_image): replace json.Marshal with common.Marshal for improved serialization #1961

This commit is contained in:
CaIon
2025-10-03 12:44:33 +08:00
parent 5c6e6032ef
commit 6b75bc0016

View File

@@ -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 json.Marshal(baseMap) return common.Marshal(baseMap)
} }
func GetJSONFieldNames(t reflect.Type) map[string]struct{} { func GetJSONFieldNames(t reflect.Type) map[string]struct{} {