타입스크립트 에러 수정

This commit is contained in:
kjs
2025-12-01 15:30:25 +09:00
parent da6ac92391
commit b1b9e4ad93
7 changed files with 151 additions and 33 deletions

View File

@@ -203,8 +203,7 @@ export class BatchExternalDbService {
// 비밀번호 복호화
if (connection.password) {
try {
const passwordEncryption = new PasswordEncryption();
connection.password = passwordEncryption.decrypt(connection.password);
connection.password = PasswordEncryption.decrypt(connection.password);
} catch (error) {
console.error("비밀번호 복호화 실패:", error);
// 복호화 실패 시 원본 사용 (또는 에러 처리)

View File

@@ -1,10 +1,10 @@
import cron from "node-cron";
import cron, { ScheduledTask } from "node-cron";
import { BatchService } from "./batchService";
import { BatchExecutionLogService } from "./batchExecutionLogService";
import { logger } from "../utils/logger";
export class BatchSchedulerService {
private static scheduledTasks: Map<number, cron.ScheduledTask> = new Map();
private static scheduledTasks: Map<number, ScheduledTask> = new Map();
/**
* 모든 활성 배치의 스케줄링 초기화
@@ -175,7 +175,7 @@ export class BatchSchedulerService {
// 실행 로그 업데이트 (실패)
if (executionLog) {
await BatchExecutionLogService.updateExecutionLog(executionLog.id, {
execution_status: "FAILURE",
execution_status: "FAILED",
end_time: new Date(),
duration_ms: Date.now() - startTime.getTime(),
error_message:
@@ -396,4 +396,11 @@ export class BatchSchedulerService {
return { totalRecords, successRecords, failedRecords };
}
/**
* 개별 배치 작업 스케줄링 (scheduleBatch의 별칭)
*/
static async scheduleBatchConfig(config: any) {
return this.scheduleBatch(config);
}
}

View File

@@ -16,7 +16,6 @@ import {
UpdateBatchConfigRequest,
} from "../types/batchTypes";
import { BatchExternalDbService } from "./batchExternalDbService";
import { DbConnectionManager } from "./dbConnectionManager";
export class BatchService {
/**
@@ -475,7 +474,13 @@ export class BatchService {
try {
if (connectionType === "internal") {
// 내부 DB 테이블 조회
const tables = await DbConnectionManager.getInternalTables();
const tables = await query<TableInfo>(
`SELECT table_name, table_type, table_schema
FROM information_schema.tables
WHERE table_schema = 'public'
AND table_type = 'BASE TABLE'
ORDER BY table_name`
);
return {
success: true,
data: tables,
@@ -509,7 +514,13 @@ export class BatchService {
try {
if (connectionType === "internal") {
// 내부 DB 컬럼 조회
const columns = await DbConnectionManager.getInternalColumns(tableName);
const columns = await query<ColumnInfo>(
`SELECT column_name, data_type, is_nullable, column_default
FROM information_schema.columns
WHERE table_schema = 'public' AND table_name = $1
ORDER BY ordinal_position`,
[tableName]
);
return {
success: true,
data: columns,
@@ -543,7 +554,9 @@ export class BatchService {
try {
if (connectionType === "internal") {
// 내부 DB 데이터 조회
const data = await DbConnectionManager.getInternalData(tableName, 10);
const data = await query<any>(
`SELECT * FROM ${tableName} LIMIT 10`
);
return {
success: true,
data,