Skip to content

Commit 350bb95

Browse files
author
piexlmax
committed
修复切片上传后端部分
1 parent 6db9e99 commit 350bb95

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

server/api/v1/example/exa_breakpoint_continue.go

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,11 @@ func (b *FileUploadAndDownloadApi) BreakpointContinueFinish(c *gin.Context) {
124124
// @Router /fileUploadAndDownload/removeChunk [post]
125125
func (u *FileUploadAndDownloadApi) RemoveChunk(c *gin.Context) {
126126
fileMd5 := c.Query("fileMd5")
127-
fileName := c.Query("fileName")
128-
filePath := c.Query("filePath")
129127
err := utils.RemoveChunk(fileMd5)
130-
if err != nil {
131-
return
132-
}
133-
err = fileUploadAndDownloadService.DeleteFileChunk(fileMd5, fileName, filePath)
134128
if err != nil {
135129
global.GVA_LOG.Error("缓存切片删除失败!", zap.Error(err))
136-
response.FailWithDetailed(exampleRes.FilePathResponse{FilePath: filePath}, "缓存切片删除失败", c)
130+
response.FailWithMessage( "缓存切片删除失败", c)
137131
} else {
138-
response.OkWithDetailed(exampleRes.FilePathResponse{FilePath: filePath}, "缓存切片删除成功", c)
132+
response.OkWithMessage("缓存切片删除成功", c)
139133
}
140134
}

server/source/system/api.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ func (a *api) Initialize() error {
6060
{ApiGroup: "菜单", Method: "POST", Path: "/menu/addMenuAuthority", Description: "增加menu和角色关联关系"},
6161

6262
{ApiGroup: "分片上传", Method: "POST", Path: "/fileUploadAndDownload/findFile", Description: "寻找目标文件(秒传)"},
63-
{ApiGroup: "分片上传", Method: "POST", Path: "/fileUploadAndDownload/breakpointContinueFinish", Description: "断点续传"},
64-
{ApiGroup: "分片上传", Method: "POST", Path: "/fileUploadAndDownload/removeChunk", Description: "上传完成"},
63+
{ApiGroup: "分片上传", Method: "POST", Path: "/fileUploadAndDownload/breakpointContinue", Description: "断点续传"},
64+
{ApiGroup: "分片上传", Method: "POST", Path: "/fileUploadAndDownload/breakpointContinueFinish", Description: "断点续传完成"},
65+
{ApiGroup: "分片上传", Method: "POST", Path: "/fileUploadAndDownload/removeChunk", Description: "上传完成移除文件"},
6566

6667
{ApiGroup: "文件上传与下载", Method: "POST", Path: "/fileUploadAndDownload/upload", Description: "文件上传示例"},
6768
{ApiGroup: "文件上传与下载", Method: "POST", Path: "/fileUploadAndDownload/deleteFile", Description: "删除文件"},

server/source/system/casbin.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ func (c *casbin) Initialize() error {
5656

5757
{PType: "p", V0: "888", V1: "/fileUploadAndDownload/findFile", V2: "GET"},
5858
{PType: "p", V0: "888", V1: "/fileUploadAndDownload/breakpointContinueFinish", V2: "POST"},
59+
{PType: "p", V0: "888", V1: "/fileUploadAndDownload/breakpointContinue", V2: "POST"},
5960
{PType: "p", V0: "888", V1: "/fileUploadAndDownload/removeChunk", V2: "POST"},
6061

6162
{PType: "p", V0: "888", V1: "/fileUploadAndDownload/upload", V2: "POST"},

0 commit comments

Comments
 (0)