From 9dfcbc603ed011f85ba961885ffa207bd66a8edc Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Fri, 26 May 2023 15:30:44 +0800 Subject: [PATCH] =?UTF-8?q?build:=20=E9=85=8D=E7=BD=AE=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E5=A4=A7=E5=AD=97=E6=AE=B5=E5=8E=8B=E7=BC=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/domain/UiCustomCommand.java | 2 +- .../ui/domain/UiCustomCommandModule.java | 2 +- .../sdk/config/interceptor/UiInterceptor.java | 34 +++++++++++++++++++ 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 backend/framework/sdk/src/main/java/io/metersphere/sdk/config/interceptor/UiInterceptor.java diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiCustomCommand.java b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiCustomCommand.java index 2aa3679747..8ec6e7a843 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiCustomCommand.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiCustomCommand.java @@ -98,7 +98,7 @@ public class UiCustomCommand implements Serializable { @Schema(title = "指向初始版本ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{ui_custom_command.ref_id.not_blank}", groups = {Updated.class}) - @Size(min = 1, max = 255, message = "{ui_custom_command.ref_id.length_range}", groups = {Created.class, Updated.class}) + @Size(min = 1, max = 50, message = "{ui_custom_command.ref_id.length_range}", groups = {Created.class, Updated.class}) private String refId; @Schema(title = "是否为最新版本 0:否,1:是", requiredMode = Schema.RequiredMode.REQUIRED) diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiCustomCommandModule.java b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiCustomCommandModule.java index 4ba8731ff0..5d7ff8df42 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiCustomCommandModule.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiCustomCommandModule.java @@ -22,7 +22,7 @@ public class UiCustomCommandModule implements Serializable { @Schema(title = "模块名称", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{ui_custom_command_module.name.not_blank}", groups = {Updated.class}) - @Size(min = 1, max = 64, message = "{ui_custom_command_module.name.length_range}", groups = {Created.class, Updated.class}) + @Size(min = 1, max = 255, message = "{ui_custom_command_module.name.length_range}", groups = {Created.class, Updated.class}) private String name; @Schema(title = "父级ID", requiredMode = Schema.RequiredMode.REQUIRED) diff --git a/backend/framework/sdk/src/main/java/io/metersphere/sdk/config/interceptor/UiInterceptor.java b/backend/framework/sdk/src/main/java/io/metersphere/sdk/config/interceptor/UiInterceptor.java new file mode 100644 index 0000000000..d61dbb3b1d --- /dev/null +++ b/backend/framework/sdk/src/main/java/io/metersphere/sdk/config/interceptor/UiInterceptor.java @@ -0,0 +1,34 @@ +package io.metersphere.sdk.config.interceptor; + +import io.metersphere.load.domain.*; +import io.metersphere.sdk.util.CompressUtils; +import io.metersphere.sdk.util.MybatisInterceptorConfig; +import io.metersphere.ui.domain.*; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +import java.util.ArrayList; +import java.util.List; + +@Configuration +public class UiInterceptor { + @Bean + public List uiCompressConfigs() { + List configList = new ArrayList<>(); + + configList.add(new MybatisInterceptorConfig(UiCustomCommandBlob.class, "scenarioDefinition", CompressUtils.class, "zip", "unzip")); + configList.add(new MybatisInterceptorConfig(UiCustomCommandBlob.class, "commandViewStruct", CompressUtils.class, "zip", "unzip")); + + configList.add(new MybatisInterceptorConfig(UiScenarioBlob.class, "scenarioDefinition", CompressUtils.class, "zip", "unzip")); + configList.add(new MybatisInterceptorConfig(UiScenarioBlob.class, "environmentJson", CompressUtils.class, "zip", "unzip")); + + configList.add(new MybatisInterceptorConfig(UiScenarioReportDetail.class, "content", CompressUtils.class, "zip", "unzip")); + configList.add(new MybatisInterceptorConfig(UiScenarioReportDetail.class, "baseInfo", CompressUtils.class, "zip", "unzip")); + + configList.add(new MybatisInterceptorConfig(UiScenarioReportLog.class, "console", CompressUtils.class, "zip", "unzip")); + + configList.add(new MybatisInterceptorConfig(UiScenarioReportStructure.class, "resourceTree", CompressUtils.class, "zip", "unzip")); + + return configList; + } +}