75 lines
2.5 KiB
TypeScript
75 lines
2.5 KiB
TypeScript
/**
|
|
* 🔥 버튼 데이터플로우 라우트
|
|
*
|
|
* 성능 최적화된 API 엔드포인트들
|
|
*/
|
|
|
|
import express from "express";
|
|
import {
|
|
getButtonDataflowConfig,
|
|
updateButtonDataflowConfig,
|
|
getAvailableDiagrams,
|
|
getDiagramRelationships,
|
|
getRelationshipPreview,
|
|
executeOptimizedButton,
|
|
executeSimpleDataflow,
|
|
getJobStatus,
|
|
} from "../controllers/buttonDataflowController";
|
|
import { authenticateToken } from "../middleware/authMiddleware";
|
|
|
|
const router = express.Router();
|
|
|
|
// 🔥 모든 라우트에 인증 미들웨어 적용
|
|
router.use(authenticateToken);
|
|
|
|
// ============================================================================
|
|
// 🔥 버튼 설정 관리
|
|
// ============================================================================
|
|
|
|
// 버튼별 제어관리 설정 조회
|
|
router.get("/config/:buttonId", getButtonDataflowConfig);
|
|
|
|
// 버튼별 제어관리 설정 업데이트
|
|
router.put("/config/:buttonId", updateButtonDataflowConfig);
|
|
|
|
// ============================================================================
|
|
// 🔥 관계도 및 관계 정보 조회
|
|
// ============================================================================
|
|
|
|
// 사용 가능한 관계도 목록 조회
|
|
router.get("/diagrams", getAvailableDiagrams);
|
|
|
|
// 특정 관계도의 관계 목록 조회
|
|
router.get("/diagrams/:diagramId/relationships", getDiagramRelationships);
|
|
|
|
// 관계 미리보기 정보 조회
|
|
router.get(
|
|
"/diagrams/:diagramId/relationships/:relationshipId/preview",
|
|
getRelationshipPreview
|
|
);
|
|
|
|
// ============================================================================
|
|
// 🔥 버튼 실행 (성능 최적화)
|
|
// ============================================================================
|
|
|
|
// 최적화된 버튼 실행 (즉시 응답 + 백그라운드)
|
|
router.post("/execute-optimized", executeOptimizedButton);
|
|
|
|
// 간단한 데이터플로우 즉시 실행
|
|
router.post("/execute-simple", executeSimpleDataflow);
|
|
|
|
// 백그라운드 작업 상태 조회
|
|
router.get("/job-status/:jobId", getJobStatus);
|
|
|
|
// ============================================================================
|
|
// 🔥 레거시 호환성 (기존 API와 호환)
|
|
// ============================================================================
|
|
|
|
// 기존 실행 API (redirect to optimized)
|
|
router.post("/execute", executeOptimizedButton);
|
|
|
|
// 백그라운드 실행 API (실제로는 optimized와 동일)
|
|
router.post("/execute-background", executeOptimizedButton);
|
|
|
|
export default router;
|