🚧 合并get与list

This commit is contained in:
微凉
2021-03-08 20:26:02 +08:00
parent c0f50ffeff
commit 8636014397
11 changed files with 146 additions and 41 deletions

View File

@ -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,