13 lines
393 B
Go
13 lines
393 B
Go
package file
|
||
|
||
import (
|
||
"fmt"
|
||
"pushNotificationCenter/config"
|
||
)
|
||
|
||
// 生成永久访问URL(基于存储桶域名和对象路径)
|
||
func GetPermanentURL(bucketName, objectKey string) string {
|
||
// 格式: http://<minio-api地址>/<桶名>/<对象键>
|
||
return fmt.Sprintf(`http://%s:%s/api/v1/buckets/%s/objects/download?prefix=%s`, config.MinioHost, config.MinioPort, bucketName, objectKey)
|
||
}
|