更新:课程详情的初步代码
This commit is contained in:
43
types/comment.d.ts
vendored
Normal file
43
types/comment.d.ts
vendored
Normal 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 // 图书评论
|
||||
}
|
||||
Reference in New Issue
Block a user