mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Feat: adapt major methods of WebDAV for Cloudreve file system
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"github.com/HFO4/cloudreve/pkg/util"
|
||||
"github.com/jinzhu/gorm"
|
||||
"path"
|
||||
"time"
|
||||
)
|
||||
|
||||
// File 文件
|
||||
@@ -166,3 +167,22 @@ func (file *File) UpdatePicInfo(value string) error {
|
||||
func (file *File) UpdateSize(value uint64) error {
|
||||
return DB.Model(&file).Update("size", value).Error
|
||||
}
|
||||
|
||||
/*
|
||||
实现 FileInfo.FileInfo 接口
|
||||
TODO 测试
|
||||
*/
|
||||
|
||||
func (file *File) GetName() string {
|
||||
return file.Name
|
||||
}
|
||||
|
||||
func (file *File) GetSize() uint64 {
|
||||
return file.Size
|
||||
}
|
||||
func (file *File) ModTime() time.Time {
|
||||
return file.UpdatedAt
|
||||
}
|
||||
func (file *File) IsDir() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user