Skip to content

Commit 1c16cc8

Browse files
committed
fix: 移除未使用的 getGroupRootByCloudID 函数
Signed-off-by: MadDogOwner <xiaoran@xrgzs.top>
1 parent b1a32c1 commit 1c16cc8

1 file changed

Lines changed: 0 additions & 38 deletions

File tree

drivers/139/util.go

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,44 +1302,6 @@ func (d *Yun139) handleMetaGroupCopy(ctx context.Context, srcObj, dstDir model.O
13021302
return err
13031303
}
13041304

1305-
// getGroupRootByCloudID 查询 group 上层信息,优先返回 parentCatalogID,回退到 catalogList[0].path
1306-
func (d *Yun139) getGroupRootByCloudID(cloudID string) (string, error) {
1307-
pathname := "/orchestration/group-rebuild/catalog/v1.0/queryGroupContentList"
1308-
body := base.Json{
1309-
"groupID": cloudID,
1310-
"commonAccountInfo": base.Json{
1311-
"account": d.getAccount(),
1312-
"accountType": 1,
1313-
},
1314-
"pageInfo": base.Json{
1315-
"pageNum": 1,
1316-
"pageSize": 1,
1317-
},
1318-
}
1319-
var resp base.Json
1320-
_, err := d.post(pathname, body, &resp)
1321-
if err != nil {
1322-
return "", err
1323-
}
1324-
dataObj, _ := resp["data"].(map[string]interface{})
1325-
if dataObj == nil {
1326-
return "", fmt.Errorf("invalid group response data")
1327-
}
1328-
if gcr, ok := dataObj["getGroupContentResult"].(map[string]interface{}); ok {
1329-
if pid, ok := gcr["parentCatalogID"].(string); ok && pid != "" {
1330-
return pid, nil
1331-
}
1332-
if cl, ok := gcr["catalogList"].([]interface{}); ok && len(cl) > 0 {
1333-
if first, ok := cl[0].(map[string]interface{}); ok {
1334-
if p, ok := first["path"].(string); ok && p != "" {
1335-
return p, nil
1336-
}
1337-
}
1338-
}
1339-
}
1340-
return "", fmt.Errorf("no root found in group response")
1341-
}
1342-
13431305
// getFamilyRootPath 查询 family 的上层 path(data.path)
13441306
// 返回值已去除前缀 "root:/"(或 "root:"),直接返回纯 ID 或 path 部分,便于持久化为 RootFolderID。
13451307
func (d *Yun139) getFamilyRootPath(cloudID string) (string, error) {

0 commit comments

Comments
 (0)