视频保存
This commit is contained in:
@@ -19,6 +19,7 @@ import (
|
||||
"github.com/disintegration/imaging"
|
||||
"github.com/echochat/backend/config"
|
||||
"github.com/echochat/backend/pkg/logs"
|
||||
"github.com/echochat/backend/pkg/storage"
|
||||
"github.com/google/uuid"
|
||||
"github.com/minio/minio-go/v7"
|
||||
"go.uber.org/zap"
|
||||
@@ -259,12 +260,5 @@ func (s *FileService) UploadVoice(ctx context.Context, fileHeader *multipart.Fil
|
||||
|
||||
// buildURL 根据 MinIO 配置构建文件访问 URL
|
||||
func (s *FileService) buildURL(objectName string) string {
|
||||
if base := strings.TrimRight(strings.TrimSpace(s.minioCfg.PublicBaseURL), "/"); base != "" {
|
||||
return fmt.Sprintf("%s/%s", base, objectName)
|
||||
}
|
||||
scheme := "http"
|
||||
if s.minioCfg.UseSSL {
|
||||
scheme = "https"
|
||||
}
|
||||
return fmt.Sprintf("%s://%s/%s/%s", scheme, s.minioCfg.Endpoint, s.minioCfg.Bucket, objectName)
|
||||
return storage.BuildObjectURL(s.minioCfg, objectName)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user