IntelliClass_FE/types/course.ts
2025-04-03 22:57:36 +08:00

80 lines
2.2 KiB
TypeScript

/**
* 课程资源类型
* @enum {string}
*/
export type CourseResourceType = "video" | "image" | "doc" | "ppt";
/**
* 课程资源
* @interface
* @property {string} id - 资源的唯一标识符
* @property {string} name - 资源的名称
* @property {CourseResourceType} type - 资源的类型(例如:视频、图片等)
* @property {string} url - 资源所在的 URL
* @property {boolean} allow_download - 指示资源是否允许下载
*/
export interface ICourseResource {
id: string;
name: string;
type: CourseResourceType;
url: string;
allow_download: boolean;
}
/**
* 课程小节
* @interface
* @property {string} id - 章节的唯一标识符
* @property {string} title - 章节的标题
* @property {ICourseResource[]} resources - 章节中的资源数组
*/
export interface ICourseSection {
id: string;
title: string;
resources: ICourseResource[];
}
/**
* 课程章节
* @interface
* @property {string} id - 章节的唯一标识符
* @property {string} title - 章节的标题
* @property {boolean} is_published - 指示章节是否已发布
* @property {ICourseSection[]} sections - 章节中的小节数组
* @property {[]} [detections] - 待定。
*/
export interface ICourseChapter {
id: string;
title: string;
is_published: boolean;
sections: ICourseSection[];
detections?: [];
}
/**
* 课程
* @interface
* @property {string} id - 课程的唯一标识符
* @property {string} title - 课程的标题
* @property {string} description - 课程的简要描述
* @property {string} thumbnail_url - 课程缩略图的 URL
* @property {string} school_name - 提供课程的学校名称
* @property {string} teacher_name - 课程的教师名称
* @property {string} semester - 课程提供的学期
* @property {boolean} is_published - 指示课程是否已发布
* @property {number} created_at - 课程创建的日期和时间
* @property {number} updated_at - 课程最后更新的日期和时间
*/
export interface ICourse {
id: string;
title: string;
description: string;
thumbnail_url: string;
school_name: string;
teacher_name: string;
semester: string;
is_published: boolean;
created_at: number;
updated_at: number;
}