refactor(接口测试): 报告详情添加压缩处理

This commit is contained in:
fit2-zhao 2023-02-14 16:13:12 +08:00 committed by 建国
parent a296b3b16d
commit 1c0b5862f6
1 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,29 @@
package io.metersphere.commons.config;
import io.metersphere.base.domain.*;
import io.metersphere.commons.utils.CompressUtils;
import io.metersphere.interceptor.MybatisInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.ArrayList;
import java.util.List;
@Configuration
public class DatabaseConfig {
@Bean
public MybatisInterceptor dbInterceptor() {
MybatisInterceptor interceptor = new MybatisInterceptor();
List<io.metersphere.commons.utils.MybatisInterceptorConfig> configList = new ArrayList<>();
configList.add(new io.metersphere.commons.utils.MybatisInterceptorConfig(FileContent.class, "file", CompressUtils.class, "zip", "unzip"));
configList.add(new io.metersphere.commons.utils.MybatisInterceptorConfig(TestResource.class, "configuration"));
configList.add(new io.metersphere.commons.utils.MybatisInterceptorConfig(AuthSource.class, "configuration"));
configList.add(new io.metersphere.commons.utils.MybatisInterceptorConfig(ApiDefinitionExecResultWithBLOBs.class, "content", CompressUtils.class, "zipString", "unzipString"));
configList.add(new io.metersphere.commons.utils.MybatisInterceptorConfig(ApiScenarioReportStructureWithBLOBs.class, "resourceTree", CompressUtils.class, "zip", "unzip"));
configList.add(new io.metersphere.commons.utils.MybatisInterceptorConfig(ApiScenarioReportResultWithBLOBs.class, "content", CompressUtils.class, "zip", "unzip"));
configList.add(new io.metersphere.commons.utils.MybatisInterceptorConfig(ApiScenarioReportResultWithBLOBs.class, "baseInfo", CompressUtils.class, "zipString", "unzipString"));
interceptor.setInterceptorConfigList(configList);
return interceptor;
}
}