feat: show

This commit is contained in:
zhaoyupeng
2024-10-11 18:36:59 +08:00
parent f54ed67f0f
commit edfb7bee2e
6 changed files with 24 additions and 9 deletions

View File

@ -78,7 +78,7 @@ func (c *Client) ListFile(ctx context.Context, bucket string, prefix string) ([]
name := strings.TrimPrefix(*item.Prefix, prefix)
return &ListFileRes{
Name: name,
Key: name,
Key: *item.Prefix,
Type: ListFileTypeDir,
}, name != ""
},
@ -88,7 +88,7 @@ func (c *Client) ListFile(ctx context.Context, bucket string, prefix string) ([]
output.Contents,
func(item types.Object, index int) *ListFileRes {
return &ListFileRes{
Key: *item.Key,
Key: strings.Clone(*item.Key),
Name: strings.TrimPrefix(*item.Key, prefix),
LastModified: *item.LastModified,
Size: *item.Size,