优化结构

This commit is contained in:
Yvan
2026-08-22 23:02:44 +08:00
parent b18baf1547
commit 64459574b2
16 changed files with 158 additions and 73 deletions
@@ -88,7 +88,7 @@ func (s *tencentStorage) DeletePrefix(ctx context.Context, prefix string) error
}
cursor := ""
for {
items, next, more, err := s.List(ctx, prefix, cursor, 1000)
items, next, more, err := s.List(ctx, prefix+"/", cursor, 1000)
if err != nil {
return err
}
@@ -110,7 +110,7 @@ func (s *tencentStorage) List(ctx context.Context, prefix, cursor string, limit
if limit <= 0 {
limit = 100
}
result, _, err := s.client.Bucket.Get(ctx, &cos.BucketGetOptions{Prefix: s.key(prefix), Marker: cursor, MaxKeys: limit})
result, _, err := s.client.Bucket.Get(ctx, &cos.BucketGetOptions{Prefix: boundedPrefix(s.key(prefix), prefix), Marker: cursor, MaxKeys: limit})
if err != nil {
return nil, "", false, err
}