import type { Component } from 'vue'

export interface IMenuItem {
  tag?: string
  name: string
  path: string
  icon?: Component
  children?: IMenuItem[]
}

// 用户类型
export interface UserType {
  avatar: string
  email: string
  id: string
  mobile: string
  name: string
  username: string
}

// 项目类型
export interface ProjectType {
  id: string
  name: string
  tab: string
}

// 机构类型
export interface OrganizationType {
  contact_information: string
  contact_name: string
  id: string
  is_valid: 1 | 2
  name: string
  validity_date: string
}

// 角色类型
export interface RoleType {
  desc: string
  id: string
  name: string
}

// 权限类型
export interface PermissionType {
  desc: string
  effect_uris: string
  id: string
  name: string
  parent_id: string
  system_tag: number
  tag: string
  type: number
}

// 课程类型
export interface CourseType {
  course_id: string
  cover: string
  credit: number
  elective_type: number
  id: string
  is_finished: number
  is_top: number
  lecturers?: LecturerType[]
  name: string
  online_type: number
  previous_preparation: string
  represent: string
  semester: SemesterType
  target: string
}

// 章节类型
export interface ChapterType {
  id: string
  name: string
  schedule: string
  watch_video_length: number
  is_finished: number
}

// 学期类型
export interface SemesterType {
  id: string
  name: string
  start_time?: string
  end_time?: string
}

// 讲师类型
export interface LecturerType {
  avatar: string
  id: string
  name: string
  summarize: string
}

// 资源类型
export interface ResourceType {
  id: string
  knowledge_points: string
  name: string
  type: string
  pdf?: string
  url?: string
  cover?: string
  size: number
  source_id: string
  paper_title?: string
}

// 直播类型
export interface LiveType {
  end_time: number
  format_status: number
  id: string
  join_url: string
  meeting_code: string
  meeting_id: string
  meeting_type: number
  start_time: number
  status: number
  sub_meetings: []
  subject: string
}

// 试卷类型
export interface PaperType {
  id: string
  is_multiple_exams: 0 | 1
  minimum_paper_handing_time: 0 | 1
  multiple_test_score_rule: 0 | 1
  paper_category: PaperCategoryType
  paper_labels: string
  paper_question_order: 0 | 1
  paper_times: number
  paper_title: string
  paper_total_score: number
  paper_type: number
  paper_uses: number
  pass_score: number
  permission: number
  project_prefix: string
}

// 试卷分类类型
export interface PaperCategoryType {
  id: string
  category_name: string
  name: string
}
