mirror of
https://github.com/cloudreve/Cloudreve.git
synced 2026-11-05 16:38:06 +00:00
Feat: move files/directories
This commit is contained in:
1 parent
081c92067f
commit
fd02425547
9 files changed
+189
-14
No files matched your search
@@ -20,3 +20,18 @@ func Delete(c *gin.Context) {
|
||||
c.JSON(200, ErrorResponse(err))
|
||||
}
|
||||
}
|
||||
|
||||
// Move 移动文件或目录
|
||||
func Move(c *gin.Context) {
|
||||
// 创建上下文
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
|
||||
var service explorer.ItemMoveService
|
||||
if err := c.ShouldBindJSON(&service); err == nil {
|
||||
res := service.Move(ctx, c)
|
||||
c.JSON(200, res)
|
||||
} else {
|
||||
c.JSON(200, ErrorResponse(err))
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user