mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Feat: add option to force delete file record in database
This commit is contained in:
@@ -58,7 +58,7 @@ func (service *FileBatchService) Delete(c *gin.Context) serializer.Response {
|
||||
}
|
||||
|
||||
// 执行删除
|
||||
fs.Delete(context.Background(), []uint{}, ids)
|
||||
fs.Delete(context.Background(), []uint{}, ids, false)
|
||||
fs.Recycle()
|
||||
}
|
||||
}(userFile)
|
||||
|
||||
@@ -65,7 +65,7 @@ func (service *UserBatchService) Delete() serializer.Response {
|
||||
if err != nil {
|
||||
return serializer.Err(serializer.CodeNotFound, "无法找到用户根目录", err)
|
||||
}
|
||||
fs.Delete(context.Background(), []uint{root.ID}, []uint{})
|
||||
fs.Delete(context.Background(), []uint{root.ID}, []uint{}, false)
|
||||
|
||||
// 删除相关任务
|
||||
model.DB.Where("user_id = ?", uid).Delete(&model.Download{})
|
||||
|
||||
@@ -264,7 +264,7 @@ func (service *ItemIDService) Delete(ctx context.Context, c *gin.Context) serial
|
||||
|
||||
// 删除对象
|
||||
items := service.Raw()
|
||||
err = fs.Delete(ctx, items.Dirs, items.Items)
|
||||
err = fs.Delete(ctx, items.Dirs, items.Items, false)
|
||||
if err != nil {
|
||||
return serializer.Err(serializer.CodeNotSet, err.Error(), err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user