From 28ca4251ddcd7441f00f7ae2efd2cafcc5eea142 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Sat, 30 Mar 2024 13:42:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AE=BE=E7=BD=AE=E7=B3=BB=E7=BB=9F=E4=BF=9D?= =?UTF-8?q?=E7=95=99=E5=8F=98=E6=9B=B4=E8=AE=B0=E5=BD=95=E6=9D=A1=E6=95=B0?= =?UTF-8?q?=E4=B8=BA=E7=AB=8B=E5=88=BB=E7=94=9F=E6=95=88=E7=9A=84=E7=BC=BA?= =?UTF-8?q?=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1038144 --user=王孝刚 【接口测试】定义-API/CASE-预览-变更历史-在系统参数处设置完条数未生效 https://www.tapd.cn/55049933/s/1484496 --- .../service/SystemParameterService.java | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/service/SystemParameterService.java b/backend/services/system-setting/src/main/java/io/metersphere/system/service/SystemParameterService.java index cd30ec3938..19fb421239 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/service/SystemParameterService.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/service/SystemParameterService.java @@ -3,22 +3,20 @@ package io.metersphere.system.service; import io.metersphere.sdk.constants.HttpMethodConstants; import io.metersphere.sdk.constants.OperationLogConstants; import io.metersphere.sdk.constants.ParamConstants; +import io.metersphere.sdk.exception.MSException; +import io.metersphere.sdk.util.*; +import io.metersphere.system.domain.SystemParameter; +import io.metersphere.system.domain.SystemParameterExample; import io.metersphere.system.dto.sdk.BaseCleanConfigDTO; import io.metersphere.system.dto.sdk.BaseSystemConfigDTO; import io.metersphere.system.dto.sdk.EMailInfoDto; -import io.metersphere.system.log.dto.LogDTO; -import io.metersphere.sdk.exception.MSException; +import io.metersphere.system.job.CleanHistoryJob; import io.metersphere.system.log.constants.OperationLogModule; import io.metersphere.system.log.constants.OperationLogType; +import io.metersphere.system.log.dto.LogDTO; import io.metersphere.system.mapper.BaseSystemParameterMapper; -import io.metersphere.system.notice.sender.impl.MailNoticeSender; -import io.metersphere.sdk.util.EncryptUtils; -import io.metersphere.sdk.util.JSON; -import io.metersphere.sdk.util.LogUtils; -import io.metersphere.sdk.util.Translator; -import io.metersphere.system.domain.SystemParameter; -import io.metersphere.system.domain.SystemParameterExample; import io.metersphere.system.mapper.SystemParameterMapper; +import io.metersphere.system.notice.sender.impl.MailNoticeSender; import jakarta.annotation.Resource; import jakarta.mail.internet.InternetAddress; import jakarta.mail.internet.MimeMessage; @@ -285,6 +283,13 @@ public class SystemParameterService { } else { systemParameterMapper.insert(parameter); } + if (StringUtils.equals(parameter.getParamKey(), ParamConstants.CleanConfig.OPERATION_HISTORY.getValue())) { + // 清理历史记录 + CleanHistoryJob bean = CommonBeanFactory.getBean(CleanHistoryJob.class); + if (bean != null) { + bean.cleanupLog(); + } + } }); }