feat: Implement real-time messaging module with REST API endpoints and WebSocket gateway.
This commit is contained in:
35
src/messages/dto/create-message.dto.ts
Normal file
35
src/messages/dto/create-message.dto.ts
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user