|
@ -2,6 +2,7 @@ package example |
|
|
|
|
|
|
|
|
import ( |
|
|
import ( |
|
|
"fmt" |
|
|
"fmt" |
|
|
|
|
|
"github.com/flipped-aurora/gin-vue-admin/server/model/example" |
|
|
"io/ioutil" |
|
|
"io/ioutil" |
|
|
"mime/multipart" |
|
|
"mime/multipart" |
|
|
"strconv" |
|
|
"strconv" |
|
@ -123,11 +124,17 @@ func (b *FileUploadAndDownloadApi) BreakpointContinueFinish(c *gin.Context) { |
|
|
// @Success 200 {string} string "{"success":true,"data":{},"msg":"缓存切片删除成功"}"
|
|
|
// @Success 200 {string} string "{"success":true,"data":{},"msg":"缓存切片删除成功"}"
|
|
|
// @Router /fileUploadAndDownload/removeChunk [post]
|
|
|
// @Router /fileUploadAndDownload/removeChunk [post]
|
|
|
func (u *FileUploadAndDownloadApi) RemoveChunk(c *gin.Context) { |
|
|
func (u *FileUploadAndDownloadApi) RemoveChunk(c *gin.Context) { |
|
|
fileMd5 := c.Query("fileMd5") |
|
|
|
|
|
err := utils.RemoveChunk(fileMd5) |
|
|
|
|
|
|
|
|
var file example.ExaFile |
|
|
|
|
|
c.ShouldBindJSON(&file) |
|
|
|
|
|
err := utils.RemoveChunk(file.FileMd5) |
|
|
|
|
|
if err != nil { |
|
|
|
|
|
response.FailWithMessage(err.Error(), c) |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
err = fileUploadAndDownloadService.DeleteFileChunk(file.FileMd5, file.FileName, file.FilePath) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
global.GVA_LOG.Error("缓存切片删除失败!", zap.Error(err)) |
|
|
|
|
|
response.FailWithMessage( "缓存切片删除失败", c) |
|
|
|
|
|
|
|
|
global.GVA_LOG.Error(err.Error(), zap.Error(err)) |
|
|
|
|
|
response.FailWithMessage(err.Error(), c) |
|
|
} else { |
|
|
} else { |
|
|
response.OkWithMessage("缓存切片删除成功", c) |
|
|
response.OkWithMessage("缓存切片删除成功", c) |
|
|
} |
|
|
} |
|
|