feat(dashboard): unlink file while not deleting its physical source (#789)

This commit is contained in:
Aaron Liu
2023-02-07 20:07:05 +08:00
parent 2a1e82aede
commit 1c1cd9b342
9 changed files with 28 additions and 22 deletions

View File

@@ -19,8 +19,9 @@ type FileService struct {
// FileBatchService 文件批量操作服务
type FileBatchService struct {
ID []uint `json:"id" binding:"min=1"`
Force bool `json:"force"`
ID []uint `json:"id" binding:"min=1"`
Force bool `json:"force"`
UnlinkOnly bool `json:"unlink"`
}
// ListFolderService 列目录结构
@@ -128,7 +129,7 @@ func (service *FileBatchService) Delete(c *gin.Context) serializer.Response {
}
// 执行删除
fs.Delete(context.Background(), []uint{}, ids, service.Force)
fs.Delete(context.Background(), []uint{}, ids, service.Force, service.UnlinkOnly)
fs.Recycle()
}
}(userFile)