import { ApiProperty } from '@nestjs/swagger';
import { IsArray, IsNotEmpty } from 'class-validator';
import { CreateDto } from 'src/common/dto/create.dto';
import { Feature } from '../entities/feature.entity';

export class RoleDto extends CreateDto {
  @ApiProperty({ description: '角色名称' })
  @IsNotEmpty({ message: '角色名称不能为空' })
  name: string;

  @ApiProperty({ description: '角色描述' })
  desc: string;

  @ApiProperty({ description: '基于哪个角色编辑' })
  base: number;

  @ApiProperty({ description: '功能权限' })
  @IsArray()
  @IsNotEmpty({ message: '功能权限不能为空' })
  features: Array<Feature>;
}
