src/chatbot/dto/userMessage.dto.ts
Properties |
| Optional chatId |
Type : number
|
Decorators :
@IsOptional()
|
|
Defined in src/chatbot/dto/userMessage.dto.ts:17
|
| content |
Type : MessageContent
|
Decorators :
@IsNotEmpty()
|
|
Defined in src/chatbot/dto/userMessage.dto.ts:12
|
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import {
IsNotEmpty,
IsNumber,
IsOptional,
} from "class-validator";
import { MessageContent } from "../entities/message.entity";
export class UserMessage {
@IsNotEmpty()
@ApiProperty()
content: MessageContent;
@IsOptional()
@ApiPropertyOptional()
@IsNumber()
chatId?: number;
}
export class MessageDto {
content: MessageContent;
userId: string;
type: string;
chatId: number;
status: string;
constructor(partial: Partial<MessageDto>) {
Object.assign(this, partial);
}
}