From 7b571499a74f7376b6d29ebedde0d2a78a82d2c3 Mon Sep 17 00:00:00 2001 From: HFO4 <912394456@qq.com> Date: Tue, 21 Apr 2020 09:47:54 +0800 Subject: [PATCH] Feat: forcibly delete files in dashboard (#277) --- service/admin/file.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/service/admin/file.go b/service/admin/file.go index bf8719e..c1a8aa3 100644 --- a/service/admin/file.go +++ b/service/admin/file.go @@ -18,7 +18,8 @@ type FileService struct { // FileBatchService 文件批量操作服务 type FileBatchService struct { - ID []uint `json:"id" binding:"min=1"` + ID []uint `json:"id" binding:"min=1"` + Force bool `json:"force"` } // Delete 删除文件 @@ -58,7 +59,7 @@ func (service *FileBatchService) Delete(c *gin.Context) serializer.Response { } // 执行删除 - fs.Delete(context.Background(), []uint{}, ids, false) + fs.Delete(context.Background(), []uint{}, ids, service.Force) fs.Recycle() } }(userFile)