diff --git a/frontend/src/api/modules/bug-management/index.ts b/frontend/src/api/modules/bug-management/index.ts index 49e7977976..7b223d878f 100644 --- a/frontend/src/api/modules/bug-management/index.ts +++ b/frontend/src/api/modules/bug-management/index.ts @@ -1,7 +1,9 @@ +import { CommentParams } from '@/components/business/ms-comment/types'; + import MSR from '@/api/http/index'; import * as bugURL from '@/api/requrls/bug-management'; -import { BugEditFormObject, BugExportParams, BugListItem } from '@/models/bug-management'; +import { BugEditFormObject, BugExportParams, BugListItem, CreateOrUpdateComment } from '@/models/bug-management'; import { AssociatedList } from '@/models/caseManagement/featureCase'; import { CommonList, TableQueryParams, TemplateOption } from '@/models/common'; @@ -89,3 +91,19 @@ export function followBug(id: string, isFollow: boolean) { } return MSR.get({ url: `${bugURL.getFollowBugUrl}${id}` }); } + +// 创建评论 +export function createOrUpdateComment(data: CommentParams) { + if (data.id) { + return MSR.post({ url: bugURL.postUpdateCommentUrl, data }); + } + return MSR.post({ url: bugURL.postCreateCommentUrl, data }); +} +// 获取评论列表 +export function getCommentList(bugId: string) { + return MSR.get({ url: `${bugURL.getCommentListUrl}${bugId}` }); +} +// 删除评论 +export function deleteComment(commentId: string) { + return MSR.get({ url: `${bugURL.getDeleteCommentUrl}${commentId}` }); +} diff --git a/frontend/src/api/requrls/bug-management.ts b/frontend/src/api/requrls/bug-management.ts index 93f03b75c2..e02fcff81f 100644 --- a/frontend/src/api/requrls/bug-management.ts +++ b/frontend/src/api/requrls/bug-management.ts @@ -14,3 +14,7 @@ export const postAssociatedFileListUrl = '/bug/relate/case/page'; export const getBugDetailUrl = '/bug/detail/'; export const getFollowBugUrl = '/bug/follow/'; export const getUnFollowBugUrl = '/bug/unfollow/'; +export const postUpdateCommentUrl = '/bug/comment/update'; +export const postCreateCommentUrl = '/bug/comment/add'; +export const getCommentListUrl = '/bug/comment/get/'; +export const getDeleteCommentUrl = '/bug/comment/delete/'; diff --git a/frontend/src/components/business/ms-comment/comment-item.vue b/frontend/src/components/business/ms-comment/comment-item.vue index 7a7a6c92b7..5be414d669 100644 --- a/frontend/src/components/business/ms-comment/comment-item.vue +++ b/frontend/src/components/business/ms-comment/comment-item.vue @@ -1,6 +1,6 @@