import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsNumber } from 'class-validator';
import { CreateDto } from 'src/common/dto/create.dto';

/**
 * 学员对于某课件的学习信息
 */
export class CourseStudyRecordDto extends CreateDto {
  @ApiProperty({ description: '学员ID' })
  @IsNotEmpty({ message: '学员ID不能为空' })
  @IsNumber()
  studentId: string;

  @ApiProperty({ description: '课程名ID' })
  @IsNotEmpty({ message: '课程ID不能为空' })
  @IsNumber()
  courseId: number;

  @ApiProperty({ description: '已学习时长' })
  @IsNotEmpty({ message: '已学习时长不能为空' })
  @IsNumber()
  studyTime: number;

  @ApiProperty({ description: '得分' })
  @IsNotEmpty({ message: '得分不能为空' })
  @IsNumber()
  score: number;

  @ApiProperty({ description: '学习进度：0未开始，1进行中，2已完成' })
  @IsNotEmpty({ message: '学习进度不能为空' })
  studyProgress: number;

  @ApiProperty({ description: '练习题分数' })
  @IsNotEmpty({ message: '练习题分数不可为空' })
  @IsNumber()
  exerciseGrade: number;

  @ApiProperty({ description: '自我评价的内容' })
  selfEvael: string;

  @ApiProperty({ description: '课程评价的内容' })
  courseEveal: string;
}
export class findMyCourse_Type {
  @ApiProperty({ description: '要查询的课程类型' })
  type: number;
  @ApiProperty({ description: '要查询的页码' })
  page: number;
  @ApiProperty({ description: '要查询的页码大小' })
  pageSize: number;
  @ApiProperty({ description: '要搜索的内容' })
  search: string;
}
export class findMyCourse_All {
  @ApiProperty({ description: '要查询的页码' })
  page: number;
  @ApiProperty({ description: '要查询的页码大小' })
  pageSize: number;
  @ApiProperty({ description: '要搜索的内容' })
  search: string;
}
