更新:课程详情的初步代码

This commit is contained in:
2025-11-14 15:13:21 +08:00
parent e7e0597026
commit 21b03635a2
25 changed files with 4958 additions and 12 deletions

43
types/comment.d.ts vendored Normal file
View File

@@ -0,0 +1,43 @@
// types/comment.d.ts
/**
* 通用评论类型定义
* 用于课程和图书的评论功能
*/
import type { IApiResponse } from './book'
/** 用户信息(评论中使用) */
export interface ICommentUser {
id: number
name: string
avatar?: string
}
/** 通用评论数据结构 */
export interface IComment {
id: number
user: ICommentUser
content: string
images: string // 图片URL逗号分隔
imgList: string[] // 图片URL数组
createTime: string
support: boolean // 当前用户是否已点赞
supportCount: number // 点赞数
children: IComment[] // 所有子评论
Bchildren: IComment[] // 显示的子评论最多5条
}
/** 评论列表响应 */
export interface ICommentListResponse extends IApiResponse {
page: {
records: IComment[]
total: number
pages: number
}
}
/** 添加评论响应 */
export interface IAddCommentResponse extends IApiResponse {
courseGuestbook?: IComment // 课程评论
bookComment?: IComment // 图书评论
}