rename postgr fucntions

This commit is contained in:
gitGnome
2026-04-15 14:18:22 +02:00
parent 3c31e82061
commit 6d0eaa92e9
7 changed files with 49 additions and 40 deletions
+11 -2
View File
@@ -5,12 +5,15 @@ import (
"go-socket/packages/convertions"
"go-socket/packages/globals"
"go-socket/packages/minio"
"go-socket/packages/postgresql"
"io"
"net/http"
"github.com/google/uuid"
)
func handleExistingUpload() {
}
func HandleFileUpload(response http.ResponseWriter, request *http.Request) {
@@ -71,11 +74,17 @@ func HandleFileUpload(response http.ResponseWriter, request *http.Request) {
if minio.DoesExist(ctx, key) {
part.Close()
uploaded = true
handleExistingUpload()
continue
}
err = minio.Upload(ctx, key, part, -1, contentType, user.Id)
id := uuid.New()
err = minio.Upload(ctx, key, part, -1, contentType, id)
postgresql.FileMetadataSave()
part.Close()
if err != nil {
http.Error(response, "upload failed", http.StatusInternalServerError)
return