优化结构

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
@@ -102,7 +102,7 @@ func (s *qiniuStorage) 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
}
@@ -124,7 +124,7 @@ func (s *qiniuStorage) List(ctx context.Context, prefix, cursor string, limit in
if limit <= 0 {
limit = 100
}
entries, _, marker, more, err := s.manager.ListFiles(s.config.Bucket, prefix, "", cursor, limit)
entries, _, marker, more, err := s.manager.ListFiles(s.config.Bucket, boundedPrefix(strings.TrimPrefix(prefix, "/"), prefix), "", cursor, limit)
if err != nil {
return nil, "", false, err
}