From ba2701d7bd2c250d372f19caf7c26c8b3c766838 Mon Sep 17 00:00:00 2001 From: AgAngle <1323481023@qq.com> Date: Thu, 29 Feb 2024 17:36:19 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E9=A1=B9=E7=9B=AE=E8=AE=BE=E7=BD=AE):?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E6=8F=8F=E8=BF=B0=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E9=95=BF=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migration/3.0.0/ddl/V3.0.0_11__system_setting.sql | 8 ++++---- .../api/dto/definition/ApiDefinitionAddRequest.java | 2 +- .../api/service/definition/ApiDefinitionService.java | 2 +- .../system/dto/sdk/request/StatusItemAddRequest.java | 2 +- .../system/dto/sdk/request/StatusItemUpdateRequest.java | 2 +- .../system/dto/sdk/request/TemplateUpdateRequest.java | 1 + .../system/dto/sdk/request/UserRoleUpdateRequest.java | 1 + 7 files changed, 10 insertions(+), 8 deletions(-) diff --git a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_11__system_setting.sql b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_11__system_setting.sql index 4aed45a648..664213e06f 100644 --- a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_11__system_setting.sql +++ b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_11__system_setting.sql @@ -8,7 +8,7 @@ CREATE TABLE IF NOT EXISTS auth_source `enable` BIT NOT NULL DEFAULT 0 COMMENT '是否启用', `create_time` BIGINT NOT NULL COMMENT '创建时间', `update_time` BIGINT NOT NULL COMMENT '更新时间', - `description` VARCHAR(500) COMMENT '描述', + `description` VARCHAR(1000) COMMENT '描述', `name` VARCHAR(255) COMMENT '名称', `type` VARCHAR(30) COMMENT '类型', PRIMARY KEY (id) @@ -25,7 +25,7 @@ CREATE TABLE IF NOT EXISTS user_role ( `id` VARCHAR(50) NOT NULL COMMENT '组ID', `name` VARCHAR(255) NOT NULL COMMENT '组名称', - `description` VARCHAR(500) COMMENT '描述', + `description` VARCHAR(1000) COMMENT '描述', `internal` BIT NOT NULL COMMENT '是否是内置用户组', `type` VARCHAR(20) NOT NULL COMMENT '所属类型 SYSTEM ORGANIZATION PROJECT', `create_time` BIGINT NOT NULL COMMENT '创建时间', @@ -381,7 +381,7 @@ CREATE TABLE IF NOT EXISTS custom_field_option( CREATE TABLE IF NOT EXISTS template( `id` VARCHAR(50) NOT NULL COMMENT 'ID' , `name` VARCHAR(255) NOT NULL COMMENT '名称' , - `remark` VARCHAR(500) COMMENT '备注' , + `remark` VARCHAR(1000) COMMENT '备注' , `internal` BIT NOT NULL DEFAULT 0 COMMENT '是否是内置模板' , `update_time` BIGINT NOT NULL COMMENT '创建时间' , `create_time` BIGINT NOT NULL COMMENT '创建时间' , @@ -419,7 +419,7 @@ CREATE TABLE IF NOT EXISTS status_item( `id` VARCHAR(50) NOT NULL COMMENT '状态ID' , `name` VARCHAR(255) NOT NULL COMMENT '状态名称' , `scene` VARCHAR(30) NOT NULL COMMENT '使用场景' , - `remark` VARCHAR(500) COMMENT '状态说明' , + `remark` VARCHAR(1000) COMMENT '状态说明' , `internal` BIT NOT NULL DEFAULT 0 COMMENT '是否是内置字段' , `scope_type` VARCHAR(50) NOT NULL DEFAULT 0 COMMENT '组织或项目级别字段(PROJECT, ORGANIZATION)' , `ref_id` VARCHAR(50) COMMENT '项目状态所关联的组织状态ID' , diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ApiDefinitionAddRequest.java b/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ApiDefinitionAddRequest.java index 10bb23c03b..62ed2db60e 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ApiDefinitionAddRequest.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ApiDefinitionAddRequest.java @@ -77,7 +77,7 @@ public class ApiDefinitionAddRequest implements Serializable { @Schema(description = "响应内容") @NotNull - private Object response; + private List response; /** * 新上传的文件ID diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionService.java index 3c961abf23..f4a5921d92 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiDefinitionService.java @@ -195,7 +195,7 @@ public class ApiDefinitionService { apiDefinitionBlob.setId(apiDefinition.getId()); apiDefinitionBlob.setRequest(getMsTestElementStr(request.getRequest()).getBytes()); if (request.getResponse() != null) { - List msHttpResponse = JSON.parseArray(JSON.toJSONString(request.getResponse()), HttpResponse.class); + List msHttpResponse = request.getResponse(); msHttpResponse.forEach(item -> item.setId(IDGenerator.nextStr())); apiDefinitionBlob.setResponse(JSON.toJSONString(msHttpResponse).getBytes()); } diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/request/StatusItemAddRequest.java b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/request/StatusItemAddRequest.java index 24b6b80419..687e0c0bf5 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/request/StatusItemAddRequest.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/request/StatusItemAddRequest.java @@ -29,7 +29,7 @@ public class StatusItemAddRequest implements Serializable { private String scene; @Schema(description = "状态说明") - @Size(max = 500) + @Size(max = 1000) private String remark; @Schema(description = "所有状态都可以流转到该状态") diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/request/StatusItemUpdateRequest.java b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/request/StatusItemUpdateRequest.java index 00e7cb4efe..fa247511b2 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/request/StatusItemUpdateRequest.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/request/StatusItemUpdateRequest.java @@ -21,6 +21,6 @@ public class StatusItemUpdateRequest implements Serializable { private String name; @Schema(description = "状态说明") - @Size(max = 500) + @Size(max = 1000) private String remark; } \ No newline at end of file diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/request/TemplateUpdateRequest.java b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/request/TemplateUpdateRequest.java index c1d2af5c1d..823a5b326b 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/request/TemplateUpdateRequest.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/request/TemplateUpdateRequest.java @@ -25,6 +25,7 @@ public class TemplateUpdateRequest { private String name; @Schema(title = "备注") + @Size(max = 1000, groups = {Created.class, Updated.class}) private String remark; @Schema(title = "组织或项目ID", requiredMode = Schema.RequiredMode.REQUIRED) diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/request/UserRoleUpdateRequest.java b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/request/UserRoleUpdateRequest.java index 0657f25814..cd82856c7c 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/request/UserRoleUpdateRequest.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/request/UserRoleUpdateRequest.java @@ -29,6 +29,7 @@ public class UserRoleUpdateRequest implements Serializable { private String name; @Schema(description = "描述") + @Size(max = 1000, groups = {Created.class, Updated.class}) private String description; @Schema(description = "所属类型 SYSTEM ORGANIZATION PROJECT", requiredMode = Schema.RequiredMode.REQUIRED)