From 43d696670f1532839dae5ee39552639038a62284 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Tue, 16 Apr 2024 20:37:13 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=B3=BB=E7=BB=9F=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B5=84=E6=BA=90=E6=B1=A0=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1039332 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001039332 --- .../system/controller/TestResourcePoolController.java | 2 +- .../system/service/TestResourcePoolService.java | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/TestResourcePoolController.java b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/TestResourcePoolController.java index 2161be70d7..c18cf40044 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/TestResourcePoolController.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/TestResourcePoolController.java @@ -36,7 +36,7 @@ public class TestResourcePoolController { @CacheNode // 把监控节点缓存起来 @Operation(summary = "系统设置-系统-资源池-更新资源池") @RequiresPermissions(PermissionConstants.SYSTEM_TEST_RESOURCE_POOL_READ_UPDATE) - @Log(type = OperationLogType.UPDATE, expression = "#msClass.updateLog(#request.getId())", msClass = TestResourcePoolService.class) + @Log(type = OperationLogType.UPDATE, expression = "#msClass.updateLog(#request)", msClass = TestResourcePoolService.class) public void updateTestResourcePool(@Validated({Updated.class}) @RequestBody TestResourcePoolRequest request) { TestResourcePoolDTO testResourcePool = new TestResourcePoolDTO(); BeanUtils.copyBean(testResourcePool, request); diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/service/TestResourcePoolService.java b/backend/services/system-setting/src/main/java/io/metersphere/system/service/TestResourcePoolService.java index 546bd061d4..2720ce75a9 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/service/TestResourcePoolService.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/service/TestResourcePoolService.java @@ -9,10 +9,7 @@ import io.metersphere.sdk.util.CommonBeanFactory; import io.metersphere.sdk.util.JSON; import io.metersphere.sdk.util.Translator; import io.metersphere.system.domain.*; -import io.metersphere.system.dto.pool.TestResourceDTO; -import io.metersphere.system.dto.pool.TestResourcePoolDTO; -import io.metersphere.system.dto.pool.TestResourcePoolReturnDTO; -import io.metersphere.system.dto.pool.TestResourceReturnDTO; +import io.metersphere.system.dto.pool.*; import io.metersphere.system.dto.sdk.OptionDTO; import io.metersphere.system.dto.sdk.QueryResourcePoolRequest; import io.metersphere.system.log.constants.OperationLogModule; @@ -236,8 +233,8 @@ public class TestResourcePoolService { return testResourcePoolMapper.selectByPrimaryKey(testResourcePoolId); } - public LogDTO updateLog(String resourcePoolId) { - TestResourcePool pool = testResourcePoolMapper.selectByPrimaryKey(resourcePoolId); + public LogDTO updateLog(TestResourcePoolRequest request) { + TestResourcePool pool = testResourcePoolMapper.selectByPrimaryKey(request.getId()); if (pool != null) { LogDTO dto = new LogDTO( OperationLogConstants.SYSTEM, @@ -246,7 +243,7 @@ public class TestResourcePoolService { pool.getCreateUser(), OperationLogType.UPDATE.name(), OperationLogModule.SETTING_SYSTEM_RESOURCE_POOL, - pool.getName()); + request.getName()); dto.setPath("/update"); dto.setMethod(HttpMethodConstants.POST.name());