From 350bb9524eab6c05c12e86510e54a151c5b16ffd Mon Sep 17 00:00:00 2001 From: piexlmax <303176530@qq.com> Date: Fri, 31 Dec 2021 22:47:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=87=E7=89=87=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E5=90=8E=E7=AB=AF=E9=83=A8=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/api/v1/example/exa_breakpoint_continue.go | 10 ++-------- server/source/system/api.go | 5 +++-- server/source/system/casbin.go | 1 + 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/server/api/v1/example/exa_breakpoint_continue.go b/server/api/v1/example/exa_breakpoint_continue.go index e10db174..a3553446 100644 --- a/server/api/v1/example/exa_breakpoint_continue.go +++ b/server/api/v1/example/exa_breakpoint_continue.go @@ -124,17 +124,11 @@ func (b *FileUploadAndDownloadApi) BreakpointContinueFinish(c *gin.Context) { // @Router /fileUploadAndDownload/removeChunk [post] func (u *FileUploadAndDownloadApi) RemoveChunk(c *gin.Context) { fileMd5 := c.Query("fileMd5") - fileName := c.Query("fileName") - filePath := c.Query("filePath") err := utils.RemoveChunk(fileMd5) - if err != nil { - return - } - err = fileUploadAndDownloadService.DeleteFileChunk(fileMd5, fileName, filePath) if err != nil { global.GVA_LOG.Error("缓存切片删除失败!", zap.Error(err)) - response.FailWithDetailed(exampleRes.FilePathResponse{FilePath: filePath}, "缓存切片删除失败", c) + response.FailWithMessage( "缓存切片删除失败", c) } else { - response.OkWithDetailed(exampleRes.FilePathResponse{FilePath: filePath}, "缓存切片删除成功", c) + response.OkWithMessage("缓存切片删除成功", c) } } diff --git a/server/source/system/api.go b/server/source/system/api.go index 603f9a1b..25667cfd 100644 --- a/server/source/system/api.go +++ b/server/source/system/api.go @@ -60,8 +60,9 @@ func (a *api) Initialize() error { {ApiGroup: "菜单", Method: "POST", Path: "/menu/addMenuAuthority", Description: "增加menu和角色关联关系"}, {ApiGroup: "分片上传", Method: "POST", Path: "/fileUploadAndDownload/findFile", Description: "寻找目标文件(秒传)"}, - {ApiGroup: "分片上传", Method: "POST", Path: "/fileUploadAndDownload/breakpointContinueFinish", Description: "断点续传"}, - {ApiGroup: "分片上传", Method: "POST", Path: "/fileUploadAndDownload/removeChunk", Description: "上传完成"}, + {ApiGroup: "分片上传", Method: "POST", Path: "/fileUploadAndDownload/breakpointContinue", Description: "断点续传"}, + {ApiGroup: "分片上传", Method: "POST", Path: "/fileUploadAndDownload/breakpointContinueFinish", Description: "断点续传完成"}, + {ApiGroup: "分片上传", Method: "POST", Path: "/fileUploadAndDownload/removeChunk", Description: "上传完成移除文件"}, {ApiGroup: "文件上传与下载", Method: "POST", Path: "/fileUploadAndDownload/upload", Description: "文件上传示例"}, {ApiGroup: "文件上传与下载", Method: "POST", Path: "/fileUploadAndDownload/deleteFile", Description: "删除文件"}, diff --git a/server/source/system/casbin.go b/server/source/system/casbin.go index b8edaae7..dfeba6a6 100644 --- a/server/source/system/casbin.go +++ b/server/source/system/casbin.go @@ -56,6 +56,7 @@ func (c *casbin) Initialize() error { {PType: "p", V0: "888", V1: "/fileUploadAndDownload/findFile", V2: "GET"}, {PType: "p", V0: "888", V1: "/fileUploadAndDownload/breakpointContinueFinish", V2: "POST"}, + {PType: "p", V0: "888", V1: "/fileUploadAndDownload/breakpointContinue", V2: "POST"}, {PType: "p", V0: "888", V1: "/fileUploadAndDownload/removeChunk", V2: "POST"}, {PType: "p", V0: "888", V1: "/fileUploadAndDownload/upload", V2: "POST"}, -- GitLab