1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| @ApiProperty({ description: '标题', default: '标题', }) @MinLength(5, { message: '标题字数不能小于5个字' }) title: string; @ApiProperty({ description: '内容', default: '内容', }) @IsNotEmpty({ message: '内容不能为空', }) content: string; @ApiProperty({ description: '标签', required: false, default: 1, }) tagId: number; @ApiProperty({ description: '分类ID', required: false, default: 1, }) categoryId: number;} import { AdminArticlePageDto, AdminArticleCreateDto } from './dto';@ApiOperation({ summary: '提交文章', }) create(@Body() body: AdminArticleCreateDto) { return this.articleService.create(body); }
|