import { Role } from '@/modules/role/entities/role.entity';
import { IsInt, IsOptional, IsString } from 'class-validator';

export class CreateUserDto {
  /**
   * 登录账号
   * @example 'juetan'
   */
  @IsString()
  username: string;
  /**
   * 用户密码
   * @example 'password'
   */
  @IsString()
  password: string;
  /**
   * 用户昵称
   * @example '绝弹'
   */
  @IsString()
  nickname: string;
  /**
   * 用户头像
   * @example './assets/222421415123.png '
   */
  @IsOptional()
  @IsString()
  avatar: string;
  /**
   * 用户角色
   * @example [1, 2, 3]
   */
  @IsOptional()
  @IsInt({ each: true })
  roles: Role[];
}
