feat(fs): add cross-storage move support (#211)

* feat(fs): add cross-storage move support

* fix(fs): add check before moving files

* fix(fs): changed error detect method

---------

Co-authored-by: ShenLin <773933146@qq.com>
This commit is contained in:
ILoveScratch
2025-06-20 17:54:24 +08:00
committed by GitHub
parent ca55b89322
commit 0f5ed14fe2
8 changed files with 223 additions and 2 deletions
+12 -2
View File
@@ -96,14 +96,24 @@ func FsMove(c *gin.Context) {
}
}
}
var addedTasks []task.TaskExtensionInfo
for i, name := range req.Names {
err := fs.Move(c, stdpath.Join(srcDir, name), dstDir, len(req.Names) > i+1)
t, err := fs.MoveWithTask(c, stdpath.Join(srcDir, name), dstDir, len(req.Names) > i+1)
if t != nil {
addedTasks = append(addedTasks, t)
}
if err != nil {
common.ErrorResp(c, err, 500)
return
}
}
common.SuccessResp(c)
if len(addedTasks) > 0 {
common.SuccessResp(c, gin.H{
"tasks": getTaskInfos(addedTasks),
})
} else {
common.SuccessResp(c)
}
}
func FsCopy(c *gin.Context) {