|
|
|
@ -11,6 +11,7 @@ import (
|
|
|
|
|
pbAdmin "Open_IM/pkg/proto/admin_cms"
|
|
|
|
|
"Open_IM/pkg/utils"
|
|
|
|
|
"context"
|
|
|
|
|
"fmt"
|
|
|
|
|
"github.com/minio/minio-go/v7"
|
|
|
|
|
"net/http"
|
|
|
|
|
"strings"
|
|
|
|
@ -69,7 +70,9 @@ func UploadUpdateApp(c *gin.Context) {
|
|
|
|
|
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "invalid file path" + err.Error()})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "name: ", newFileName, newYamlName, fileObj, yamlObj, req.File.Size, req.Yaml.Size)
|
|
|
|
|
fmt.Println(req.OperationID, utils.GetSelfFuncName(), "name: ", config.Config.Credential.Minio.AppBucket, newFileName, fileObj, req.File.Size)
|
|
|
|
|
fmt.Println(req.OperationID, utils.GetSelfFuncName(), "name: ", config.Config.Credential.Minio.AppBucket, newYamlName, yamlObj, req.Yaml.Size)
|
|
|
|
|
|
|
|
|
|
// v2.0.9_app_linux v2.0.9_yaml_linux
|
|
|
|
|
_, newType := utils.GetNewFileNameAndContentType("", constant.OtherType)
|
|
|
|
|
_, err = apiThird.MinioClient.PutObject(context.Background(), config.Config.Credential.Minio.AppBucket, newFileName, fileObj, req.File.Size, minio.PutObjectOptions{ContentType: newType})
|
|
|
|
|