From bf0abc65f116a3e6aadc3bcfa56460845ec0825f Mon Sep 17 00:00:00 2001 From: lizandrogd <77708265+lizandrogd@users.noreply.github.com> Date: Wed, 11 Jun 2025 02:20:17 -0500 Subject: [PATCH] Update vcard_qr.go --- rest/controllers/api/vcard_qr.go | 36 -------------------------------- 1 file changed, 36 deletions(-) diff --git a/rest/controllers/api/vcard_qr.go b/rest/controllers/api/vcard_qr.go index 26eeb6d..0a32322 100755 --- a/rest/controllers/api/vcard_qr.go +++ b/rest/controllers/api/vcard_qr.go @@ -249,39 +249,3 @@ func CreateUrlQr(c *fiber.Ctx) error { }) } -func createCorreoQr(c *fiber.Ctx) error { - var data struct { - Correo string `json:"correo"` - } - if err := json.Unmarshal(c.Body(), &data); err != nil { - return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{ - "error": "Datos inválidos", - }) - } - - qrBytes, err := services.GenerateCorreoQR(data.Correo) - if err != nil { - return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{ - "error": "No se pudo generar el QR", - }) - } - - img, err := png.Decode(bytes.NewReader(qrBytes)) - if err != nil { - return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{ - "error": "No se pudo procesar la imagen", - }) - } - - // Codificar a WebP - var webpBuffer bytes.Buffer - if err := webp.Encode(&webpBuffer, img, &webp.Options{Lossless: true}); err != nil { - return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{ - "error": "No se pudo convertir a WebP", - }) - } - - c.Type("webp") - return c.Send(webpBuffer.Bytes()) - -} \ No newline at end of file