This commit is contained in:
wangchuxiao
2022-03-29 15:35:03 +08:00
parent 0797181967
commit 7ed6ee5075
10 changed files with 226 additions and 126 deletions
@@ -81,7 +81,7 @@ func MinioUploadFile(c *gin.Context) {
_, err = minioClient.PutObject(context.Background(), config.Config.Credential.Minio.Bucket, newName, fileObj, file.Size, minio.PutObjectOptions{ContentType: newType})
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "open file error")
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "invalid file path" + err.Error()})
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "invalid file path" + err.Error()})
return
}
resp.NewName = newName