up
This commit is contained in:
@@ -46,14 +46,14 @@ func CreateVcf(c *fiber.Ctx) error {
|
||||
defer os.Remove(tmpPath)
|
||||
|
||||
// 3. Subir a OSS
|
||||
ossService, err := services.NewOSSServiceFromDB()
|
||||
ossProvider, err := getOSSFromBody(c)
|
||||
if err != nil {
|
||||
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
|
||||
"error": "Error de conexión con OSS",
|
||||
})
|
||||
}
|
||||
|
||||
if err := ossService.UploadFile(fileName, tmpPath); err != nil {
|
||||
if err := ossProvider.UploadFile(fileName, tmpPath); err != nil {
|
||||
log.Printf("Error subiendo archivo a OSS: %v", err)
|
||||
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{
|
||||
"error": "Error subiendo archivo a OSS",
|
||||
@@ -61,7 +61,7 @@ func CreateVcf(c *fiber.Ctx) error {
|
||||
}
|
||||
|
||||
// 4. URL del archivo
|
||||
url := fmt.Sprintf("https://%s.%s/%s", ossService.BucketName, ossService.Endpoint, fileName)
|
||||
url := ossProvider.PublicURL(fileName)
|
||||
|
||||
// 5. Buscar si ya existe un registro con ese vcard_id
|
||||
var existing models.VcfVcard
|
||||
|
||||
Reference in New Issue
Block a user