54 lines
1.5 KiB
TypeScript
54 lines
1.5 KiB
TypeScript
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[]; // 子评论
|
|
projectName?: string; // 项目名称
|
|
status?: string;
|
|
serialNo?: string;
|
|
businessOwner?: string;
|
|
technicalOwnerA?: string;
|
|
}
|
|
}
|
|
|
|
/** 查询评论树形列表 */
|
|
export function getCommentTree(projectId: number, sort: boolean = false) {
|
|
return requestClient.get<CommentApi.Comment[]>(
|
|
`/license/comment/tree?projectId=${projectId}&sort=${sort}`,
|
|
);
|
|
}
|
|
|
|
/** 查询评论最新列表 */
|
|
export function getLatestCommentList() {
|
|
return requestClient.get<CommentApi.Comment[]>(`/license/comment/latest`);
|
|
}
|
|
|
|
/** 新增评论 */
|
|
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}`);
|
|
}
|