import { mkdirSync } from 'node:fs';
import { join } from 'node:path';

/**
 * 上传目录工具：统一管理公开文件目录与临时目录。
 */
export function resolveUploadRootDir() {
  return join(process.cwd(), 'storage', 'uploads');
}

export function resolveUploadTempDir() {
  return join(process.cwd(), 'storage', 'tmp-uploads');
}

export function ensureUploadDirectories() {
  mkdirSync(resolveUploadRootDir(), { recursive: true });
  mkdirSync(resolveUploadTempDir(), { recursive: true });
}
