import { Router } from "express";
import { authenticateToken } from "../middleware/authMiddleware";
import {
  findMappingByColumns,
  saveMappingTemplate,
  getMappingTemplates,
  deleteMappingTemplate,
} from "../controllers/excelMappingController";

const router = Router();

// 엑셀 컬럼 구조로 매핑 템플릿 조회
router.post("/find", authenticateToken, findMappingByColumns);

// 매핑 템플릿 저장 (UPSERT)
router.post("/save", authenticateToken, saveMappingTemplate);

// 테이블의 매핑 템플릿 목록 조회
router.get("/list/:tableName", authenticateToken, getMappingTemplates);

// 매핑 템플릿 삭제
router.delete("/:id", authenticateToken, deleteMappingTemplate);

export default router;

