54 lines
1.5 KiB
TypeScript
54 lines
1.5 KiB
TypeScript
// types/course.d.ts
|
|
/**
|
|
* 课程相关类型定义
|
|
*/
|
|
|
|
import type { IApiResponse } from './book'
|
|
|
|
/** 医学标签(课程分类) */
|
|
export interface IMedicalTag {
|
|
id: number // 标签ID
|
|
title: string // 标签标题
|
|
icon: string // 标签图标URL
|
|
isLast: number // 是否为终极分类 0-否 1-是
|
|
children?: IMedicalTag[] // 子分类列表
|
|
pid?: number // 父级ID
|
|
}
|
|
|
|
/** 课程信息 */
|
|
export interface ICourse {
|
|
id: number // 课程ID
|
|
title: string // 课程标题
|
|
image: string // 课程封面图
|
|
}
|
|
|
|
/** 新闻信息 */
|
|
export interface INews {
|
|
id: number // 新闻ID
|
|
title: string // 新闻标题
|
|
type: number // 新闻类型 1-外部链接 其他-内部页面
|
|
url: string // 新闻链接
|
|
}
|
|
|
|
/** 课程分类树响应 */
|
|
export interface ICourseMedicalTreeResponse extends IApiResponse {
|
|
labels: IMedicalTag[] // 分类标签列表
|
|
}
|
|
|
|
/** 用户最近观看课程列表响应 */
|
|
export interface IUserLateCourseListResponse extends IApiResponse {
|
|
page: ICourse[] // 课程列表
|
|
}
|
|
|
|
/** 市场课程列表响应 */
|
|
export interface IMarketCourseListResponse extends IApiResponse {
|
|
courseList: {
|
|
records: ICourse[] // 课程列表
|
|
}
|
|
}
|
|
|
|
/** 消息列表响应 */
|
|
export interface IMessageListResponse extends IApiResponse {
|
|
messages: INews[] // 消息列表
|
|
}
|