import { ApiBody, ApiParam, ApiProperty } from '@nestjs/swagger';
import {
  IsArray,
  IsBoolean,
  isBoolean,
  IsNumber,
  IsString,
} from 'class-validator';
export class CreateArticleManageDto {
  @ApiProperty({ description: '文章标题', example: '测试文章' })
  @IsString()
  title: string;

  @ApiProperty({ description: '文章说明', example: '这里是测试文章' })
  @IsString()
  explain: string;

  @ApiProperty({ description: '文章内容', example: 'xxxx' })
  @IsString()
  content: string;

  @ApiProperty({ description: '所属手册', example: '1' })
  @IsNumber()
  manuals: number;

  @ApiProperty({
    description: '类型：可以是文档或者是分组，值为：article|group',
    example: 'article',
  })
  @IsString()
  type: string;

  @ApiProperty({ description: '父级ID', example: '0' })
  @IsNumber()
  parentId: number;

  @ApiProperty({ description: '资源是否可下载', example: true })
  @IsBoolean({ message: '请传递resourceAuthority参数为boolean值' })
  resourceAuthority: boolean;

  @ApiProperty({ description: '在当前父级的序号', example: 1 })
  @IsNumber()
  index: number;

  @ApiProperty({ description: '文章中所含视频数量', example: 1 })
  @IsNumber()
  video: number;

  @ApiProperty({ description: '文章中所含视频数量', example: 1 })
  @IsNumber()
  image: number;

  @ApiProperty({ description: '文章中所含模型数量', example: 1 })
  @IsNumber()
  model: number;

  @ApiProperty({ description: '文章中所含音频数量', example: 1 })
  @IsNumber()
  audio: number;
}
