mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
fix bug
This commit is contained in:
parent
ef9c291d9a
commit
9136838b63
@ -47,8 +47,10 @@ func MinioInit() {
|
||||
return
|
||||
}
|
||||
opt := minio.MakeBucketOptions{
|
||||
Region: config.Config.Credential.Minio.Location,
|
||||
ObjectLocking: false,
|
||||
Region: config.Config.Credential.Minio.Location,
|
||||
}
|
||||
if config.Config.Credential.Minio.IsDistributedMod == true {
|
||||
opt.ObjectLocking = true
|
||||
}
|
||||
err = MinioClient.MakeBucket(context.Background(), config.Config.Credential.Minio.Bucket, opt)
|
||||
if err != nil {
|
||||
|
@ -161,6 +161,7 @@ func MinioStorageCredential(c *gin.Context) {
|
||||
resp.BucketName = config.Config.Credential.Minio.Bucket
|
||||
resp.StsEndpointURL = config.Config.Credential.Minio.Endpoint
|
||||
resp.StorageTime = config.Config.Credential.Minio.StorageTime
|
||||
resp.IsDistributedMod = config.Config.Credential.Minio.IsDistributedMod
|
||||
c.JSON(http.StatusOK, gin.H{"errCode": 0, "errMsg": "", "data": resp})
|
||||
}
|
||||
|
||||
|
@ -7,12 +7,13 @@ type MinioStorageCredentialReq struct {
|
||||
}
|
||||
|
||||
type MiniostorageCredentialResp struct {
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
AccessKeyID string `json:"accessKeyID"`
|
||||
SessionToken string `json:"sessionToken"`
|
||||
BucketName string `json:"bucketName"`
|
||||
StsEndpointURL string `json:"stsEndpointURL"`
|
||||
StorageTime int `json:"storageTime"`
|
||||
SecretAccessKey string `json:"secretAccessKey"`
|
||||
AccessKeyID string `json:"accessKeyID"`
|
||||
SessionToken string `json:"sessionToken"`
|
||||
BucketName string `json:"bucketName"`
|
||||
StsEndpointURL string `json:"stsEndpointURL"`
|
||||
StorageTime int `json:"storageTime"`
|
||||
IsDistributedMod bool `json:"isDistributedMod"`
|
||||
}
|
||||
|
||||
type MinioUploadFileReq struct {
|
||||
|
@ -72,6 +72,7 @@ type config struct {
|
||||
EndpointInner string `yaml:"endpointInner"`
|
||||
EndpointInnerEnable bool `yaml:"endpointInnerEnable"`
|
||||
StorageTime int `yaml:"storageTime"`
|
||||
IsDistributedMod bool `yaml:"isDistributedMod"`
|
||||
} `yaml:"minio"`
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user