package com.service.ingresantes.controller; import com.service.ingresantes.service.ExcelService; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @RestController @RequestMapping("/api/excel") public class ExcelController { private final ExcelService excelService; public ExcelController(ExcelService excelService) { this.excelService = excelService; } @PostMapping("/upload") public ResponseEntity uploadExcel(@RequestParam("file") MultipartFile file) { try { excelService.importarExcel(file); return ResponseEntity.ok("Archivo subido y procesado correctamente!"); } catch (Exception e) { return ResponseEntity.badRequest().body("Error al procesar el archivo: " + e.getMessage()); } } @GetMapping("/ping") public String ping() { return "API funcionando123456!"; } }