타입스크립트 에러 수정
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
import { Request, Response } from "express";
|
||||
import { BatchService } from "../services/batchService";
|
||||
import { BatchSchedulerService } from "../services/batchSchedulerService";
|
||||
import { BatchExternalDbService } from "../services/batchExternalDbService";
|
||||
import {
|
||||
BatchConfigFilter,
|
||||
CreateBatchConfigRequest,
|
||||
@@ -63,7 +64,7 @@ export class BatchController {
|
||||
res: Response
|
||||
) {
|
||||
try {
|
||||
const result = await BatchService.getAvailableConnections();
|
||||
const result = await BatchExternalDbService.getAvailableConnections();
|
||||
|
||||
if (result.success) {
|
||||
res.json(result);
|
||||
@@ -99,8 +100,8 @@ export class BatchController {
|
||||
}
|
||||
|
||||
const connectionId = type === "external" ? Number(id) : undefined;
|
||||
const result = await BatchService.getTablesFromConnection(
|
||||
type,
|
||||
const result = await BatchService.getTables(
|
||||
type as "internal" | "external",
|
||||
connectionId
|
||||
);
|
||||
|
||||
@@ -142,10 +143,10 @@ export class BatchController {
|
||||
}
|
||||
|
||||
const connectionId = type === "external" ? Number(id) : undefined;
|
||||
const result = await BatchService.getTableColumns(
|
||||
type,
|
||||
connectionId,
|
||||
tableName
|
||||
const result = await BatchService.getColumns(
|
||||
tableName,
|
||||
type as "internal" | "external",
|
||||
connectionId
|
||||
);
|
||||
|
||||
if (result.success) {
|
||||
|
||||
@@ -331,8 +331,11 @@ export class BatchManagementController {
|
||||
const duration = endTime.getTime() - startTime.getTime();
|
||||
|
||||
// executionLog가 정의되어 있는지 확인
|
||||
if (typeof executionLog !== "undefined") {
|
||||
await BatchService.updateExecutionLog(executionLog.id, {
|
||||
if (typeof executionLog !== "undefined" && executionLog) {
|
||||
const { BatchExecutionLogService } = await import(
|
||||
"../services/batchExecutionLogService"
|
||||
);
|
||||
await BatchExecutionLogService.updateExecutionLog(executionLog.id, {
|
||||
execution_status: "FAILED",
|
||||
end_time: endTime,
|
||||
duration_ms: duration,
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import { Request, Response } from "express";
|
||||
import { getPool } from "../database/db";
|
||||
import { logger } from "../utils/logger";
|
||||
import { AuthenticatedRequest } from "../types/auth";
|
||||
|
||||
const pool = getPool();
|
||||
|
||||
@@ -16,7 +17,7 @@ const pool = getPool();
|
||||
* 화면 임베딩 목록 조회
|
||||
* GET /api/screen-embedding?parentScreenId=1
|
||||
*/
|
||||
export async function getScreenEmbeddings(req: Request, res: Response) {
|
||||
export async function getScreenEmbeddings(req: AuthenticatedRequest, res: Response) {
|
||||
try {
|
||||
const { parentScreenId } = req.query;
|
||||
const companyCode = req.user!.companyCode;
|
||||
@@ -67,7 +68,7 @@ export async function getScreenEmbeddings(req: Request, res: Response) {
|
||||
* 화면 임베딩 상세 조회
|
||||
* GET /api/screen-embedding/:id
|
||||
*/
|
||||
export async function getScreenEmbeddingById(req: Request, res: Response) {
|
||||
export async function getScreenEmbeddingById(req: AuthenticatedRequest, res: Response) {
|
||||
try {
|
||||
const { id } = req.params;
|
||||
const companyCode = req.user!.companyCode;
|
||||
@@ -113,7 +114,7 @@ export async function getScreenEmbeddingById(req: Request, res: Response) {
|
||||
* 화면 임베딩 생성
|
||||
* POST /api/screen-embedding
|
||||
*/
|
||||
export async function createScreenEmbedding(req: Request, res: Response) {
|
||||
export async function createScreenEmbedding(req: AuthenticatedRequest, res: Response) {
|
||||
try {
|
||||
const {
|
||||
parentScreenId,
|
||||
@@ -184,7 +185,7 @@ export async function createScreenEmbedding(req: Request, res: Response) {
|
||||
* 화면 임베딩 수정
|
||||
* PUT /api/screen-embedding/:id
|
||||
*/
|
||||
export async function updateScreenEmbedding(req: Request, res: Response) {
|
||||
export async function updateScreenEmbedding(req: AuthenticatedRequest, res: Response) {
|
||||
try {
|
||||
const { id } = req.params;
|
||||
const { position, mode, config } = req.body;
|
||||
@@ -257,7 +258,7 @@ export async function updateScreenEmbedding(req: Request, res: Response) {
|
||||
* 화면 임베딩 삭제
|
||||
* DELETE /api/screen-embedding/:id
|
||||
*/
|
||||
export async function deleteScreenEmbedding(req: Request, res: Response) {
|
||||
export async function deleteScreenEmbedding(req: AuthenticatedRequest, res: Response) {
|
||||
try {
|
||||
const { id } = req.params;
|
||||
const companyCode = req.user!.companyCode;
|
||||
@@ -301,7 +302,7 @@ export async function deleteScreenEmbedding(req: Request, res: Response) {
|
||||
* 데이터 전달 설정 조회
|
||||
* GET /api/screen-data-transfer?sourceScreenId=1&targetScreenId=2
|
||||
*/
|
||||
export async function getScreenDataTransfer(req: Request, res: Response) {
|
||||
export async function getScreenDataTransfer(req: AuthenticatedRequest, res: Response) {
|
||||
try {
|
||||
const { sourceScreenId, targetScreenId } = req.query;
|
||||
const companyCode = req.user!.companyCode;
|
||||
@@ -363,7 +364,7 @@ export async function getScreenDataTransfer(req: Request, res: Response) {
|
||||
* 데이터 전달 설정 생성
|
||||
* POST /api/screen-data-transfer
|
||||
*/
|
||||
export async function createScreenDataTransfer(req: Request, res: Response) {
|
||||
export async function createScreenDataTransfer(req: AuthenticatedRequest, res: Response) {
|
||||
try {
|
||||
const {
|
||||
sourceScreenId,
|
||||
@@ -436,7 +437,7 @@ export async function createScreenDataTransfer(req: Request, res: Response) {
|
||||
* 데이터 전달 설정 수정
|
||||
* PUT /api/screen-data-transfer/:id
|
||||
*/
|
||||
export async function updateScreenDataTransfer(req: Request, res: Response) {
|
||||
export async function updateScreenDataTransfer(req: AuthenticatedRequest, res: Response) {
|
||||
try {
|
||||
const { id } = req.params;
|
||||
const { dataReceivers, buttonConfig } = req.body;
|
||||
@@ -504,7 +505,7 @@ export async function updateScreenDataTransfer(req: Request, res: Response) {
|
||||
* 데이터 전달 설정 삭제
|
||||
* DELETE /api/screen-data-transfer/:id
|
||||
*/
|
||||
export async function deleteScreenDataTransfer(req: Request, res: Response) {
|
||||
export async function deleteScreenDataTransfer(req: AuthenticatedRequest, res: Response) {
|
||||
try {
|
||||
const { id } = req.params;
|
||||
const companyCode = req.user!.companyCode;
|
||||
@@ -548,7 +549,7 @@ export async function deleteScreenDataTransfer(req: Request, res: Response) {
|
||||
* 분할 패널 설정 조회
|
||||
* GET /api/screen-split-panel/:screenId
|
||||
*/
|
||||
export async function getScreenSplitPanel(req: Request, res: Response) {
|
||||
export async function getScreenSplitPanel(req: AuthenticatedRequest, res: Response) {
|
||||
try {
|
||||
const { screenId } = req.params;
|
||||
const companyCode = req.user!.companyCode;
|
||||
@@ -655,7 +656,7 @@ export async function getScreenSplitPanel(req: Request, res: Response) {
|
||||
* 분할 패널 설정 생성
|
||||
* POST /api/screen-split-panel
|
||||
*/
|
||||
export async function createScreenSplitPanel(req: Request, res: Response) {
|
||||
export async function createScreenSplitPanel(req: AuthenticatedRequest, res: Response) {
|
||||
const client = await pool.connect();
|
||||
|
||||
try {
|
||||
@@ -792,7 +793,7 @@ export async function createScreenSplitPanel(req: Request, res: Response) {
|
||||
* 분할 패널 설정 수정
|
||||
* PUT /api/screen-split-panel/:id
|
||||
*/
|
||||
export async function updateScreenSplitPanel(req: Request, res: Response) {
|
||||
export async function updateScreenSplitPanel(req: AuthenticatedRequest, res: Response) {
|
||||
try {
|
||||
const { id } = req.params;
|
||||
const { layoutConfig } = req.body;
|
||||
@@ -845,7 +846,7 @@ export async function updateScreenSplitPanel(req: Request, res: Response) {
|
||||
* 분할 패널 설정 삭제
|
||||
* DELETE /api/screen-split-panel/:id
|
||||
*/
|
||||
export async function deleteScreenSplitPanel(req: Request, res: Response) {
|
||||
export async function deleteScreenSplitPanel(req: AuthenticatedRequest, res: Response) {
|
||||
const client = await pool.connect();
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user