IntelliClass_FE/types/course.ts

77 lines
1.4 KiB
TypeScript

/**
* 课程资源类型
* @enum {string}
*/
export type CourseResourceType =
| 'video'
| 'image'
| 'doc'
| 'ppt'
| 'resource'
| 'temp'
/**
* 课程资源
* @interface
*/
export interface IResource {
id: number
resourceName: string
resourceSize: number
resourceType: CourseResourceType
resourceUrl: string
allowDownload: boolean
isRepo: boolean
ownerId: number
}
export type ICreateResource = Omit<IResource, 'id'>
/**
* 课程小节
* @interface
* @property {string} id - 章节的唯一标识符
* @property {string} title - 章节的标题
* @property {ICourseResource[]} resources - 章节中的资源数组
*/
export interface ICourseSection {
id: number
title: string
resources: IResource[]
}
/**
* 课程章节
* @interface
* @property {string} id - 章节的唯一标识符
* @property {string} title - 章节的标题
* @property {boolean} is_published - 指示章节是否已发布
* @property {ICourseSection[]} sections - 章节中的小节数组
* @property {[]} [detections] - 待定。
*/
export interface ICourseChapter {
id: number
title: string
isPublished: boolean
sections: ICourseSection[]
detections?: []
}
/**
* 课程
* @interface
*/
export interface ICourse {
id: number
courseName: string
profile: string
previewUrl: string | null
schoolName: string
teacherName: string
semester: string
status: number
created_at: Date
updated_at: Date
remark: string | null
}