From 393bcabc3e3f06d8b1e59721fcd3897809de5126 Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Mon, 18 Mar 2024 20:42:33 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E7=BC=BA=E9=99=B7=E7=AE=A1=E7=90=86):?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96=E7=BC=BA=E9=99=B7=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E7=9A=84=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/bug/service/BugService.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java index b7b63f6b3e..e2a55ee6d4 100644 --- a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java +++ b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java @@ -396,7 +396,7 @@ public class BugService { List batchIds = getBatchIdsByRequest(request); batchIds.forEach(id -> delete(id, currentUser)); // 批量日志 - List logs = getBatchLogByRequest(batchIds, OperationLogType.DELETE.name(), "/bug/batch-delete", request.getProjectId(), false, false, null, currentUser); + List logs = getBatchLogByRequest(batchIds, OperationLogType.DELETE.name(), OperationLogModule.BUG_MANAGEMENT_INDEX, "/bug/batch-delete", request.getProjectId(), false, false, null, currentUser); operationLogService.batchAdd(logs); } @@ -408,7 +408,7 @@ public class BugService { List batchIds = getBatchIdsByRequest(request); batchIds.forEach(this::recover); // 批量日志 - List logs = getBatchLogByRequest(batchIds, OperationLogType.RECOVER.name(), "/bug/batch-recover", request.getProjectId(), false, false, null, currentUser); + List logs = getBatchLogByRequest(batchIds, OperationLogType.RECOVER.name(), OperationLogModule.BUG_MANAGEMENT_RECYCLE, "/bug/batch-recover", request.getProjectId(), false, false, null, currentUser); operationLogService.batchAdd(logs); } @@ -432,7 +432,7 @@ public class BugService { List batchIds = getBatchIdsByRequest(request); // 批量日志{修改之前} - List logs = getBatchLogByRequest(batchIds, OperationLogType.UPDATE.name(), "/bug/batch-update", + List logs = getBatchLogByRequest(batchIds, OperationLogType.UPDATE.name(), OperationLogModule.BUG_MANAGEMENT_INDEX, "/bug/batch-update", request.getProjectId(), true, request.isAppend(), request.getTags(), currentUser); operationLogService.batchAdd(logs); // 目前只做标签的批量编辑 @@ -1574,11 +1574,12 @@ public class BugService { * 根据批量操作参数获取批量日志 * @param batchIds 批量操作ID * @param operationType 操作类型 + * @param module 操作对象 * @param path 请求路径 * @param batchUpdate 是否批量更新 * @return 日志集合 */ - private List getBatchLogByRequest(List batchIds, String operationType, String path, String projectId, boolean batchUpdate, + private List getBatchLogByRequest(List batchIds, String operationType, String module, String path, String projectId, boolean batchUpdate, boolean appendTag, List modifiedTags, String currentUser) { Project project = projectMapper.selectByPrimaryKey(projectId); BugExample example = new BugExample(); @@ -1586,7 +1587,7 @@ public class BugService { List bugs = bugMapper.selectByExample(example); List logs = new ArrayList<>(); bugs.forEach(bug -> { - LogDTO log = new LogDTO(bug.getProjectId(), project.getOrganizationId(), bug.getId(), currentUser, operationType, OperationLogModule.BUG_MANAGEMENT_INDEX, bug.getTitle()); + LogDTO log = new LogDTO(bug.getProjectId(), project.getOrganizationId(), bug.getId(), currentUser, operationType, module, bug.getTitle()); log.setPath(path); log.setMethod(HttpMethodConstants.POST.name()); if (batchUpdate) {