mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Test: modified folder methods and filesystem
This commit is contained in:
@@ -22,7 +22,7 @@ type File struct {
|
||||
Policy Policy `gorm:"PRELOAD:false,association_autoupdate:false"`
|
||||
|
||||
// 数据库忽略字段
|
||||
PositionTemp string `gorm:"-"`
|
||||
Position string `gorm:"-"`
|
||||
}
|
||||
|
||||
// Create 创建文件记录
|
||||
@@ -40,7 +40,7 @@ func (folder *Folder) GetChildFile(name string) (*File, error) {
|
||||
result := DB.Where("folder_id = ? AND name = ?", folder.ID, name).Find(&file)
|
||||
|
||||
if result.Error == nil {
|
||||
file.PositionTemp = path.Join(folder.PositionTemp, folder.Name, file.Name)
|
||||
file.Position = path.Join(folder.Position, folder.Name, file.Name)
|
||||
}
|
||||
return &file, result.Error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user