라벨명 표시기능

This commit is contained in:
kjs
2025-09-08 14:20:01 +09:00
parent 1eeda775ef
commit 2d07041110
20 changed files with 1415 additions and 497 deletions

View File

@@ -60,7 +60,11 @@ export async function getColumnList(
): Promise<void> {
try {
const { tableName } = req.params;
logger.info(`=== 컬럼 정보 조회 시작: ${tableName} ===`);
const { page = 1, size = 50 } = req.query;
logger.info(
`=== 컬럼 정보 조회 시작: ${tableName} (page: ${page}, size: ${size}) ===`
);
if (!tableName) {
const response: ApiResponse<null> = {
@@ -76,14 +80,20 @@ export async function getColumnList(
}
const tableManagementService = new TableManagementService();
const columnList = await tableManagementService.getColumnList(tableName);
const result = await tableManagementService.getColumnList(
tableName,
parseInt(page as string),
parseInt(size as string)
);
logger.info(`컬럼 정보 조회 결과: ${tableName}, ${columnList.length}`);
logger.info(
`컬럼 정보 조회 결과: ${tableName}, ${result.columns.length}/${result.total}개 (${result.page}/${result.totalPages} 페이지)`
);
const response: ApiResponse<ColumnTypeInfo[]> = {
const response: ApiResponse<typeof result> = {
success: true,
message: "컬럼 목록을 성공적으로 조회했습니다.",
data: columnList,
data: result,
};
res.status(200).json(response);
@@ -377,6 +387,65 @@ export async function getColumnLabels(
}
}
/**
* 테이블 라벨 설정
*/
export async function updateTableLabel(
req: AuthenticatedRequest,
res: Response
): Promise<void> {
try {
const { tableName } = req.params;
const { displayName, description } = req.body;
logger.info(`=== 테이블 라벨 설정 시작: ${tableName} ===`);
logger.info(`표시명: ${displayName}, 설명: ${description}`);
if (!tableName) {
const response: ApiResponse<null> = {
success: false,
message: "테이블명이 필요합니다.",
error: {
code: "MISSING_TABLE_NAME",
details: "테이블명 파라미터가 누락되었습니다.",
},
};
res.status(400).json(response);
return;
}
const tableManagementService = new TableManagementService();
await tableManagementService.updateTableLabel(
tableName,
displayName,
description
);
logger.info(`테이블 라벨 설정 완료: ${tableName}`);
const response: ApiResponse<null> = {
success: true,
message: "테이블 라벨이 성공적으로 설정되었습니다.",
data: null,
};
res.status(200).json(response);
} catch (error) {
logger.error("테이블 라벨 설정 중 오류 발생:", error);
const response: ApiResponse<null> = {
success: false,
message: "테이블 라벨 설정 중 오류가 발생했습니다.",
error: {
code: "TABLE_LABEL_UPDATE_ERROR",
details: error instanceof Error ? error.message : "Unknown error",
},
};
res.status(500).json(response);
}
}
/**
* 컬럼 웹 타입 설정
*/