타입에러 수정

This commit is contained in:
kjs 2025-09-05 15:18:29 +09:00
parent 881ae9793b
commit cf140a5810
1 changed files with 0 additions and 46 deletions

View File

@ -132,52 +132,6 @@ export class FileSystemManager {
return sharedPath;
}
/**
*
* @param companyCode
* @param serverFilename
* @returns null
*/
static findFileInCompanyFolders(
companyCode: string,
serverFilename: string
): string | null {
try {
const companyBasePath = path.join(
this.BASE_UPLOAD_PATH,
`company_${companyCode}`
);
if (!fs.existsSync(companyBasePath)) {
return null;
}
// 회사 폴더 내의 모든 하위 폴더를 재귀적으로 검색
const findFileRecursively = (dirPath: string): string | null => {
const items = fs.readdirSync(dirPath);
for (const item of items) {
const itemPath = path.join(dirPath, item);
const stats = fs.statSync(itemPath);
if (stats.isFile() && item === serverFilename) {
return itemPath;
} else if (stats.isDirectory()) {
const found = findFileRecursively(itemPath);
if (found) return found;
}
}
return null;
};
return findFileRecursively(companyBasePath);
} catch (error) {
logger.error(`파일 검색 실패: ${companyCode}/${serverFilename}`, error);
return null;
}
}
/**
*
* @param companyCode