🚧 合并get与list
This commit is contained in:
@ -22,16 +22,16 @@ func BuildTree() error {
|
||||
return err
|
||||
}
|
||||
rootFile := File{
|
||||
ParentPath: "/",
|
||||
FileId: conf.Conf.AliDrive.RootFolder,
|
||||
Name: "root",
|
||||
Type: "folder",
|
||||
Dir: "",
|
||||
FileId: conf.Conf.AliDrive.RootFolder,
|
||||
Name: "root",
|
||||
Type: "folder",
|
||||
}
|
||||
if err := tx.Create(&rootFile).Error; err != nil {
|
||||
tx.Rollback()
|
||||
return err
|
||||
}
|
||||
if err := BuildOne(conf.Conf.AliDrive.RootFolder, "/root/", tx, ""); err != nil {
|
||||
if err := BuildOne(conf.Conf.AliDrive.RootFolder, "root/", tx, ""); err != nil {
|
||||
tx.Rollback()
|
||||
return err
|
||||
}
|
||||
@ -55,7 +55,7 @@ func BuildOne(parent string, path string, tx *gorm.DB, parentPassword string) er
|
||||
password = file.Name[index+10:]
|
||||
}
|
||||
newFile := File{
|
||||
ParentPath: path,
|
||||
Dir: path,
|
||||
FileExtension: file.FileExtension,
|
||||
FileId: file.FileId,
|
||||
Name: name,
|
||||
|
Reference in New Issue
Block a user