외부커넥션관리
This commit is contained in:
73
backend-node/src/routes/batchRoutes.ts
Normal file
73
backend-node/src/routes/batchRoutes.ts
Normal file
@@ -0,0 +1,73 @@
|
||||
// 배치 관리 라우트
|
||||
// 작성일: 2024-12-23
|
||||
|
||||
import { Router } from 'express';
|
||||
import { BatchController } from '../controllers/batchController';
|
||||
import { authenticateToken } from '../middleware/authMiddleware';
|
||||
|
||||
const router = Router();
|
||||
|
||||
// 모든 라우트에 인증 미들웨어 적용
|
||||
router.use(authenticateToken);
|
||||
|
||||
/**
|
||||
* GET /api/batch
|
||||
* 배치 작업 목록 조회
|
||||
*/
|
||||
router.get('/', BatchController.getBatchJobs);
|
||||
|
||||
/**
|
||||
* GET /api/batch/:id
|
||||
* 배치 작업 상세 조회
|
||||
*/
|
||||
router.get('/:id', BatchController.getBatchJobById);
|
||||
|
||||
/**
|
||||
* POST /api/batch
|
||||
* 배치 작업 생성
|
||||
*/
|
||||
router.post('/', BatchController.createBatchJob);
|
||||
|
||||
/**
|
||||
* PUT /api/batch/:id
|
||||
* 배치 작업 수정
|
||||
*/
|
||||
router.put('/:id', BatchController.updateBatchJob);
|
||||
|
||||
/**
|
||||
* DELETE /api/batch/:id
|
||||
* 배치 작업 삭제
|
||||
*/
|
||||
router.delete('/:id', BatchController.deleteBatchJob);
|
||||
|
||||
/**
|
||||
* POST /api/batch/:id/execute
|
||||
* 배치 작업 수동 실행
|
||||
*/
|
||||
router.post('/:id/execute', BatchController.executeBatchJob);
|
||||
|
||||
/**
|
||||
* GET /api/batch/executions
|
||||
* 배치 실행 목록 조회
|
||||
*/
|
||||
router.get('/executions/list', BatchController.getBatchExecutions);
|
||||
|
||||
/**
|
||||
* GET /api/batch/monitoring
|
||||
* 배치 모니터링 정보 조회
|
||||
*/
|
||||
router.get('/monitoring/status', BatchController.getBatchMonitoring);
|
||||
|
||||
/**
|
||||
* GET /api/batch/types/supported
|
||||
* 지원되는 작업 타입 조회
|
||||
*/
|
||||
router.get('/types/supported', BatchController.getSupportedJobTypes);
|
||||
|
||||
/**
|
||||
* GET /api/batch/schedules/presets
|
||||
* 스케줄 프리셋 조회
|
||||
*/
|
||||
router.get('/schedules/presets', BatchController.getSchedulePresets);
|
||||
|
||||
export default router;
|
||||
61
backend-node/src/routes/collectionRoutes.ts
Normal file
61
backend-node/src/routes/collectionRoutes.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
// 수집 관리 라우트
|
||||
// 작성일: 2024-12-23
|
||||
|
||||
import { Router } from 'express';
|
||||
import { CollectionController } from '../controllers/collectionController';
|
||||
import { authenticateToken } from '../middleware/authMiddleware';
|
||||
|
||||
const router = Router();
|
||||
|
||||
// 모든 라우트에 인증 미들웨어 적용
|
||||
router.use(authenticateToken);
|
||||
|
||||
/**
|
||||
* GET /api/collections
|
||||
* 수집 설정 목록 조회
|
||||
*/
|
||||
router.get('/', CollectionController.getCollectionConfigs);
|
||||
|
||||
/**
|
||||
* GET /api/collections/:id
|
||||
* 수집 설정 상세 조회
|
||||
*/
|
||||
router.get('/:id', CollectionController.getCollectionConfigById);
|
||||
|
||||
/**
|
||||
* POST /api/collections
|
||||
* 수집 설정 생성
|
||||
*/
|
||||
router.post('/', CollectionController.createCollectionConfig);
|
||||
|
||||
/**
|
||||
* PUT /api/collections/:id
|
||||
* 수집 설정 수정
|
||||
*/
|
||||
router.put('/:id', CollectionController.updateCollectionConfig);
|
||||
|
||||
/**
|
||||
* DELETE /api/collections/:id
|
||||
* 수집 설정 삭제
|
||||
*/
|
||||
router.delete('/:id', CollectionController.deleteCollectionConfig);
|
||||
|
||||
/**
|
||||
* POST /api/collections/:id/execute
|
||||
* 수집 작업 실행
|
||||
*/
|
||||
router.post('/:id/execute', CollectionController.executeCollection);
|
||||
|
||||
/**
|
||||
* GET /api/collections/jobs
|
||||
* 수집 작업 목록 조회
|
||||
*/
|
||||
router.get('/jobs/list', CollectionController.getCollectionJobs);
|
||||
|
||||
/**
|
||||
* GET /api/collections/:configId/history
|
||||
* 수집 이력 조회
|
||||
*/
|
||||
router.get('/:configId/history', CollectionController.getCollectionHistory);
|
||||
|
||||
export default router;
|
||||
@@ -340,5 +340,37 @@ router.get(
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* GET /api/external-db-connections/:id/tables/:tableName/columns
|
||||
* 특정 테이블의 컬럼 정보 조회
|
||||
*/
|
||||
router.get(
|
||||
"/:id/tables/:tableName/columns",
|
||||
authenticateToken,
|
||||
async (req: AuthenticatedRequest, res: Response) => {
|
||||
try {
|
||||
const id = parseInt(req.params.id);
|
||||
const tableName = req.params.tableName;
|
||||
|
||||
if (!tableName) {
|
||||
return res.status(400).json({
|
||||
success: false,
|
||||
message: "테이블명이 입력되지 않았습니다."
|
||||
});
|
||||
}
|
||||
|
||||
const result = await ExternalDbConnectionService.getTableColumns(id, tableName);
|
||||
return res.json(result);
|
||||
} catch (error) {
|
||||
console.error("테이블 컬럼 조회 오류:", error);
|
||||
return res.status(500).json({
|
||||
success: false,
|
||||
message: "테이블 컬럼 조회 중 오류가 발생했습니다.",
|
||||
error: error instanceof Error ? error.message : "알 수 없는 오류"
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
export default router;
|
||||
|
||||
Reference in New Issue
Block a user