fix(系统管理): 修复资源池更新日志问题

--bug=1039332 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001039332
This commit is contained in:
guoyuqi 2024-04-16 20:37:13 +08:00 committed by Craftsman
parent a260e98116
commit 43d696670f
2 changed files with 5 additions and 8 deletions

View File

@ -36,7 +36,7 @@ public class TestResourcePoolController {
@CacheNode // 把监控节点缓存起来 @CacheNode // 把监控节点缓存起来
@Operation(summary = "系统设置-系统-资源池-更新资源池") @Operation(summary = "系统设置-系统-资源池-更新资源池")
@RequiresPermissions(PermissionConstants.SYSTEM_TEST_RESOURCE_POOL_READ_UPDATE) @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) { public void updateTestResourcePool(@Validated({Updated.class}) @RequestBody TestResourcePoolRequest request) {
TestResourcePoolDTO testResourcePool = new TestResourcePoolDTO(); TestResourcePoolDTO testResourcePool = new TestResourcePoolDTO();
BeanUtils.copyBean(testResourcePool, request); BeanUtils.copyBean(testResourcePool, request);

View File

@ -9,10 +9,7 @@ import io.metersphere.sdk.util.CommonBeanFactory;
import io.metersphere.sdk.util.JSON; import io.metersphere.sdk.util.JSON;
import io.metersphere.sdk.util.Translator; import io.metersphere.sdk.util.Translator;
import io.metersphere.system.domain.*; import io.metersphere.system.domain.*;
import io.metersphere.system.dto.pool.TestResourceDTO; import io.metersphere.system.dto.pool.*;
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.sdk.OptionDTO; import io.metersphere.system.dto.sdk.OptionDTO;
import io.metersphere.system.dto.sdk.QueryResourcePoolRequest; import io.metersphere.system.dto.sdk.QueryResourcePoolRequest;
import io.metersphere.system.log.constants.OperationLogModule; import io.metersphere.system.log.constants.OperationLogModule;
@ -236,8 +233,8 @@ public class TestResourcePoolService {
return testResourcePoolMapper.selectByPrimaryKey(testResourcePoolId); return testResourcePoolMapper.selectByPrimaryKey(testResourcePoolId);
} }
public LogDTO updateLog(String resourcePoolId) { public LogDTO updateLog(TestResourcePoolRequest request) {
TestResourcePool pool = testResourcePoolMapper.selectByPrimaryKey(resourcePoolId); TestResourcePool pool = testResourcePoolMapper.selectByPrimaryKey(request.getId());
if (pool != null) { if (pool != null) {
LogDTO dto = new LogDTO( LogDTO dto = new LogDTO(
OperationLogConstants.SYSTEM, OperationLogConstants.SYSTEM,
@ -246,7 +243,7 @@ public class TestResourcePoolService {
pool.getCreateUser(), pool.getCreateUser(),
OperationLogType.UPDATE.name(), OperationLogType.UPDATE.name(),
OperationLogModule.SETTING_SYSTEM_RESOURCE_POOL, OperationLogModule.SETTING_SYSTEM_RESOURCE_POOL,
pool.getName()); request.getName());
dto.setPath("/update"); dto.setPath("/update");
dto.setMethod(HttpMethodConstants.POST.name()); dto.setMethod(HttpMethodConstants.POST.name());