20 lines
511 B
TypeScript
20 lines
511 B
TypeScript
import { ApiProperty } from '@nestjs/swagger';
|
|
import { IsString, IsNotEmpty, IsBoolean, IsOptional } from 'class-validator';
|
|
|
|
export class CreateTaskDto {
|
|
@ApiProperty({ description: '任务标题' })
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
title: string;
|
|
|
|
@ApiProperty({ description: '任务描述', required: false })
|
|
@IsString()
|
|
@IsOptional()
|
|
description?: string;
|
|
|
|
@ApiProperty({ description: '是否完成', default: false, required: false })
|
|
@IsBoolean()
|
|
@IsOptional()
|
|
isCompleted?: boolean;
|
|
}
|