feat: 项目添加评论模块
This commit is contained in:
43
apps/web-antd/src/api/license/comment/index.ts
Normal file
43
apps/web-antd/src/api/license/comment/index.ts
Normal file
@@ -0,0 +1,43 @@
|
||||
import type { Dayjs } from 'dayjs';
|
||||
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace CommentApi {
|
||||
/** 客户信息 */
|
||||
export interface Comment {
|
||||
id: number; // 主键
|
||||
projectId?: number; // 项目ID
|
||||
userId?: number; // 用户ID
|
||||
parentId?: number; // 父评论ID
|
||||
author?: string; // 评论人
|
||||
avatar?: string; // 头像
|
||||
replyUserId?: number; // 回复用户ID
|
||||
replyUser?: string; // 回复用户
|
||||
updateTime?: Dayjs; // 更新时间
|
||||
depth?: number; // 评论深度
|
||||
content?: string; // 评论内容
|
||||
children?: Comment[]; // 子评论
|
||||
}
|
||||
}
|
||||
|
||||
/** 查询评论树形列表 */
|
||||
export function getCommentTree(projectId: number, sort: boolean = false) {
|
||||
return requestClient.get<CommentApi.Comment[]>(
|
||||
`/license/comment/tree?projectId=${projectId}&sort=${sort}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 新增评论 */
|
||||
export function createComment(data: CommentApi.Comment) {
|
||||
return requestClient.post('/license/comment/create', data);
|
||||
}
|
||||
|
||||
/** 修改评论 */
|
||||
export function updateComment(data: CommentApi.Comment) {
|
||||
return requestClient.post('/license/comment/update', data);
|
||||
}
|
||||
|
||||
/** 删除客户 */
|
||||
export function deleteComment(id: number) {
|
||||
return requestClient.delete(`/license/comment/delete?id=${id}`);
|
||||
}
|
||||
Reference in New Issue
Block a user