import { IncrementIdEntity } from 'src/common/entities/increment-id.entity';
import { Column, Entity } from 'typeorm';

/**
 * 课程列表
 */
@Entity()
export class CourseList extends IncrementIdEntity {
  @Column({ type: 'longtext', comment: '课程名称' })
  name: string;

  @Column({ comment: '所属分类ID' })
  classify: number;

  @Column({ name: 'section_count', comment: '章节数' })
  sectionCount: number;

  @Column({ comment: '难度' })
  difficulty: number;

  @Column({ comment: '课程状态0|1' })
  status: number;

  @Column({ comment: '课程分数' })
  grade: number;

  @Column({ type: 'longtext', comment: '课程封面' })
  cover: string;

  @Column({ type: 'longtext', comment: '课程简介' })
  explain: string;

  @Column({ name: 'study_org_id', comment: '学习该课程的组织' })
  studyOrgId: number;

  @Column({ name: 'section_sort_study', comment: '0/1章节顺序学习？' })
  sectionSortStudy: number;

  @Column({ name: 'courseware_sort_study', comment: '课件顺序学习？' })
  coursewareSortStudy: number;

  @Column({ name: 'open_quiz', comment: '0/1开启课程问答' })
  openQuiz: number;

  @Column({ name: 'open_discussion', comment: '0/1开启讨论' })
  openDiscussion: number;

  @Column({ name: 'open_self_evaluation', comment: '0/1开启学员自评' })
  openSelfEvaluation: number;

  @Column({ name: 'open_eval', comment: '0/1开启课程评价', default: 0 })
  openEval: number;

  @Column({
    name: 'text_or_grade_evalute',
    comment: '0/1开启课程文本或维度评价',
    default: 0,
  })
  txtOrGradeEvealute: number;

  @Column({
    name: 'text_or_grade_self-eval',
    comment: '0/1开启课程文本或维度评价',
  })
  textOrGradeSelfEval: number;

  @Column({
    type: 'longtext',
    name: 'text_evaluate_title',
    comment: '文本评价的标题',
  })
  textEvaluateTitle: string;

  @Column({
    type: 'longtext',
    name: 'self_text_evaluate_title',
    comment: '文本评价的标题',
  })
  selfTextEvaluateTitle: string;

  @Column({ name: 'view_number', comment: '已观看人数', default: 0 })
  viewNumber: number;

  @Column({ name: 'course_hours', comment: '课程学时', default: 0 })
  courseHours: number;
}
