import { ApiProperty } from '@nestjs/swagger';
import { IsString, IsNumber, Min, Max } from 'class-validator';
import { MAX_FILE_SIZE } from '../../../common/utils/security.util';

export class CreateUploadUrlDto {
  @ApiProperty({ description: '原始文件名', example: 'document.pdf' })
  @IsString()
  filename: string;

  @ApiProperty({ description: 'MIME 类型', example: 'application/pdf' })
  @IsString()
  mimeType: string;

  @ApiProperty({ description: '文件大小（字节）', example: 1048576 })
  @IsNumber()
  @Min(1)
  @Max(MAX_FILE_SIZE)
  sizeBytes: number;
}
