From 1e2e2e4b0d56c1448e7fa9ceb77092e73af886a0 Mon Sep 17 00:00:00 2001 From: Sydonian <794346190@qq.com> Date: Fri, 28 Feb 2025 09:52:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=AF=B9=E8=B1=A1=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E6=8E=A5=E5=8F=A3=E6=94=AF=E6=8C=81=E5=8F=AA=E9=9D=9E?= =?UTF-8?q?=E9=80=92=E5=BD=92=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sdks/storage/cdsapi/object.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sdks/storage/cdsapi/object.go b/sdks/storage/cdsapi/object.go index e3486fb..e5a8f61 100644 --- a/sdks/storage/cdsapi/object.go +++ b/sdks/storage/cdsapi/object.go @@ -28,13 +28,16 @@ func (c *Client) Object() *ObjectService { const ObjectListPathByPath = "/object/listByPath" type ObjectListByPath struct { - UserID cdssdk.UserID `form:"userID" binding:"required"` - PackageID cdssdk.PackageID `form:"packageID" binding:"required"` - Path string `form:"path"` // 允许为空字符串 - IsPrefix bool `form:"isPrefix"` + UserID cdssdk.UserID `form:"userID" binding:"required"` + PackageID cdssdk.PackageID `form:"packageID" binding:"required"` + Path string `form:"path"` // 允许为空字符串 + IsPrefix bool `form:"isPrefix"` + NoRecursive bool `form:"noRecursive"` // 仅当isPrefix为true时有效,表示仅查询直接属于Prefix下的对象,对于更深的对象,返回它们的公共前缀 + } type ObjectListByPathResp struct { - Objects []cdssdk.Object `json:"objects"` + CommonPrefixes []string `json:"commonPrefixes"` // 仅在IsPrefix为true且NoRecursive为true时有效,包含更深层对象的shared prefix + Objects []cdssdk.Object `json:"objects"` // 如果IsPrefix为true且NoRecursive为false,则返回所有匹配的对象,否则只返回直接属于Prefix下的对象 } func (c *ObjectService) ListByPath(req ObjectListByPath) (*ObjectListByPathResp, error) {