import { Injectable } from '@nestjs/common';
import { extname } from 'path';
import * as fs from 'fs';

@Injectable()
export class UploadService {
  private uploadDir = 'uploads';

  ensureUploadDir() {
    if (!fs.existsSync(this.uploadDir)) {
      fs.mkdirSync(this.uploadDir, { recursive: true });
    }
  }

  getUploadDir(): string {
    return this.uploadDir;
  }
}
