first commit

This commit is contained in:
lendry
2026-06-24 14:37:15 +03:00
commit 995adeedd4
188 changed files with 28810 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { IsIn, IsOptional, IsString } from 'class-validator';
const IMAGE_TYPES = ['image/jpeg', 'image/png', 'image/webp', 'image/gif'] as const;
export class AvatarUploadDto {
@ApiProperty({ description: 'MIME-тип изображения', example: 'image/jpeg', enum: IMAGE_TYPES })
@IsString({ message: 'Укажите MIME-тип изображения' })
@IsIn([...IMAGE_TYPES], { message: 'Допустимы только JPEG, PNG, WEBP или GIF' })
contentType!: string;
}
export class ConfirmAvatarDto {
@ApiProperty({ description: 'Ключ объекта в MinIO после загрузки', example: 'avatars/uuid/photo.jpg' })
@IsString({ message: 'Ключ хранилища должен быть строкой' })
storageKey!: string;
}
export class DocumentPhotoUploadDto {
@ApiProperty({ description: 'MIME-тип изображения', example: 'image/jpeg', enum: IMAGE_TYPES })
@IsString({ message: 'Укажите MIME-тип изображения' })
@IsIn([...IMAGE_TYPES], { message: 'Допустимы только JPEG, PNG, WEBP или GIF' })
contentType!: string;
}
export class ChatMediaUploadDto {
@ApiProperty({ description: 'MIME-тип файла', example: 'audio/webm' })
@IsString({ message: 'Укажите MIME-тип файла' })
contentType!: string;
@ApiPropertyOptional({ description: 'Имя файла для определения расширения', example: 'voice.webm' })
@IsOptional()
@IsString({ message: 'Имя файла должно быть строкой' })
fileName?: string;
}
export class UpdateAvatarStorageDto {
@ApiProperty({ description: 'Ключ объекта в MinIO', example: 'avatars/uuid/photo.jpg' })
@IsString({ message: 'Ключ хранилища должен быть строкой' })
storageKey!: string;
}