From fa70fc6d2f93e4acd50d0c6c56d099290cc1d31b Mon Sep 17 00:00:00 2001 From: zyxkad Date: Thu, 29 Feb 2024 21:58:26 -0700 Subject: [PATCH] fix(chaoxing): json cannot unmarshal content.uploadDate (close #6119) --- drivers/chaoxing/types.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/chaoxing/types.go b/drivers/chaoxing/types.go index ba636ec1dd0..c3074bbb721 100644 --- a/drivers/chaoxing/types.go +++ b/drivers/chaoxing/types.go @@ -139,7 +139,7 @@ type File struct { Topsort int `json:"topsort"` Restype string `json:"restype"` Size int_str `json:"size"` - UploadDate string `json:"uploadDate"` + UploadDate int64 `json:"uploadDate"` FileSize string `json:"fileSize"` Name string `json:"name"` FileID string `json:"fileId"` @@ -265,10 +265,7 @@ func fileToObj(f File) *model.Object { IsFolder: true, } } - paserTime, err := time.Parse("2006-01-02 15:04", f.Content.UploadDate) - if err != nil { - paserTime = time.Now() - } + paserTime := time.UnixMilli(f.Content.UploadDate) return &model.Object{ ID: fmt.Sprintf("%d$%s", f.ID, f.Content.FileID), Name: f.Content.Name,