mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-19 17:24:26 +08:00
add transaction picture upload api
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user