import { ApiProperty } from '@nestjs/swagger';
import { IsArray, IsNotEmpty, IsString } from 'class-validator';

/**
 * 黑名单用户 DTO
 */
export class BlacklistUserDto {
  @ApiProperty({ description: '短 UID', example: 1001 })
  shortUid?: number;

  @ApiProperty({ description: '用户名称', example: '张三' })
  userName?: string;
}
/**
 * Token 响应数据 DTO
 */
export class TokenResponseDto {
  @ApiProperty({ description: '应用 ID', example: '1234567890' })
  public appid!: string;

  @ApiProperty({ description: '声网 RTC 的 Token', example: '0061234567890abcdef...' })
  public rtcToken!: string;

  @ApiProperty({ description: '过期时间戳', example: 1704067200000 })
  public expiresAt!: number;
}

/**
 * 学生详细信息响应 DTO
 */
export class StudentDetailResponseDto {
  @ApiProperty({ description: '学生长 ID (数据库 ID)', example: 1234567890 })
  longId!: number;

  @ApiProperty({ description: '学生短 ID (声网短 ID)', example: 1001 })
  shortId!: number;

  @ApiProperty({ description: '学生姓名', example: '张三' })
  studentName!: string;
}

/**
 * 保存学生排序请求 DTO
 */
export class SaveStudentOrderDto {
  @ApiProperty({ description: '房间 ID', example: 'room_123' })
  @IsNotEmpty({ message: 'roomId 不能为空' })
  @IsString({ message: 'roomId 必须是字符串' })
  roomId!: string;

  @ApiProperty({ description: '学生短 ID 数组 (按排序顺序)', example: [1001, 1002, 1003] })
  @IsNotEmpty({ message: 'studentShortIds 不能为空' })
  @IsArray({ message: 'studentShortIds 必须是数组' })
  studentShortIds!: number[];
}
