Skip to content

Commit 6250635

Browse files
author
piexlmax
committed
修复切片上传后端部分
1 parent 15272bb commit 6250635

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ func (a *api) Initialize() error {
5959
{ApiGroup: "菜单", Method: "POST", Path: "/menu/getMenuAuthority", Description: "获取指定角色menu"},
6060
{ApiGroup: "菜单", Method: "POST", Path: "/menu/addMenuAuthority", Description: "增加menu和角色关联关系"},
6161

62+
{ApiGroup: "分片上传", Method: "POST", Path: "/fileUploadAndDownload/findFile", 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: "上传完成移除文件"},
66+
6267
{ApiGroup: "文件上传与下载", Method: "POST", Path: "/fileUploadAndDownload/upload", Description: "文件上传示例"},
6368
{ApiGroup: "文件上传与下载", Method: "POST", Path: "/fileUploadAndDownload/deleteFile", Description: "删除文件"},
6469
{ApiGroup: "文件上传与下载", Method: "POST", Path: "/fileUploadAndDownload/getFileList", Description: "获取上传文件列表"},

server/source/system/casbin.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ func (c *casbin) Initialize() error {
5454
{PType: "p", V0: "888", V1: "/user/setUserAuthority", V2: "POST"},
5555
{PType: "p", V0: "888", V1: "/user/setUserAuthorities", V2: "POST"},
5656

57+
{PType: "p", V0: "888", V1: "/fileUploadAndDownload/findFile", V2: "GET"},
58+
{PType: "p", V0: "888", V1: "/fileUploadAndDownload/breakpointContinueFinish", V2: "POST"},
59+
{PType: "p", V0: "888", V1: "/fileUploadAndDownload/breakpointContinue", V2: "POST"},
60+
{PType: "p", V0: "888", V1: "/fileUploadAndDownload/removeChunk", V2: "POST"},
61+
5762
{PType: "p", V0: "888", V1: "/fileUploadAndDownload/upload", V2: "POST"},
5863
{PType: "p", V0: "888", V1: "/fileUploadAndDownload/deleteFile", V2: "POST"},
5964
{PType: "p", V0: "888", V1: "/fileUploadAndDownload/getFileList", V2: "POST"},

0 commit comments

Comments
 (0)