feat: Implement real-time messaging module with REST API endpoints and WebSocket gateway.

This commit is contained in:
pradeepkumar
2026-02-08 22:44:16 +05:30
parent 895a106d1b
commit 3b1a7b999e
14 changed files with 1274 additions and 34 deletions

View File

@@ -0,0 +1,35 @@
import { IsString, IsNotEmpty, IsOptional, IsEnum, MaxLength } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { MessageType } from '@prisma/client';
export class CreateMessageDto {
@ApiProperty({ description: 'Message content', maxLength: 5000 })
@IsString()
@IsNotEmpty()
@MaxLength(5000)
content: string;
@ApiPropertyOptional({ description: 'Message type', enum: MessageType, default: MessageType.TEXT })
@IsOptional()
@IsEnum(MessageType)
messageType?: MessageType = MessageType.TEXT;
@ApiPropertyOptional({ description: 'File URL for file/image messages' })
@IsOptional()
@IsString()
fileUrl?: string;
@ApiPropertyOptional({ description: 'Original file name' })
@IsOptional()
@IsString()
fileName?: string;
@ApiPropertyOptional({ description: 'File size in bytes' })
@IsOptional()
fileSize?: number;
@ApiPropertyOptional({ description: 'MIME type of the file' })
@IsOptional()
@IsString()
mimeType?: string;
}