Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
isayme committed Aug 25, 2023
1 parent 50d7802 commit e654998
Show file tree
Hide file tree
Showing 10 changed files with 346 additions and 680 deletions.
543 changes: 56 additions & 487 deletions adrive/client.go

Large diffs are not rendered by default.

46 changes: 0 additions & 46 deletions adrive/constant.go

This file was deleted.

19 changes: 10 additions & 9 deletions adrive/fileinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@ package adrive
import (
"io/fs"
"time"

"github.com/isayme/go-alipanopen"
)

var _ fs.FileInfo = &FileInfo{}

type FileInfo struct {
FileName string `json:"name"`
FileSize int64 `json:"size"`
UpdatedAt time.Time `json:"updated_at"`
ContentHash string `json:"content_hash"`
Type string `json:"type"`
DriveId string `json:"drive_id"`
FileId string `json:"file_id"`
ParentFileId string `json:"parent_file_id"`
*alipanopen.File
}

func NewFileInfo(file *alipanopen.File) *FileInfo {
return &FileInfo{
File: file,
}
}

func (f *FileInfo) Name() string {
Expand All @@ -40,7 +41,7 @@ func (f *FileInfo) ModTime() time.Time {
}

func (f *FileInfo) IsDir() bool {
return f.Type == FILE_TYPE_FOLDER
return f.Type == alipanopen.FILE_TYPE_FOLDER
}

func (f *FileInfo) Sys() any {
Expand Down
Loading

0 comments on commit e654998

Please sign in to comment.