From 8adf121160c47a5e4270b5a6f3223ffe6f124f48 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 1 Aug 2021 15:05:40 +0200 Subject: [PATCH] Removed local picture saving --- routers/api/v1/picture/picture.go | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/routers/api/v1/picture/picture.go b/routers/api/v1/picture/picture.go index 6d3357d..931b1dd 100644 --- a/routers/api/v1/picture/picture.go +++ b/routers/api/v1/picture/picture.go @@ -2,16 +2,13 @@ package picture import ( "bytes" - "fmt" "io" - "strings" "git.umbach.dev/app-idea/rest-api/modules/config" "git.umbach.dev/app-idea/rest-api/modules/rabbitmq" "git.umbach.dev/app-idea/rest-api/modules/structs" "git.umbach.dev/app-idea/rest-api/routers/api/v1/user" "github.com/gofiber/fiber/v2" - "github.com/google/uuid" log "github.com/sirupsen/logrus" ) @@ -56,22 +53,5 @@ func Test(c *fiber.Ctx) error { rabbitmq.PublishPicture(structs.RabbitmqPictureMessage{Picture: buf.Bytes(), UserId: user.Id, Filename: file.Filename}) - filename := strings.Replace(uuid.New().String(), "-", "", -1) - fileExt := strings.Split(file.Filename, ".")[1] - image := fmt.Sprintf("%s.%s", filename, fileExt) - - err = c.SaveFile(file, "./img/"+image) - - if err != nil { - log.Infoln("err2", err) - return c.SendStatus(fiber.StatusInternalServerError) - } - - if err != nil { - log.Infoln("err fileUpload:", err) - } - - log.Infoln("no error") - - return c.SendStatus(fiber.StatusCreated) + return c.SendStatus(fiber.StatusOK) }