mirror of
https://github.com/OpenListTeam/OpenList.git
synced 2026-06-09 11:23:08 +08:00
fix(189pc): handle numeric res_code in RenameResp to fix JSON unmarshal error (#2489)
This commit is contained in:
@@ -293,7 +293,7 @@ func (y *Cloud189PC) Rename(ctx context.Context, srcObj model.Obj, newName strin
|
||||
req.SetContext(ctx).SetQueryParams(queryParam)
|
||||
}, nil, resp, isFamily)
|
||||
if err != nil {
|
||||
if resp.ResCode == "FileAlreadyExists" {
|
||||
if code, ok := resp.ResCode.(string); ok && code == "FileAlreadyExists" {
|
||||
return nil, errs.ObjectAlreadyExists
|
||||
}
|
||||
return nil, err
|
||||
|
||||
@@ -441,7 +441,7 @@ type RenameResp struct {
|
||||
ParentID int64 `json:"parentId"`
|
||||
Rev string `json:"rev"`
|
||||
Size int64 `json:"size"`
|
||||
ResCode string `json:"res_code"`
|
||||
ResCode any `json:"res_code"` // int or string
|
||||
}
|
||||
|
||||
func (r *RenameResp) toFile(f *Cloud189File) *Cloud189File {
|
||||
|
||||
Reference in New Issue
Block a user