컴포넌트 리뉴얼 1.0

This commit is contained in:
kjs
2025-12-19 15:44:38 +09:00
parent 2487c79a61
commit 91d00aa784
61 changed files with 11678 additions and 175 deletions

View File

@@ -114,7 +114,8 @@ export class TableManagementService {
tableName: string,
page: number = 1,
size: number = 50,
companyCode?: string // 🔥 회사 코드 추가
companyCode?: string, // 🔥 회사 코드 추가
bustCache: boolean = false // 🔥 캐시 버스팅 옵션
): Promise<{
columns: ColumnTypeInfo[];
total: number;
@@ -124,7 +125,7 @@ export class TableManagementService {
}> {
try {
logger.info(
`컬럼 정보 조회 시작: ${tableName} (page: ${page}, size: ${size}), company: ${companyCode}`
`컬럼 정보 조회 시작: ${tableName} (page: ${page}, size: ${size}), company: ${companyCode}, bustCache: ${bustCache}`
);
// 캐시 키 생성 (companyCode 포함)
@@ -132,32 +133,37 @@ export class TableManagementService {
CacheKeys.TABLE_COLUMNS(tableName, page, size) + `_${companyCode}`;
const countCacheKey = CacheKeys.TABLE_COLUMN_COUNT(tableName);
// 캐시에서 먼저 확인
const cachedResult = cache.get<{
columns: ColumnTypeInfo[];
total: number;
page: number;
size: number;
totalPages: number;
}>(cacheKey);
if (cachedResult) {
logger.info(
`컬럼 정보 캐시에서 조회: ${tableName}, ${cachedResult.columns.length}/${cachedResult.total}`
);
// 🔥 캐시 버스팅: bustCache가 true면 캐시 무시
if (!bustCache) {
// 캐시에서 먼저 확인
const cachedResult = cache.get<{
columns: ColumnTypeInfo[];
total: number;
page: number;
size: number;
totalPages: number;
}>(cacheKey);
if (cachedResult) {
logger.info(
`컬럼 정보 캐시에서 조회: ${tableName}, ${cachedResult.columns.length}/${cachedResult.total}`
);
// 디버깅: 캐시된 currency_code 확인
const cachedCurrency = cachedResult.columns.find(
(col: any) => col.columnName === "currency_code"
);
if (cachedCurrency) {
console.log(`💾 [캐시] currency_code:`, {
columnName: cachedCurrency.columnName,
inputType: cachedCurrency.inputType,
webType: cachedCurrency.webType,
});
// 디버깅: 캐시된 currency_code 확인
const cachedCurrency = cachedResult.columns.find(
(col: any) => col.columnName === "currency_code"
);
if (cachedCurrency) {
console.log(`💾 [캐시] currency_code:`, {
columnName: cachedCurrency.columnName,
inputType: cachedCurrency.inputType,
webType: cachedCurrency.webType,
});
}
return cachedResult;
}
return cachedResult;
} else {
logger.info(`🔥 캐시 버스팅: ${tableName} 캐시 무시`);
}
// 전체 컬럼 수 조회 (캐시 확인)