mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
update app
This commit is contained in:
parent
b964e424b2
commit
6269902140
@ -15,7 +15,6 @@ import (
|
|||||||
_ "github.com/minio/minio-go/v7"
|
_ "github.com/minio/minio-go/v7"
|
||||||
cr "github.com/minio/minio-go/v7/pkg/credentials"
|
cr "github.com/minio/minio-go/v7/pkg/credentials"
|
||||||
"net/http"
|
"net/http"
|
||||||
"path"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func MinioUploadFile(c *gin.Context) {
|
func MinioUploadFile(c *gin.Context) {
|
||||||
@ -173,7 +172,7 @@ func UploadUpdateApp(c *gin.Context) {
|
|||||||
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "Open file error" + err.Error()})
|
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "Open file error" + err.Error()})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
_, err = MinioClient.PutObject(context.Background(), config.Config.Credential.Minio.AppBucket, req.File.Filename, fileObj, req.File.Size, minio.PutObjectOptions{ContentType: path.Ext(req.File.Filename)})
|
_, err = MinioClient.PutObject(context.Background(), config.Config.Credential.Minio.AppBucket, req.File.Filename, fileObj, req.File.Size, minio.PutObjectOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "PutObject file error")
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), "PutObject file error")
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "PutObject file error" + err.Error()})
|
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "PutObject file error" + err.Error()})
|
||||||
@ -182,7 +181,7 @@ func UploadUpdateApp(c *gin.Context) {
|
|||||||
if yamlName != "" {
|
if yamlName != "" {
|
||||||
yamlObj, err := req.Yaml.Open()
|
yamlObj, err := req.Yaml.Open()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
_, err = MinioClient.PutObject(context.Background(), config.Config.Credential.Minio.AppBucket, yamlName, yamlObj, req.Yaml.Size, minio.PutObjectOptions{ContentType: path.Ext(yamlName)})
|
_, err = MinioClient.PutObject(context.Background(), config.Config.Credential.Minio.AppBucket, yamlName, yamlObj, req.Yaml.Size, minio.PutObjectOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "PutObject yaml error")
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), "PutObject yaml error")
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "PutObject yaml error" + err.Error()})
|
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "PutObject yaml error" + err.Error()})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user