This commit is contained in:
2026-08-16 01:19:10 +08:00
parent c4b114762b
commit c554152f4f
43 changed files with 1311 additions and 318 deletions
+9 -1
View File
@@ -8,6 +8,7 @@ import (
"net/url"
"path"
"strings"
"time"
cos "github.com/tencentyun/cos-go-sdk-v5"
"kra/internal/biz"
@@ -107,7 +108,14 @@ func (s *tencentStorage) List(ctx context.Context, prefix, cursor string, limit
}
items := make([]*biz.StoredFile, 0, len(result.Contents))
for _, object := range result.Contents {
items = append(items, s.file(object.Key, object.Size))
item := s.file(object.Key, object.Size)
for _, layout := range []string{time.RFC3339, "2006-01-02T15:04:05.000Z"} {
if parsed, parseErr := time.Parse(layout, object.LastModified); parseErr == nil {
item.LastModified = parsed
break
}
}
items = append(items, item)
}
next := result.NextMarker
if result.IsTruncated && next == "" && len(result.Contents) > 0 {