import { ApiProperty } from '@nestjs/swagger';
import {
  IsArray,
  IsDate,
  IsNotEmpty,
  IsNumber,
  isString,
  IsString,
} from 'class-validator';
import { CreateDto } from 'src/common/dto/create.dto';
/**
 *  直播信息
 */
export class CreateLiveTeachingDto extends CreateDto {
  @ApiProperty({ description: '直播标题' })
  @IsNotEmpty({ message: '直播标题不可为空' })
  @IsString()
  title: string;

  @ApiProperty({ description: '直播开始时间', default: new Date() })
  @IsNotEmpty({ message: '直播开始时间不可为空' })
  startTime: Date;

  @ApiProperty({ description: '直播真实开始时间', default: new Date() })
  actualStartTime: Date;

  @ApiProperty({ description: '直播真实结束时间', default: new Date() })
  actualEndTime: Date;

  @ApiProperty({ description: '直播时长' })
  duration: number;

  @ApiProperty({ description: '直播分类' })
  @IsNotEmpty({ message: '直播分类不可为空' })
  @IsNumber()
  classify: number;

  @ApiProperty({ description: '直播分类' })
  @IsString()
  explain: string;

  @ApiProperty({ description: '直播封面地址' })
  cover: string;

  @ApiProperty({ description: ' 直播状态 0/1/2 未开始/进行中/已结束' })
  status: string;

  @ApiProperty({ description: '暖场图片' })
  warmUpPicture: string;

  @ApiProperty({ description: '暖场音乐' })
  warmUpMusice: string;

  @ApiProperty({ description: '是否支持回放', default: 0 })
  @IsNumber()
  playback: number;

  @ApiProperty({ description: '回放停止观看时间', default: null })
  playbackDeadline: Date;

  @ApiProperty({ description: '讲师' })
  @IsNotEmpty({ message: '直播讲师不可为空' })
  @IsString()
  lecturer: string;

  @ApiProperty({ description: '是否开启讨论', default: 0 })
  @IsNumber()
  openDiscussion: number;

  @ApiProperty({ description: '是否开启评价', default: 0 })
  @IsNumber()
  openEval: number;

  @ApiProperty({ description: '文本评价或维度评价', default: 0 })
  @IsNumber()
  txtOrGradeEvealute: number;

  @ApiProperty({ description: '文本评价标题', default: '' })
  @IsString()
  textEvaluateTitle: string;

  @ApiProperty({ description: '可以观看直播的学生ID', default: [] })
  @IsArray()
  liveStudent: [number];

  @ApiProperty({ description: '直播的课后试题', default: [] })
  @IsArray()
  liveQuestion: [number];

  @ApiProperty({ description: '直播的评价维度设置', default: [] })
  @IsArray()
  evalDimension: [
    {
      dimensionality: string;
      type: number;
    },
  ];

  @ApiProperty({ description: '直播的课件ID', default: [] })
  @IsArray()
  liveCourseware: [number];
}
