add transaction picture upload api

This commit is contained in:
MaysWind
2024-08-30 00:33:48 +08:00
parent fe442f27f2
commit 73c69c3761
18 changed files with 462 additions and 10 deletions
+4
View File
@@ -4,6 +4,7 @@ import (
"context"
"crypto/tls"
"net/http"
"strings"
"github.com/minio/minio-go/v7"
"github.com/minio/minio-go/v7/pkg/credentials"
@@ -40,6 +41,7 @@ func NewMinIOObjectStorage(config *settings.Config, pathPrefix string) (*MinIOOb
}
storage.rootPath = storage.getFinalPath(pathPrefix)
storage.rootPath = strings.ReplaceAll(storage.rootPath, "\\", "/")
ctx := context.Background()
exists, err := minIOClient.BucketExists(ctx, minIOConfig.Bucket)
@@ -104,5 +106,7 @@ func (s *MinIOObjectStorage) getFinalPath(path string) string {
path = path[1:]
}
path = strings.ReplaceAll(path, "\\", "/")
return rootPath + path
}