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; + } +}