From 8fadf99743d79c592865e61c407a9a6f18af3203 Mon Sep 17 00:00:00 2001 From: jianxing Date: Mon, 31 Jul 2023 14:41:21 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20MyBatis=20Generator=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=89=B9=E9=87=8F=E6=8F=92=E5=85=A5=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metersphere/api/domain/ApiDefinition.java | 117 ++++++++++++++++-- .../api/domain/ApiDefinitionBlob.java | 85 ++++++++++++- .../api/mapper/ApiDefinitionBlobMapper.java | 4 + .../api/mapper/ApiDefinitionBlobMapper.xml | 35 ++++++ .../api/mapper/ApiDefinitionMapper.java | 4 + .../api/mapper/ApiDefinitionMapper.xml | 111 +++++++++++++++++ .../java/io/metersphere/bug/domain/Bug.java | 90 +++++++++++++- .../io/metersphere/bug/mapper/BugMapper.java | 4 + .../io/metersphere/bug/mapper/BugMapper.xml | 59 +++++++++ .../functional/domain/CaseReview.java | 91 +++++++++++++- .../functional/mapper/CaseReviewMapper.java | 4 + .../functional/mapper/CaseReviewMapper.xml | 60 +++++++++ .../project/domain/ApiTemplate.java | 82 +++++++++++- .../project/domain/BugTemplate.java | 82 +++++++++++- .../project/domain/BugTemplateExtend.java | 75 +++++++++++ .../project/domain/CustomField.java | 88 ++++++++++++- .../project/domain/CustomFieldTemplate.java | 81 ++++++++++++ .../project/domain/CustomFunction.java | 76 ++++++++++++ .../project/domain/CustomFunctionBlob.java | 76 ++++++++++++ .../metersphere/project/domain/FakeError.java | 81 ++++++++++++ .../project/domain/FakeErrorBlob.java | 75 +++++++++++ .../project/domain/FileMetadata.java | 97 ++++++++++++++- .../project/domain/FileMetadataBlob.java | 74 +++++++++++ .../project/domain/FileModule.java | 82 ++++++++++++ .../project/domain/FileModuleBlob.java | 77 ++++++++++++ .../domain/FunctionalCaseTemplate.java | 82 +++++++++++- .../domain/FunctionalCaseTemplateExtend.java | 84 ++++++++++++- .../metersphere/project/domain/Project.java | 88 ++++++++++++- .../project/domain/ProjectApplication.java | 75 +++++++++++ .../project/domain/ProjectExtend.java | 88 ++++++++++++- .../project/domain/ProjectVersion.java | 83 +++++++++++++ .../project/mapper/ApiTemplateMapper.java | 4 + .../project/mapper/ApiTemplateMapper.xml | 45 +++++++ .../mapper/BugTemplateExtendMapper.java | 4 + .../mapper/BugTemplateExtendMapper.xml | 32 +++++ .../project/mapper/BugTemplateMapper.java | 4 + .../project/mapper/BugTemplateMapper.xml | 45 +++++++ .../project/mapper/CustomFieldMapper.java | 4 + .../project/mapper/CustomFieldMapper.xml | 66 ++++++++++ .../mapper/CustomFieldTemplateMapper.java | 4 + .../mapper/CustomFieldTemplateMapper.xml | 53 ++++++++ .../mapper/CustomFunctionBlobMapper.java | 4 + .../mapper/CustomFunctionBlobMapper.xml | 35 ++++++ .../project/mapper/CustomFunctionMapper.java | 4 + .../project/mapper/CustomFunctionMapper.xml | 35 ++++++ .../project/mapper/FakeErrorBlobMapper.java | 4 + .../project/mapper/FakeErrorBlobMapper.xml | 32 +++++ .../project/mapper/FakeErrorMapper.java | 4 + .../project/mapper/FakeErrorMapper.xml | 53 ++++++++ .../mapper/FileMetadataBlobMapper.java | 4 + .../project/mapper/FileMetadataBlobMapper.xml | 28 +++++ .../project/mapper/FileMetadataMapper.java | 4 + .../project/mapper/FileMetadataMapper.xml | 84 +++++++++++++ .../project/mapper/FileModuleBlobMapper.java | 4 + .../project/mapper/FileModuleBlobMapper.xml | 39 ++++++ .../project/mapper/FileModuleMapper.java | 4 + .../project/mapper/FileModuleMapper.xml | 56 +++++++++ .../FunctionalCaseTemplateExtendMapper.java | 4 + .../FunctionalCaseTemplateExtendMapper.xml | 50 ++++++++ .../mapper/FunctionalCaseTemplateMapper.java | 4 + .../mapper/FunctionalCaseTemplateMapper.xml | 45 +++++++ .../mapper/ProjectApplicationMapper.java | 4 + .../mapper/ProjectApplicationMapper.xml | 32 +++++ .../project/mapper/ProjectExtendMapper.java | 4 + .../project/mapper/ProjectExtendMapper.xml | 63 ++++++++++ .../project/mapper/ProjectMapper.java | 4 + .../project/mapper/ProjectMapper.xml | 66 ++++++++++ .../project/mapper/ProjectVersionMapper.java | 4 + .../project/mapper/ProjectVersionMapper.xml | 59 +++++++++ .../metersphere/system/domain/AuthSource.java | 83 ++++++++++++- .../io/metersphere/system/domain/License.java | 76 ++++++++++++ .../system/domain/MessageTask.java | 85 ++++++++++++- .../system/domain/MessageTaskBlob.java | 74 +++++++++++ .../system/domain/Notification.java | 83 +++++++++++++ .../system/domain/NoviceStatistics.java | 85 ++++++++++++- .../system/domain/Organization.java | 84 +++++++++++++ .../io/metersphere/system/domain/Plugin.java | 84 +++++++++++++ .../system/domain/PluginFrontScript.java | 75 +++++++++++ .../system/domain/PluginOrganization.java | 74 +++++++++++ .../metersphere/system/domain/Schedule.java | 85 +++++++++++++ .../system/domain/ServiceIntegration.java | 76 ++++++++++++ .../system/domain/SystemParameter.java | 79 +++++++++++- .../system/domain/TestResourcePool.java | 94 +++++++++++++- .../io/metersphere/system/domain/User.java | 102 +++++++++++++-- .../metersphere/system/domain/UserExtend.java | 75 +++++++++++ .../io/metersphere/system/domain/UserKey.java | 78 ++++++++++++ .../metersphere/system/domain/UserRole.java | 81 ++++++++++++ .../system/domain/UserRolePermission.java | 75 +++++++++++ .../system/domain/UserRoleRelation.java | 88 +++++++++++-- .../system/mapper/AuthSourceMapper.java | 4 + .../system/mapper/AuthSourceMapper.xml | 49 ++++++++ .../system/mapper/LicenseMapper.java | 4 + .../system/mapper/LicenseMapper.xml | 35 ++++++ .../system/mapper/MessageTaskBlobMapper.java | 4 + .../system/mapper/MessageTaskBlobMapper.xml | 28 +++++ .../system/mapper/MessageTaskMapper.java | 4 + .../system/mapper/MessageTaskMapper.xml | 53 ++++++++ .../system/mapper/NotificationMapper.java | 4 + .../system/mapper/NotificationMapper.xml | 59 +++++++++ .../system/mapper/NoviceStatisticsMapper.java | 4 + .../system/mapper/NoviceStatisticsMapper.xml | 45 +++++++ .../system/mapper/OrganizationMapper.java | 4 + .../system/mapper/OrganizationMapper.xml | 63 ++++++++++ .../mapper/PluginFrontScriptMapper.java | 4 + .../system/mapper/PluginFrontScriptMapper.xml | 32 +++++ .../system/mapper/PluginMapper.java | 4 + .../system/mapper/PluginMapper.xml | 63 ++++++++++ .../mapper/PluginOrganizationMapper.java | 4 + .../mapper/PluginOrganizationMapper.xml | 28 +++++ .../system/mapper/ScheduleMapper.java | 4 + .../system/mapper/ScheduleMapper.xml | 66 ++++++++++ .../mapper/ServiceIntegrationMapper.java | 4 + .../mapper/ServiceIntegrationMapper.xml | 35 ++++++ .../system/mapper/SystemParameterMapper.java | 4 + .../system/mapper/SystemParameterMapper.xml | 32 +++++ .../system/mapper/TestResourcePoolMapper.java | 4 + .../system/mapper/TestResourcePoolMapper.xml | 69 +++++++++++ .../system/mapper/UserExtendMapper.java | 4 + .../system/mapper/UserExtendMapper.xml | 32 +++++ .../system/mapper/UserKeyMapper.java | 4 + .../system/mapper/UserKeyMapper.xml | 42 +++++++ .../metersphere/system/mapper/UserMapper.java | 4 + .../metersphere/system/mapper/UserMapper.xml | 73 +++++++++++ .../system/mapper/UserRoleMapper.java | 4 + .../system/mapper/UserRoleMapper.xml | 53 ++++++++ .../mapper/UserRolePermissionMapper.java | 4 + .../mapper/UserRolePermissionMapper.xml | 32 +++++ .../system/mapper/UserRoleRelationMapper.java | 4 + .../system/mapper/UserRoleRelationMapper.xml | 42 +++++++ .../ui/domain/UiCustomCommand.java | 104 +++++++++++++++- .../ui/domain/UiCustomCommandBlob.java | 75 +++++++++++ .../ui/domain/UiCustomCommandModule.java | 88 ++++++++++++- .../io/metersphere/ui/domain/UiElement.java | 94 +++++++++++++- .../ui/domain/UiElementCommandReference.java | 77 ++++++++++++ .../ui/domain/UiElementModule.java | 88 ++++++++++++- .../ui/domain/UiElementScenarioReference.java | 77 ++++++++++++ .../io/metersphere/ui/domain/UiScenario.java | 108 ++++++++++++++-- .../metersphere/ui/domain/UiScenarioBlob.java | 75 +++++++++++ .../ui/domain/UiScenarioFollower.java | 74 +++++++++++ .../ui/domain/UiScenarioModule.java | 88 ++++++++++++- .../ui/domain/UiScenarioReference.java | 78 ++++++++++++ .../ui/domain/UiScenarioReport.java | 100 ++++++++++++++- .../ui/domain/UiScenarioReportDetail.java | 82 ++++++++++++ .../domain/UiScenarioReportEnvironment.java | 75 +++++++++++ .../ui/domain/UiScenarioReportExample.java | 70 +++++++++++ .../ui/domain/UiScenarioReportLog.java | 76 ++++++++++++ .../ui/domain/UiScenarioReportStructure.java | 76 ++++++++++++ .../ui/mapper/UiCustomCommandBlobMapper.java | 4 + .../ui/mapper/UiCustomCommandBlobMapper.xml | 32 +++++ .../ui/mapper/UiCustomCommandMapper.java | 4 + .../ui/mapper/UiCustomCommandMapper.xml | 100 +++++++++++++++ .../mapper/UiCustomCommandModuleMapper.java | 4 + .../ui/mapper/UiCustomCommandModuleMapper.xml | 53 ++++++++ .../UiElementCommandReferenceMapper.java | 4 + .../UiElementCommandReferenceMapper.xml | 38 ++++++ .../ui/mapper/UiElementMapper.java | 4 + .../metersphere/ui/mapper/UiElementMapper.xml | 77 ++++++++++++ .../ui/mapper/UiElementModuleMapper.java | 4 + .../ui/mapper/UiElementModuleMapper.xml | 53 ++++++++ .../UiElementScenarioReferenceMapper.java | 4 + .../UiElementScenarioReferenceMapper.xml | 38 ++++++ .../ui/mapper/UiScenarioBlobMapper.java | 4 + .../ui/mapper/UiScenarioBlobMapper.xml | 32 +++++ .../ui/mapper/UiScenarioFollowerMapper.java | 4 + .../ui/mapper/UiScenarioFollowerMapper.xml | 28 +++++ .../ui/mapper/UiScenarioMapper.java | 4 + .../ui/mapper/UiScenarioMapper.xml | 104 ++++++++++++++++ .../ui/mapper/UiScenarioModuleMapper.java | 4 + .../ui/mapper/UiScenarioModuleMapper.xml | 53 ++++++++ .../ui/mapper/UiScenarioReferenceMapper.java | 4 + .../ui/mapper/UiScenarioReferenceMapper.xml | 42 +++++++ .../mapper/UiScenarioReportDetailMapper.java | 4 + .../mapper/UiScenarioReportDetailMapper.xml | 57 +++++++++ .../UiScenarioReportEnvironmentMapper.java | 4 + .../UiScenarioReportEnvironmentMapper.xml | 32 +++++ .../ui/mapper/UiScenarioReportLogMapper.java | 4 + .../ui/mapper/UiScenarioReportLogMapper.xml | 35 ++++++ .../ui/mapper/UiScenarioReportMapper.java | 4 + .../ui/mapper/UiScenarioReportMapper.xml | 107 ++++++++++++++-- .../UiScenarioReportStructureMapper.java | 4 + .../UiScenarioReportStructureMapper.xml | 35 ++++++ .../3.0.0/ddl/V3.0.0_11__system_setting.sql | 1 - .../src/main/resources/sdkGeneratorConfig.xml | 2 + .../src/main/resources/apiGeneratorConfig.xml | 2 + .../src/main/resources/bugGeneratorConfig.xml | 2 + backend/services/case-management/pom.xml | 2 +- .../resources/functionalGeneratorConfig.xml | 2 + .../main/resources/loadGeneratorConfig.xml | 2 + .../main/resources/projectGeneratorConfig.xml | 2 + .../system/service/SystemProjectService.java | 28 ++--- .../main/resources/systemGeneratorConfig.xml | 3 +- .../src/main/resources/uiGeneratorConfig.xml | 2 + 192 files changed, 8239 insertions(+), 149 deletions(-) diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiDefinition.java b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiDefinition.java index 0bbfc72a8c..db0febf8c5 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiDefinition.java +++ b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiDefinition.java @@ -1,14 +1,12 @@ package io.metersphere.api.domain; -import io.metersphere.validation.groups.Created; -import io.metersphere.validation.groups.Updated; +import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Size; -import lombok.Data; - +import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import lombok.Data; @Data public class ApiDefinition implements Serializable { @@ -35,8 +33,7 @@ public class ApiDefinition implements Serializable { @Schema(title = "删除时间") private Long deleteTime; - @Schema(title = "删除状态", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{api_definition.deleted.not_blank}", groups = {Created.class}) + @Schema(title = "删除状态") private Boolean deleted; @Schema(title = "接口名称", requiredMode = Schema.RequiredMode.REQUIRED) @@ -78,8 +75,7 @@ public class ApiDefinition implements Serializable { @NotNull(message = "{api_definition.pos.not_blank}", groups = {Created.class}) private Long pos; - @Schema(title = "是否启用同步", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{api_definition.sync_enable.not_blank}", groups = {Created.class}) + @Schema(title = "是否启用同步") private Boolean syncEnable; @Schema(title = "同步开始时间") @@ -93,8 +89,7 @@ public class ApiDefinition implements Serializable { @Schema(title = "环境fk") private String environmentId; - @Schema(title = "是否为最新版本 0:否,1:是", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{api_definition.latest.not_blank}", groups = {Created.class}) + @Schema(title = "是否为最新版本 0:否,1:是") private Boolean latest; @Schema(title = "版本fk") @@ -107,4 +102,100 @@ public class ApiDefinition implements Serializable { private String description; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + createTime("create_time", "createTime", "BIGINT", false), + createUser("create_user", "createUser", "VARCHAR", false), + updateTime("update_time", "updateTime", "BIGINT", false), + updateUser("update_user", "updateUser", "VARCHAR", false), + deleteUser("delete_user", "deleteUser", "VARCHAR", false), + deleteTime("delete_time", "deleteTime", "BIGINT", false), + deleted("deleted", "deleted", "BIT", false), + name("name", "name", "VARCHAR", true), + method("method", "method", "VARCHAR", true), + protocol("protocol", "protocol", "VARCHAR", false), + path("path", "path", "VARCHAR", true), + modulePath("module_path", "modulePath", "VARCHAR", false), + status("status", "status", "VARCHAR", true), + moduleId("module_id", "moduleId", "VARCHAR", false), + num("num", "num", "INTEGER", false), + tags("tags", "tags", "VARCHAR", false), + pos("pos", "pos", "BIGINT", false), + syncEnable("sync_enable", "syncEnable", "BIT", false), + syncTime("sync_time", "syncTime", "BIGINT", false), + projectId("project_id", "projectId", "VARCHAR", false), + environmentId("environment_id", "environmentId", "VARCHAR", false), + latest("latest", "latest", "BIT", false), + versionId("version_id", "versionId", "VARCHAR", false), + refId("ref_id", "refId", "VARCHAR", false), + description("description", "description", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiDefinitionBlob.java b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiDefinitionBlob.java index d906fa6bcf..0ecc290690 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiDefinitionBlob.java +++ b/backend/framework/domain/src/main/java/io/metersphere/api/domain/ApiDefinitionBlob.java @@ -1,13 +1,12 @@ package io.metersphere.api.domain; -import io.metersphere.validation.groups.Created; -import io.metersphere.validation.groups.Updated; +import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.Size; -import lombok.Data; - +import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import lombok.Data; @Data public class ApiDefinitionBlob implements Serializable { @@ -26,4 +25,78 @@ public class ApiDefinitionBlob implements Serializable { private byte[] remark; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + request("request", "request", "LONGVARBINARY", false), + response("response", "response", "LONGVARBINARY", false), + remark("remark", "remark", "LONGVARBINARY", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiDefinitionBlobMapper.java b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiDefinitionBlobMapper.java index a4f75a59d5..fb13b5caa1 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiDefinitionBlobMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiDefinitionBlobMapper.java @@ -31,4 +31,8 @@ public interface ApiDefinitionBlobMapper { int updateByPrimaryKeySelective(ApiDefinitionBlob record); int updateByPrimaryKeyWithBLOBs(ApiDefinitionBlob record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") ApiDefinitionBlob.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiDefinitionBlobMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiDefinitionBlobMapper.xml index 2318a896a4..bf37417dc7 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiDefinitionBlobMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiDefinitionBlobMapper.xml @@ -223,4 +223,39 @@ remark = #{remark,jdbcType=LONGVARBINARY} where id = #{id,jdbcType=VARCHAR} + + insert into api_definition_blob + (id, request, response, remark) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.request,jdbcType=LONGVARBINARY}, #{item.response,jdbcType=LONGVARBINARY}, + #{item.remark,jdbcType=LONGVARBINARY}) + + + + insert into api_definition_blob ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.request,jdbcType=LONGVARBINARY} + + + #{item.response,jdbcType=LONGVARBINARY} + + + #{item.remark,jdbcType=LONGVARBINARY} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiDefinitionMapper.java b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiDefinitionMapper.java index ee1a63ee05..3e6adf4f6f 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiDefinitionMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiDefinitionMapper.java @@ -27,4 +27,8 @@ public interface ApiDefinitionMapper { int updateByPrimaryKeySelective(ApiDefinition record); int updateByPrimaryKey(ApiDefinition record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") ApiDefinition.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiDefinitionMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiDefinitionMapper.xml index 17884932bf..25f4822ffe 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiDefinitionMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/api/mapper/ApiDefinitionMapper.xml @@ -540,4 +540,115 @@ description = #{description,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into api_definition + (id, create_time, create_user, update_time, update_user, delete_user, delete_time, + deleted, `name`, `method`, protocol, `path`, module_path, `status`, module_id, + num, tags, pos, sync_enable, sync_time, project_id, environment_id, latest, version_id, + ref_id, description) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, #{item.createUser,jdbcType=VARCHAR}, + #{item.updateTime,jdbcType=BIGINT}, #{item.updateUser,jdbcType=VARCHAR}, #{item.deleteUser,jdbcType=VARCHAR}, + #{item.deleteTime,jdbcType=BIGINT}, #{item.deleted,jdbcType=BIT}, #{item.name,jdbcType=VARCHAR}, + #{item.method,jdbcType=VARCHAR}, #{item.protocol,jdbcType=VARCHAR}, #{item.path,jdbcType=VARCHAR}, + #{item.modulePath,jdbcType=VARCHAR}, #{item.status,jdbcType=VARCHAR}, #{item.moduleId,jdbcType=VARCHAR}, + #{item.num,jdbcType=INTEGER}, #{item.tags,jdbcType=VARCHAR}, #{item.pos,jdbcType=BIGINT}, + #{item.syncEnable,jdbcType=BIT}, #{item.syncTime,jdbcType=BIGINT}, #{item.projectId,jdbcType=VARCHAR}, + #{item.environmentId,jdbcType=VARCHAR}, #{item.latest,jdbcType=BIT}, #{item.versionId,jdbcType=VARCHAR}, + #{item.refId,jdbcType=VARCHAR}, #{item.description,jdbcType=VARCHAR}) + + + + insert into api_definition ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.createUser,jdbcType=VARCHAR} + + + #{item.updateTime,jdbcType=BIGINT} + + + #{item.updateUser,jdbcType=VARCHAR} + + + #{item.deleteUser,jdbcType=VARCHAR} + + + #{item.deleteTime,jdbcType=BIGINT} + + + #{item.deleted,jdbcType=BIT} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.method,jdbcType=VARCHAR} + + + #{item.protocol,jdbcType=VARCHAR} + + + #{item.path,jdbcType=VARCHAR} + + + #{item.modulePath,jdbcType=VARCHAR} + + + #{item.status,jdbcType=VARCHAR} + + + #{item.moduleId,jdbcType=VARCHAR} + + + #{item.num,jdbcType=INTEGER} + + + #{item.tags,jdbcType=VARCHAR} + + + #{item.pos,jdbcType=BIGINT} + + + #{item.syncEnable,jdbcType=BIT} + + + #{item.syncTime,jdbcType=BIGINT} + + + #{item.projectId,jdbcType=VARCHAR} + + + #{item.environmentId,jdbcType=VARCHAR} + + + #{item.latest,jdbcType=BIT} + + + #{item.versionId,jdbcType=VARCHAR} + + + #{item.refId,jdbcType=VARCHAR} + + + #{item.description,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/bug/domain/Bug.java b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/Bug.java index dbecbcfd74..62456c42b8 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/bug/domain/Bug.java +++ b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/Bug.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -13,8 +15,7 @@ public class Bug implements Serializable { @Size(min = 1, max = 50, message = "{bug.id.length_range}", groups = {Created.class, Updated.class}) private String id; - @Schema(title = "业务ID", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{bug.num.not_blank}", groups = {Created.class}) + @Schema(title = "业务ID") private Integer num; @Schema(title = "缺陷标题", requiredMode = Schema.RequiredMode.REQUIRED) @@ -44,13 +45,92 @@ public class Bug implements Serializable { @Schema(title = "缺陷来源,记录创建该缺陷的测试计划的ID") private String sourceId; - @Schema(title = "第三方平台状态", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{bug.platform_status.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 50, message = "{bug.platform_status.length_range}", groups = {Created.class, Updated.class}) + @Schema(title = "第三方平台状态") private String platformStatus; @Schema(title = "第三方平台缺陷ID") private String platformId; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + num("num", "num", "INTEGER", false), + title("title", "title", "VARCHAR", false), + createTime("create_time", "createTime", "BIGINT", false), + updateTime("update_time", "updateTime", "BIGINT", false), + platform("platform", "platform", "VARCHAR", false), + projectId("project_id", "projectId", "VARCHAR", false), + createUser("create_user", "createUser", "VARCHAR", false), + sourceId("source_id", "sourceId", "VARCHAR", false), + platformStatus("platform_status", "platformStatus", "VARCHAR", false), + platformId("platform_id", "platformId", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/bug/mapper/BugMapper.java b/backend/framework/domain/src/main/java/io/metersphere/bug/mapper/BugMapper.java index f9969630d7..ebd1bf3c90 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/bug/mapper/BugMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/bug/mapper/BugMapper.java @@ -27,4 +27,8 @@ public interface BugMapper { int updateByPrimaryKeySelective(Bug record); int updateByPrimaryKey(Bug record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") Bug.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/bug/mapper/BugMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/bug/mapper/BugMapper.xml index 1a66f66d42..3ff00c74b4 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/bug/mapper/BugMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/bug/mapper/BugMapper.xml @@ -303,4 +303,63 @@ platform_id = #{platformId,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into bug + (id, num, title, create_time, update_time, platform, project_id, create_user, source_id, + platform_status, platform_id) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.num,jdbcType=INTEGER}, #{item.title,jdbcType=VARCHAR}, + #{item.createTime,jdbcType=BIGINT}, #{item.updateTime,jdbcType=BIGINT}, #{item.platform,jdbcType=VARCHAR}, + #{item.projectId,jdbcType=VARCHAR}, #{item.createUser,jdbcType=VARCHAR}, #{item.sourceId,jdbcType=VARCHAR}, + #{item.platformStatus,jdbcType=VARCHAR}, #{item.platformId,jdbcType=VARCHAR}) + + + + insert into bug ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.num,jdbcType=INTEGER} + + + #{item.title,jdbcType=VARCHAR} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.updateTime,jdbcType=BIGINT} + + + #{item.platform,jdbcType=VARCHAR} + + + #{item.projectId,jdbcType=VARCHAR} + + + #{item.createUser,jdbcType=VARCHAR} + + + #{item.sourceId,jdbcType=VARCHAR} + + + #{item.platformStatus,jdbcType=VARCHAR} + + + #{item.platformId,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/functional/domain/CaseReview.java b/backend/framework/domain/src/main/java/io/metersphere/functional/domain/CaseReview.java index 373ab96b94..92493c47d7 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/functional/domain/CaseReview.java +++ b/backend/framework/domain/src/main/java/io/metersphere/functional/domain/CaseReview.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -18,9 +20,7 @@ public class CaseReview implements Serializable { @Size(min = 1, max = 200, message = "{case_review.name.length_range}", groups = {Created.class, Updated.class}) private String name; - @Schema(title = "评审状态:未开始/进行中/已完成/已结束/已归档", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{case_review.status.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 64, message = "{case_review.status.length_range}", groups = {Created.class, Updated.class}) + @Schema(title = "评审状态:未开始/进行中/已完成/已结束/已归档") private String status; @Schema(title = "创建时间") @@ -44,13 +44,92 @@ public class CaseReview implements Serializable { @Schema(title = "创建人") private String createUser; - @Schema(title = "评审规则:单人通过/全部通过", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{case_review.review_pass_rule.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 64, message = "{case_review.review_pass_rule.length_range}", groups = {Created.class, Updated.class}) + @Schema(title = "评审规则:单人通过/全部通过") private String reviewPassRule; @Schema(title = "描述") private String description; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + name("name", "name", "VARCHAR", true), + status("status", "status", "VARCHAR", true), + createTime("create_time", "createTime", "BIGINT", false), + updateTime("update_time", "updateTime", "BIGINT", false), + endTime("end_time", "endTime", "BIGINT", false), + projectId("project_id", "projectId", "VARCHAR", false), + tags("tags", "tags", "VARCHAR", false), + createUser("create_user", "createUser", "VARCHAR", false), + reviewPassRule("review_pass_rule", "reviewPassRule", "VARCHAR", false), + description("description", "description", "LONGVARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/functional/mapper/CaseReviewMapper.java b/backend/framework/domain/src/main/java/io/metersphere/functional/mapper/CaseReviewMapper.java index d37c226ee9..1628a14c19 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/functional/mapper/CaseReviewMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/functional/mapper/CaseReviewMapper.java @@ -33,4 +33,8 @@ public interface CaseReviewMapper { int updateByPrimaryKeyWithBLOBs(CaseReview record); int updateByPrimaryKey(CaseReview record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") CaseReview.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/functional/mapper/CaseReviewMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/functional/mapper/CaseReviewMapper.xml index bf68faa714..4f84f985be 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/functional/mapper/CaseReviewMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/functional/mapper/CaseReviewMapper.xml @@ -355,4 +355,64 @@ review_pass_rule = #{reviewPassRule,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into case_review + (id, `name`, `status`, create_time, update_time, end_time, project_id, tags, create_user, + review_pass_rule, description) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.status,jdbcType=VARCHAR}, + #{item.createTime,jdbcType=BIGINT}, #{item.updateTime,jdbcType=BIGINT}, #{item.endTime,jdbcType=BIGINT}, + #{item.projectId,jdbcType=VARCHAR}, #{item.tags,jdbcType=VARCHAR}, #{item.createUser,jdbcType=VARCHAR}, + #{item.reviewPassRule,jdbcType=VARCHAR}, #{item.description,jdbcType=LONGVARCHAR} + ) + + + + insert into case_review ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.status,jdbcType=VARCHAR} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.updateTime,jdbcType=BIGINT} + + + #{item.endTime,jdbcType=BIGINT} + + + #{item.projectId,jdbcType=VARCHAR} + + + #{item.tags,jdbcType=VARCHAR} + + + #{item.createUser,jdbcType=VARCHAR} + + + #{item.reviewPassRule,jdbcType=VARCHAR} + + + #{item.description,jdbcType=LONGVARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/ApiTemplate.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/ApiTemplate.java index e388b2adb4..49496ef6ef 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/ApiTemplate.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/ApiTemplate.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -21,8 +23,7 @@ public class ApiTemplate implements Serializable { @Schema(title = "描述") private String description; - @Schema(title = "是否是内置模板", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{api_template.internal.not_blank}", groups = {Created.class}) + @Schema(title = "是否是内置模板") private Boolean internal; @Schema(title = "创建时间") @@ -37,4 +38,81 @@ public class ApiTemplate implements Serializable { private String projectId; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + name("name", "name", "VARCHAR", true), + description("description", "description", "VARCHAR", false), + internal("internal", "internal", "BIT", false), + createTime("create_time", "createTime", "BIGINT", false), + createUser("create_user", "createUser", "VARCHAR", false), + projectId("project_id", "projectId", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/BugTemplate.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/BugTemplate.java index 8d8a9e8c16..e67306a5b8 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/BugTemplate.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/BugTemplate.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -21,8 +23,7 @@ public class BugTemplate implements Serializable { @Schema(title = "描述") private String description; - @Schema(title = "是否是内置模板", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{bug_template.internal.not_blank}", groups = {Created.class}) + @Schema(title = "是否是内置模板") private Boolean internal; @Schema(title = "创建时间") @@ -37,4 +38,81 @@ public class BugTemplate implements Serializable { private String projectId; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + name("name", "name", "VARCHAR", true), + description("description", "description", "VARCHAR", false), + internal("internal", "internal", "BIT", false), + createTime("create_time", "createTime", "BIGINT", false), + createUser("create_user", "createUser", "VARCHAR", false), + projectId("project_id", "projectId", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/BugTemplateExtend.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/BugTemplateExtend.java index cf6bfd05d6..033a55271d 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/BugTemplateExtend.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/BugTemplateExtend.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -20,4 +22,77 @@ public class BugTemplateExtend implements Serializable { private String content; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + title("title", "title", "VARCHAR", false), + content("content", "content", "LONGVARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomField.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomField.java index 5d44d7b494..5f9829ba19 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomField.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomField.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -49,12 +51,94 @@ public class CustomField implements Serializable { @Schema(title = "项目ID") private String projectId; - @Schema(title = "是否关联第三方", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{custom_field.third_part.not_blank}", groups = {Created.class}) + @Schema(title = "是否关联第三方") private Boolean thirdPart; @Schema(title = "自定义字段选项") private String options; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + name("name", "name", "VARCHAR", true), + scene("scene", "scene", "VARCHAR", false), + type("type", "type", "VARCHAR", true), + remark("remark", "remark", "VARCHAR", false), + system("system", "system", "BIT", true), + global("global", "global", "BIT", true), + createTime("create_time", "createTime", "BIGINT", false), + updateTime("update_time", "updateTime", "BIGINT", false), + createUser("create_user", "createUser", "VARCHAR", false), + projectId("project_id", "projectId", "VARCHAR", false), + thirdPart("third_part", "thirdPart", "BIT", false), + options("options", "options", "LONGVARCHAR", true); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFieldTemplate.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFieldTemplate.java index 578bf8d285..ade5a43027 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFieldTemplate.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFieldTemplate.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -44,4 +46,83 @@ public class CustomFieldTemplate implements Serializable { private byte[] defaultValue; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + fieldId("field_id", "fieldId", "VARCHAR", false), + templateId("template_id", "templateId", "VARCHAR", false), + scene("scene", "scene", "VARCHAR", false), + required("required", "required", "BIT", false), + pos("pos", "pos", "INTEGER", false), + customData("custom_data", "customData", "VARCHAR", false), + key("key", "key", "VARCHAR", true), + defaultValue("default_value", "defaultValue", "LONGVARBINARY", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFunction.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFunction.java index 95fe7f084e..94aec77667 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFunction.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFunction.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -25,4 +27,78 @@ public class CustomFunction implements Serializable { private String description; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + name("name", "name", "VARCHAR", true), + tags("tags", "tags", "VARCHAR", false), + description("description", "description", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFunctionBlob.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFunctionBlob.java index 0c69e24fbd..b941199f63 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFunctionBlob.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/CustomFunctionBlob.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -23,4 +25,78 @@ public class CustomFunctionBlob implements Serializable { private byte[] result; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + params("params", "params", "LONGVARBINARY", false), + script("script", "script", "LONGVARBINARY", false), + result("result", "result", "LONGVARBINARY", true); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FakeError.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FakeError.java index 2a63fafa5b..9aea125767 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FakeError.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FakeError.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -44,4 +46,83 @@ public class FakeError implements Serializable { private Boolean status; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + projectId("project_id", "projectId", "VARCHAR", false), + createTime("create_time", "createTime", "BIGINT", false), + updateTime("update_time", "updateTime", "BIGINT", false), + createUser("create_user", "createUser", "VARCHAR", false), + updateUser("update_user", "updateUser", "VARCHAR", false), + errorCode("error_code", "errorCode", "VARCHAR", false), + matchType("match_type", "matchType", "VARCHAR", false), + status("status", "status", "BIT", true); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FakeErrorBlob.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FakeErrorBlob.java index c4501e85d9..e6432757d7 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FakeErrorBlob.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FakeErrorBlob.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -20,4 +22,77 @@ public class FakeErrorBlob implements Serializable { private byte[] description; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + content("content", "content", "LONGVARBINARY", false), + description("description", "description", "LONGVARBINARY", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileMetadata.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileMetadata.java index bdfb6ac4b6..3bb6d7a2cf 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileMetadata.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileMetadata.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -36,9 +38,7 @@ public class FileMetadata implements Serializable { @Size(min = 1, max = 50, message = "{file_metadata.project_id.length_range}", groups = {Created.class, Updated.class}) private String projectId; - @Schema(title = "文件存储方式", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{file_metadata.storage.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 50, message = "{file_metadata.storage.length_range}", groups = {Created.class, Updated.class}) + @Schema(title = "文件存储方式") private String storage; @Schema(title = "创建人") @@ -65,8 +65,7 @@ public class FileMetadata implements Serializable { @Schema(title = "资源作用范围,主要兼容2.1版本前的历史数据,后续版本不再产生数据") private String resourceType; - @Schema(title = "是否是最新版", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{file_metadata.latest.not_blank}", groups = {Created.class}) + @Schema(title = "是否是最新版") private Boolean latest; @Schema(title = "同版本数据关联的ID", requiredMode = Schema.RequiredMode.REQUIRED) @@ -75,4 +74,92 @@ public class FileMetadata implements Serializable { private String refId; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + name("name", "name", "VARCHAR", true), + type("type", "type", "VARCHAR", true), + size("size", "size", "BIGINT", true), + createTime("create_time", "createTime", "BIGINT", false), + updateTime("update_time", "updateTime", "BIGINT", false), + projectId("project_id", "projectId", "VARCHAR", false), + storage("storage", "storage", "VARCHAR", true), + createUser("create_user", "createUser", "VARCHAR", false), + updateUser("update_user", "updateUser", "VARCHAR", false), + tags("tags", "tags", "VARCHAR", false), + description("description", "description", "VARCHAR", false), + moduleId("module_id", "moduleId", "VARCHAR", false), + loadJar("load_jar", "loadJar", "BIT", false), + path("path", "path", "VARCHAR", true), + resourceType("resource_type", "resourceType", "VARCHAR", false), + latest("latest", "latest", "BIT", false), + refId("ref_id", "refId", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileMetadataBlob.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileMetadataBlob.java index d98f64b44c..856d3bc4ae 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileMetadataBlob.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileMetadataBlob.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -17,4 +19,76 @@ public class FileMetadataBlob implements Serializable { private byte[] gitInfo; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + gitInfo("git_info", "gitInfo", "LONGVARBINARY", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModule.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModule.java index a577de80dc..7c624d2684 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModule.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModule.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -45,4 +47,84 @@ public class FileModule implements Serializable { private String moduleType; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + projectId("project_id", "projectId", "VARCHAR", false), + name("name", "name", "VARCHAR", true), + parentId("parent_id", "parentId", "VARCHAR", false), + level("level", "level", "INTEGER", true), + createTime("create_time", "createTime", "BIGINT", false), + updateTime("update_time", "updateTime", "BIGINT", false), + pos("pos", "pos", "DOUBLE", false), + createUser("create_user", "createUser", "VARCHAR", false), + moduleType("module_type", "moduleType", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModuleBlob.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModuleBlob.java index e1483fa72d..1306632321 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModuleBlob.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModuleBlob.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -26,4 +28,79 @@ public class FileModuleBlob implements Serializable { private byte[] repositoryDesc; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + repositoryPath("repository_path", "repositoryPath", "VARCHAR", false), + repositoryUserName("repository_user_name", "repositoryUserName", "VARCHAR", false), + repositoryToken("repository_token", "repositoryToken", "VARCHAR", false), + repositoryDesc("repository_desc", "repositoryDesc", "LONGVARBINARY", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FunctionalCaseTemplate.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FunctionalCaseTemplate.java index b09381aaf6..0473b9fc13 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FunctionalCaseTemplate.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FunctionalCaseTemplate.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -21,8 +23,7 @@ public class FunctionalCaseTemplate implements Serializable { @Schema(title = "描述") private String description; - @Schema(title = "是否是内置模板", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{functional_case_template.internal.not_blank}", groups = {Created.class}) + @Schema(title = "是否是内置模板") private Boolean internal; @Schema(title = "创建时间") @@ -37,4 +38,81 @@ public class FunctionalCaseTemplate implements Serializable { private String projectId; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + name("name", "name", "VARCHAR", true), + description("description", "description", "VARCHAR", false), + internal("internal", "internal", "BIT", false), + createTime("create_time", "createTime", "BIGINT", false), + createUser("create_user", "createUser", "VARCHAR", false), + projectId("project_id", "projectId", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FunctionalCaseTemplateExtend.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FunctionalCaseTemplateExtend.java index 85d6699f6b..e31c494ec4 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FunctionalCaseTemplateExtend.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FunctionalCaseTemplateExtend.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -16,9 +18,7 @@ public class FunctionalCaseTemplateExtend implements Serializable { @Schema(title = "用例名称模板") private String caseName; - @Schema(title = "编辑模式模板:步骤模式/文本模式", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{functional_case_template_extend.step_model.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 64, message = "{functional_case_template_extend.step_model.length_range}", groups = {Created.class, Updated.class}) + @Schema(title = "编辑模式模板:步骤模式/文本模式") private String stepModel; @Schema(title = "前置条件模板") @@ -37,4 +37,82 @@ public class FunctionalCaseTemplateExtend implements Serializable { private String steps; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + caseName("case_name", "caseName", "VARCHAR", false), + stepModel("step_model", "stepModel", "VARCHAR", false), + prerequisite("prerequisite", "prerequisite", "LONGVARCHAR", false), + stepDescription("step_description", "stepDescription", "LONGVARCHAR", false), + expectedResult("expected_result", "expectedResult", "LONGVARCHAR", false), + actualResult("actual_result", "actualResult", "LONGVARCHAR", false), + steps("steps", "steps", "LONGVARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/Project.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/Project.java index aefc0fb6e8..2d2d3cb277 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/Project.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/Project.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -44,8 +46,7 @@ public class Project implements Serializable { @Schema(title = "删除时间") private Long deleteTime; - @Schema(title = "是否删除", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{project.deleted.not_blank}", groups = {Created.class}) + @Schema(title = "是否删除") private Boolean deleted; @Schema(title = "删除人") @@ -55,4 +56,87 @@ public class Project implements Serializable { private Boolean enable; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + num("num", "num", "BIGINT", false), + organizationId("organization_id", "organizationId", "VARCHAR", false), + name("name", "name", "VARCHAR", true), + description("description", "description", "VARCHAR", false), + createTime("create_time", "createTime", "BIGINT", false), + updateTime("update_time", "updateTime", "BIGINT", false), + updateUser("update_user", "updateUser", "VARCHAR", false), + createUser("create_user", "createUser", "VARCHAR", false), + deleteTime("delete_time", "deleteTime", "BIGINT", false), + deleted("deleted", "deleted", "BIT", false), + deleteUser("delete_user", "deleteUser", "VARCHAR", false), + enable("enable", "enable", "BIT", true); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/ProjectApplication.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/ProjectApplication.java index 29bd2fa4b8..eddbcca4ea 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/ProjectApplication.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/ProjectApplication.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -22,4 +24,77 @@ public class ProjectApplication implements Serializable { private String typeValue; private static final long serialVersionUID = 1L; + + public enum Column { + projectId("project_id", "projectId", "VARCHAR", false), + type("type", "type", "VARCHAR", true), + typeValue("type_value", "typeValue", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/ProjectExtend.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/ProjectExtend.java index 41f1598eea..8d8e915221 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/ProjectExtend.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/ProjectExtend.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -31,9 +33,7 @@ public class ProjectExtend implements Serializable { @Schema(title = "azure 过滤需求的 parent workItem ID") private String azureFilterId; - @Schema(title = "项目使用哪个平台的模板", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{project_extend.platform.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 20, message = "{project_extend.platform.length_range}", groups = {Created.class, Updated.class}) + @Schema(title = "项目使用哪个平台的模板") private String platform; @Schema(title = "是否使用第三方平台缺陷模板") @@ -49,4 +49,86 @@ public class ProjectExtend implements Serializable { private String apiTemplateId; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + tapdId("tapd_id", "tapdId", "VARCHAR", false), + jiraKey("jira_key", "jiraKey", "VARCHAR", false), + zentaoId("zentao_id", "zentaoId", "VARCHAR", false), + azureDevopsId("azure_devops_id", "azureDevopsId", "VARCHAR", false), + caseTemplateId("case_template_id", "caseTemplateId", "VARCHAR", false), + azureFilterId("azure_filter_id", "azureFilterId", "VARCHAR", false), + platform("platform", "platform", "VARCHAR", false), + thirdPartTemplate("third_part_template", "thirdPartTemplate", "BIT", false), + versionEnable("version_enable", "versionEnable", "BIT", false), + issueConfig("issue_config", "issueConfig", "VARCHAR", false), + apiTemplateId("api_template_id", "apiTemplateId", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/ProjectVersion.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/ProjectVersion.java index e50432ca2c..b748255d88 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/ProjectVersion.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/ProjectVersion.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -49,4 +51,85 @@ public class ProjectVersion implements Serializable { private String createUser; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + projectId("project_id", "projectId", "VARCHAR", false), + name("name", "name", "VARCHAR", true), + description("description", "description", "VARCHAR", false), + status("status", "status", "VARCHAR", true), + latest("latest", "latest", "BIT", false), + publishTime("publish_time", "publishTime", "BIGINT", false), + startTime("start_time", "startTime", "BIGINT", false), + endTime("end_time", "endTime", "BIGINT", false), + createTime("create_time", "createTime", "BIGINT", false), + createUser("create_user", "createUser", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ApiTemplateMapper.java b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ApiTemplateMapper.java index ca976fb07a..9ce9561464 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ApiTemplateMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ApiTemplateMapper.java @@ -27,4 +27,8 @@ public interface ApiTemplateMapper { int updateByPrimaryKeySelective(ApiTemplate record); int updateByPrimaryKey(ApiTemplate record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") ApiTemplate.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ApiTemplateMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ApiTemplateMapper.xml index 72c4f78cad..b54dc0edd4 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ApiTemplateMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ApiTemplateMapper.xml @@ -240,4 +240,49 @@ project_id = #{projectId,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into api_template + (id, `name`, description, internal, create_time, create_user, project_id) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.description,jdbcType=VARCHAR}, + #{item.internal,jdbcType=BIT}, #{item.createTime,jdbcType=BIGINT}, #{item.createUser,jdbcType=VARCHAR}, + #{item.projectId,jdbcType=VARCHAR}) + + + + insert into api_template ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.description,jdbcType=VARCHAR} + + + #{item.internal,jdbcType=BIT} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.createUser,jdbcType=VARCHAR} + + + #{item.projectId,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/BugTemplateExtendMapper.java b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/BugTemplateExtendMapper.java index 828a174eac..b9a757687d 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/BugTemplateExtendMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/BugTemplateExtendMapper.java @@ -33,4 +33,8 @@ public interface BugTemplateExtendMapper { int updateByPrimaryKeyWithBLOBs(BugTemplateExtend record); int updateByPrimaryKey(BugTemplateExtend record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") BugTemplateExtend.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/BugTemplateExtendMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/BugTemplateExtendMapper.xml index 224b6d6540..dcc8a1d3e3 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/BugTemplateExtendMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/BugTemplateExtendMapper.xml @@ -214,4 +214,36 @@ set title = #{title,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into bug_template_extend + (id, title, content) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.title,jdbcType=VARCHAR}, #{item.content,jdbcType=LONGVARCHAR} + ) + + + + insert into bug_template_extend ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.title,jdbcType=VARCHAR} + + + #{item.content,jdbcType=LONGVARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/BugTemplateMapper.java b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/BugTemplateMapper.java index 9e8bf40352..3143c29cbc 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/BugTemplateMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/BugTemplateMapper.java @@ -27,4 +27,8 @@ public interface BugTemplateMapper { int updateByPrimaryKeySelective(BugTemplate record); int updateByPrimaryKey(BugTemplate record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") BugTemplate.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/BugTemplateMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/BugTemplateMapper.xml index a1e616f10d..badeba5941 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/BugTemplateMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/BugTemplateMapper.xml @@ -240,4 +240,49 @@ project_id = #{projectId,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into bug_template + (id, `name`, description, internal, create_time, create_user, project_id) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.description,jdbcType=VARCHAR}, + #{item.internal,jdbcType=BIT}, #{item.createTime,jdbcType=BIGINT}, #{item.createUser,jdbcType=VARCHAR}, + #{item.projectId,jdbcType=VARCHAR}) + + + + insert into bug_template ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.description,jdbcType=VARCHAR} + + + #{item.internal,jdbcType=BIT} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.createUser,jdbcType=VARCHAR} + + + #{item.projectId,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFieldMapper.java b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFieldMapper.java index 0b51b5bb30..47bab49e81 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFieldMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFieldMapper.java @@ -33,4 +33,8 @@ public interface CustomFieldMapper { int updateByPrimaryKeyWithBLOBs(CustomField record); int updateByPrimaryKey(CustomField record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") CustomField.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFieldMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFieldMapper.xml index f0f52c6c49..b0c2828c77 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFieldMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFieldMapper.xml @@ -391,4 +391,70 @@ third_part = #{thirdPart,jdbcType=BIT} where id = #{id,jdbcType=VARCHAR} + + insert into custom_field + (id, `name`, scene, `type`, remark, `system`, `global`, create_time, update_time, + create_user, project_id, third_part, `options`) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.scene,jdbcType=VARCHAR}, + #{item.type,jdbcType=VARCHAR}, #{item.remark,jdbcType=VARCHAR}, #{item.system,jdbcType=BIT}, + #{item.global,jdbcType=BIT}, #{item.createTime,jdbcType=BIGINT}, #{item.updateTime,jdbcType=BIGINT}, + #{item.createUser,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}, #{item.thirdPart,jdbcType=BIT}, + #{item.options,jdbcType=LONGVARCHAR}) + + + + insert into custom_field ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.scene,jdbcType=VARCHAR} + + + #{item.type,jdbcType=VARCHAR} + + + #{item.remark,jdbcType=VARCHAR} + + + #{item.system,jdbcType=BIT} + + + #{item.global,jdbcType=BIT} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.updateTime,jdbcType=BIGINT} + + + #{item.createUser,jdbcType=VARCHAR} + + + #{item.projectId,jdbcType=VARCHAR} + + + #{item.thirdPart,jdbcType=BIT} + + + #{item.options,jdbcType=LONGVARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFieldTemplateMapper.java b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFieldTemplateMapper.java index 0aa6c99ce1..39fbbf06ae 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFieldTemplateMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFieldTemplateMapper.java @@ -33,4 +33,8 @@ public interface CustomFieldTemplateMapper { int updateByPrimaryKeyWithBLOBs(CustomFieldTemplate record); int updateByPrimaryKey(CustomFieldTemplate record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") CustomFieldTemplate.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFieldTemplateMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFieldTemplateMapper.xml index a1b8eea5a8..02b4e399fe 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFieldTemplateMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFieldTemplateMapper.xml @@ -318,4 +318,57 @@ `key` = #{key,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into custom_field_template + (id, field_id, template_id, scene, required, pos, custom_data, `key`, default_value + ) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.fieldId,jdbcType=VARCHAR}, #{item.templateId,jdbcType=VARCHAR}, + #{item.scene,jdbcType=VARCHAR}, #{item.required,jdbcType=BIT}, #{item.pos,jdbcType=INTEGER}, + #{item.customData,jdbcType=VARCHAR}, #{item.key,jdbcType=VARCHAR}, #{item.defaultValue,jdbcType=LONGVARBINARY} + ) + + + + insert into custom_field_template ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.fieldId,jdbcType=VARCHAR} + + + #{item.templateId,jdbcType=VARCHAR} + + + #{item.scene,jdbcType=VARCHAR} + + + #{item.required,jdbcType=BIT} + + + #{item.pos,jdbcType=INTEGER} + + + #{item.customData,jdbcType=VARCHAR} + + + #{item.key,jdbcType=VARCHAR} + + + #{item.defaultValue,jdbcType=LONGVARBINARY} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFunctionBlobMapper.java b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFunctionBlobMapper.java index f276b30937..58b1810cfb 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFunctionBlobMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFunctionBlobMapper.java @@ -31,4 +31,8 @@ public interface CustomFunctionBlobMapper { int updateByPrimaryKeySelective(CustomFunctionBlob record); int updateByPrimaryKeyWithBLOBs(CustomFunctionBlob record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") CustomFunctionBlob.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFunctionBlobMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFunctionBlobMapper.xml index 9b95a65a01..44224603d2 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFunctionBlobMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFunctionBlobMapper.xml @@ -223,4 +223,39 @@ `result` = #{result,jdbcType=LONGVARBINARY} where id = #{id,jdbcType=VARCHAR} + + insert into custom_function_blob + (id, params, script, `result`) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.params,jdbcType=LONGVARBINARY}, #{item.script,jdbcType=LONGVARBINARY}, + #{item.result,jdbcType=LONGVARBINARY}) + + + + insert into custom_function_blob ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.params,jdbcType=LONGVARBINARY} + + + #{item.script,jdbcType=LONGVARBINARY} + + + #{item.result,jdbcType=LONGVARBINARY} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFunctionMapper.java b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFunctionMapper.java index 502d4ffa3d..26b6b88db1 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFunctionMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFunctionMapper.java @@ -27,4 +27,8 @@ public interface CustomFunctionMapper { int updateByPrimaryKeySelective(CustomFunction record); int updateByPrimaryKey(CustomFunction record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") CustomFunction.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFunctionMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFunctionMapper.xml index 448a585435..578bc76760 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFunctionMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/CustomFunctionMapper.xml @@ -193,4 +193,39 @@ description = #{description,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into custom_function + (id, `name`, tags, description) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.tags,jdbcType=VARCHAR}, + #{item.description,jdbcType=VARCHAR}) + + + + insert into custom_function ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.tags,jdbcType=VARCHAR} + + + #{item.description,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FakeErrorBlobMapper.java b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FakeErrorBlobMapper.java index e8ad5aa8d2..7df42ba6b4 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FakeErrorBlobMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FakeErrorBlobMapper.java @@ -31,4 +31,8 @@ public interface FakeErrorBlobMapper { int updateByPrimaryKeySelective(FakeErrorBlob record); int updateByPrimaryKeyWithBLOBs(FakeErrorBlob record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") FakeErrorBlob.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FakeErrorBlobMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FakeErrorBlobMapper.xml index b1974915f5..fae0f1d902 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FakeErrorBlobMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FakeErrorBlobMapper.xml @@ -208,4 +208,36 @@ description = #{description,jdbcType=LONGVARBINARY} where id = #{id,jdbcType=VARCHAR} + + insert into fake_error_blob + (id, content, description) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.content,jdbcType=LONGVARBINARY}, #{item.description,jdbcType=LONGVARBINARY} + ) + + + + insert into fake_error_blob ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.content,jdbcType=LONGVARBINARY} + + + #{item.description,jdbcType=LONGVARBINARY} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FakeErrorMapper.java b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FakeErrorMapper.java index b5c429be4d..cf2663c3ca 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FakeErrorMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FakeErrorMapper.java @@ -27,4 +27,8 @@ public interface FakeErrorMapper { int updateByPrimaryKeySelective(FakeError record); int updateByPrimaryKey(FakeError record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") FakeError.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FakeErrorMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FakeErrorMapper.xml index c86b5c6c68..ded6d6feb8 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FakeErrorMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FakeErrorMapper.xml @@ -273,4 +273,57 @@ `status` = #{status,jdbcType=BIT} where id = #{id,jdbcType=VARCHAR} + + insert into fake_error + (id, project_id, create_time, update_time, create_user, update_user, error_code, + match_type, `status`) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, + #{item.updateTime,jdbcType=BIGINT}, #{item.createUser,jdbcType=VARCHAR}, #{item.updateUser,jdbcType=VARCHAR}, + #{item.errorCode,jdbcType=VARCHAR}, #{item.matchType,jdbcType=VARCHAR}, #{item.status,jdbcType=BIT} + ) + + + + insert into fake_error ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.projectId,jdbcType=VARCHAR} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.updateTime,jdbcType=BIGINT} + + + #{item.createUser,jdbcType=VARCHAR} + + + #{item.updateUser,jdbcType=VARCHAR} + + + #{item.errorCode,jdbcType=VARCHAR} + + + #{item.matchType,jdbcType=VARCHAR} + + + #{item.status,jdbcType=BIT} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileMetadataBlobMapper.java b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileMetadataBlobMapper.java index d8506e20d9..b6c6e5cf5b 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileMetadataBlobMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileMetadataBlobMapper.java @@ -31,4 +31,8 @@ public interface FileMetadataBlobMapper { int updateByPrimaryKeySelective(FileMetadataBlob record); int updateByPrimaryKeyWithBLOBs(FileMetadataBlob record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") FileMetadataBlob.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileMetadataBlobMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileMetadataBlobMapper.xml index db3f2277b7..a3844c923c 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileMetadataBlobMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileMetadataBlobMapper.xml @@ -191,4 +191,32 @@ set git_info = #{gitInfo,jdbcType=LONGVARBINARY} where id = #{id,jdbcType=VARCHAR} + + insert into file_metadata_blob + (id, git_info) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.gitInfo,jdbcType=LONGVARBINARY}) + + + + insert into file_metadata_blob ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.gitInfo,jdbcType=LONGVARBINARY} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileMetadataMapper.java b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileMetadataMapper.java index 85f5f56982..f687095b31 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileMetadataMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileMetadataMapper.java @@ -27,4 +27,8 @@ public interface FileMetadataMapper { int updateByPrimaryKeySelective(FileMetadata record); int updateByPrimaryKey(FileMetadata record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") FileMetadata.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileMetadataMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileMetadataMapper.xml index 5eab066ad4..84858df919 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileMetadataMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileMetadataMapper.xml @@ -415,4 +415,88 @@ ref_id = #{refId,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into file_metadata + (id, `name`, `type`, `size`, create_time, update_time, project_id, `storage`, create_user, + update_user, tags, description, module_id, load_jar, `path`, resource_type, latest, + ref_id) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR}, + #{item.size,jdbcType=BIGINT}, #{item.createTime,jdbcType=BIGINT}, #{item.updateTime,jdbcType=BIGINT}, + #{item.projectId,jdbcType=VARCHAR}, #{item.storage,jdbcType=VARCHAR}, #{item.createUser,jdbcType=VARCHAR}, + #{item.updateUser,jdbcType=VARCHAR}, #{item.tags,jdbcType=VARCHAR}, #{item.description,jdbcType=VARCHAR}, + #{item.moduleId,jdbcType=VARCHAR}, #{item.loadJar,jdbcType=BIT}, #{item.path,jdbcType=VARCHAR}, + #{item.resourceType,jdbcType=VARCHAR}, #{item.latest,jdbcType=BIT}, #{item.refId,jdbcType=VARCHAR} + ) + + + + insert into file_metadata ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.type,jdbcType=VARCHAR} + + + #{item.size,jdbcType=BIGINT} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.updateTime,jdbcType=BIGINT} + + + #{item.projectId,jdbcType=VARCHAR} + + + #{item.storage,jdbcType=VARCHAR} + + + #{item.createUser,jdbcType=VARCHAR} + + + #{item.updateUser,jdbcType=VARCHAR} + + + #{item.tags,jdbcType=VARCHAR} + + + #{item.description,jdbcType=VARCHAR} + + + #{item.moduleId,jdbcType=VARCHAR} + + + #{item.loadJar,jdbcType=BIT} + + + #{item.path,jdbcType=VARCHAR} + + + #{item.resourceType,jdbcType=VARCHAR} + + + #{item.latest,jdbcType=BIT} + + + #{item.refId,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileModuleBlobMapper.java b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileModuleBlobMapper.java index 95cb3fceb1..adec561190 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileModuleBlobMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileModuleBlobMapper.java @@ -33,4 +33,8 @@ public interface FileModuleBlobMapper { int updateByPrimaryKeyWithBLOBs(FileModuleBlob record); int updateByPrimaryKey(FileModuleBlob record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") FileModuleBlob.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileModuleBlobMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileModuleBlobMapper.xml index 3f1df20250..19f52cfac1 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileModuleBlobMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileModuleBlobMapper.xml @@ -248,4 +248,43 @@ repository_token = #{repositoryToken,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into file_module_blob + (id, repository_path, repository_user_name, repository_token, repository_desc) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.repositoryPath,jdbcType=VARCHAR}, #{item.repositoryUserName,jdbcType=VARCHAR}, + #{item.repositoryToken,jdbcType=VARCHAR}, #{item.repositoryDesc,jdbcType=LONGVARBINARY} + ) + + + + insert into file_module_blob ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.repositoryPath,jdbcType=VARCHAR} + + + #{item.repositoryUserName,jdbcType=VARCHAR} + + + #{item.repositoryToken,jdbcType=VARCHAR} + + + #{item.repositoryDesc,jdbcType=LONGVARBINARY} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileModuleMapper.java b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileModuleMapper.java index 1368080cd4..7dcd05661e 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileModuleMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileModuleMapper.java @@ -27,4 +27,8 @@ public interface FileModuleMapper { int updateByPrimaryKeySelective(FileModule record); int updateByPrimaryKey(FileModule record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") FileModule.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileModuleMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileModuleMapper.xml index afc7c81434..939aa5dcd8 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileModuleMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileModuleMapper.xml @@ -288,4 +288,60 @@ module_type = #{moduleType,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into file_module + (id, project_id, `name`, parent_id, `level`, create_time, update_time, pos, create_user, + module_type) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, + #{item.parentId,jdbcType=VARCHAR}, #{item.level,jdbcType=INTEGER}, #{item.createTime,jdbcType=BIGINT}, + #{item.updateTime,jdbcType=BIGINT}, #{item.pos,jdbcType=DOUBLE}, #{item.createUser,jdbcType=VARCHAR}, + #{item.moduleType,jdbcType=VARCHAR}) + + + + insert into file_module ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.projectId,jdbcType=VARCHAR} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.parentId,jdbcType=VARCHAR} + + + #{item.level,jdbcType=INTEGER} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.updateTime,jdbcType=BIGINT} + + + #{item.pos,jdbcType=DOUBLE} + + + #{item.createUser,jdbcType=VARCHAR} + + + #{item.moduleType,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FunctionalCaseTemplateExtendMapper.java b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FunctionalCaseTemplateExtendMapper.java index 17aa18f41d..79c186259a 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FunctionalCaseTemplateExtendMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FunctionalCaseTemplateExtendMapper.java @@ -33,4 +33,8 @@ public interface FunctionalCaseTemplateExtendMapper { int updateByPrimaryKeyWithBLOBs(FunctionalCaseTemplateExtend record); int updateByPrimaryKey(FunctionalCaseTemplateExtend record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") FunctionalCaseTemplateExtend.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FunctionalCaseTemplateExtendMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FunctionalCaseTemplateExtendMapper.xml index f0dd3a2c49..a84a9065fd 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FunctionalCaseTemplateExtendMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FunctionalCaseTemplateExtendMapper.xml @@ -295,4 +295,54 @@ step_model = #{stepModel,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into functional_case_template_extend + (id, case_name, step_model, prerequisite, step_description, expected_result, actual_result, + steps) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.caseName,jdbcType=VARCHAR}, #{item.stepModel,jdbcType=VARCHAR}, + #{item.prerequisite,jdbcType=LONGVARCHAR}, #{item.stepDescription,jdbcType=LONGVARCHAR}, + #{item.expectedResult,jdbcType=LONGVARCHAR}, #{item.actualResult,jdbcType=LONGVARCHAR}, + #{item.steps,jdbcType=LONGVARCHAR}) + + + + insert into functional_case_template_extend ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.caseName,jdbcType=VARCHAR} + + + #{item.stepModel,jdbcType=VARCHAR} + + + #{item.prerequisite,jdbcType=LONGVARCHAR} + + + #{item.stepDescription,jdbcType=LONGVARCHAR} + + + #{item.expectedResult,jdbcType=LONGVARCHAR} + + + #{item.actualResult,jdbcType=LONGVARCHAR} + + + #{item.steps,jdbcType=LONGVARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FunctionalCaseTemplateMapper.java b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FunctionalCaseTemplateMapper.java index b7fa66eeb7..7d57ec1b38 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FunctionalCaseTemplateMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FunctionalCaseTemplateMapper.java @@ -27,4 +27,8 @@ public interface FunctionalCaseTemplateMapper { int updateByPrimaryKeySelective(FunctionalCaseTemplate record); int updateByPrimaryKey(FunctionalCaseTemplate record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") FunctionalCaseTemplate.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FunctionalCaseTemplateMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FunctionalCaseTemplateMapper.xml index 34bf6691e4..28091c4b8a 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FunctionalCaseTemplateMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FunctionalCaseTemplateMapper.xml @@ -240,4 +240,49 @@ project_id = #{projectId,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into functional_case_template + (id, `name`, description, internal, create_time, create_user, project_id) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.description,jdbcType=VARCHAR}, + #{item.internal,jdbcType=BIT}, #{item.createTime,jdbcType=BIGINT}, #{item.createUser,jdbcType=VARCHAR}, + #{item.projectId,jdbcType=VARCHAR}) + + + + insert into functional_case_template ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.description,jdbcType=VARCHAR} + + + #{item.internal,jdbcType=BIT} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.createUser,jdbcType=VARCHAR} + + + #{item.projectId,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectApplicationMapper.java b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectApplicationMapper.java index 2b10e51b77..a7e97b96d9 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectApplicationMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectApplicationMapper.java @@ -27,4 +27,8 @@ public interface ProjectApplicationMapper { int updateByPrimaryKeySelective(ProjectApplication record); int updateByPrimaryKey(ProjectApplication record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") ProjectApplication.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectApplicationMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectApplicationMapper.xml index d150498c54..ccfda9f9b6 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectApplicationMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectApplicationMapper.xml @@ -178,4 +178,36 @@ where project_id = #{projectId,jdbcType=VARCHAR} and `type` = #{type,jdbcType=VARCHAR} + + insert into project_application + (project_id, `type`, type_value) + values + + (#{item.projectId,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR}, #{item.typeValue,jdbcType=VARCHAR} + ) + + + + insert into project_application ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.projectId,jdbcType=VARCHAR} + + + #{item.type,jdbcType=VARCHAR} + + + #{item.typeValue,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectExtendMapper.java b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectExtendMapper.java index f58d81c528..1f0a3f5101 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectExtendMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectExtendMapper.java @@ -27,4 +27,8 @@ public interface ProjectExtendMapper { int updateByPrimaryKeySelective(ProjectExtend record); int updateByPrimaryKey(ProjectExtend record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") ProjectExtend.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectExtendMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectExtendMapper.xml index 752e0405f3..e5f4963940 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectExtendMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectExtendMapper.xml @@ -320,4 +320,67 @@ api_template_id = #{apiTemplateId,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into project_extend + (id, tapd_id, jira_key, zentao_id, azure_devops_id, case_template_id, azure_filter_id, + platform, third_part_template, version_enable, issue_config, api_template_id) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.tapdId,jdbcType=VARCHAR}, #{item.jiraKey,jdbcType=VARCHAR}, + #{item.zentaoId,jdbcType=VARCHAR}, #{item.azureDevopsId,jdbcType=VARCHAR}, #{item.caseTemplateId,jdbcType=VARCHAR}, + #{item.azureFilterId,jdbcType=VARCHAR}, #{item.platform,jdbcType=VARCHAR}, #{item.thirdPartTemplate,jdbcType=BIT}, + #{item.versionEnable,jdbcType=BIT}, #{item.issueConfig,jdbcType=VARCHAR}, #{item.apiTemplateId,jdbcType=VARCHAR} + ) + + + + insert into project_extend ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.tapdId,jdbcType=VARCHAR} + + + #{item.jiraKey,jdbcType=VARCHAR} + + + #{item.zentaoId,jdbcType=VARCHAR} + + + #{item.azureDevopsId,jdbcType=VARCHAR} + + + #{item.caseTemplateId,jdbcType=VARCHAR} + + + #{item.azureFilterId,jdbcType=VARCHAR} + + + #{item.platform,jdbcType=VARCHAR} + + + #{item.thirdPartTemplate,jdbcType=BIT} + + + #{item.versionEnable,jdbcType=BIT} + + + #{item.issueConfig,jdbcType=VARCHAR} + + + #{item.apiTemplateId,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectMapper.java b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectMapper.java index c067464b49..553e2ed266 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectMapper.java @@ -27,4 +27,8 @@ public interface ProjectMapper { int updateByPrimaryKeySelective(Project record); int updateByPrimaryKey(Project record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") Project.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectMapper.xml index d0f276249f..fd9feeb537 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectMapper.xml @@ -335,4 +335,70 @@ `enable` = #{enable,jdbcType=BIT} where id = #{id,jdbcType=VARCHAR} + + insert into project + (id, num, organization_id, `name`, description, create_time, update_time, update_user, + create_user, delete_time, deleted, delete_user, `enable`) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.num,jdbcType=BIGINT}, #{item.organizationId,jdbcType=VARCHAR}, + #{item.name,jdbcType=VARCHAR}, #{item.description,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, + #{item.updateTime,jdbcType=BIGINT}, #{item.updateUser,jdbcType=VARCHAR}, #{item.createUser,jdbcType=VARCHAR}, + #{item.deleteTime,jdbcType=BIGINT}, #{item.deleted,jdbcType=BIT}, #{item.deleteUser,jdbcType=VARCHAR}, + #{item.enable,jdbcType=BIT}) + + + + insert into project ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.num,jdbcType=BIGINT} + + + #{item.organizationId,jdbcType=VARCHAR} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.description,jdbcType=VARCHAR} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.updateTime,jdbcType=BIGINT} + + + #{item.updateUser,jdbcType=VARCHAR} + + + #{item.createUser,jdbcType=VARCHAR} + + + #{item.deleteTime,jdbcType=BIGINT} + + + #{item.deleted,jdbcType=BIT} + + + #{item.deleteUser,jdbcType=VARCHAR} + + + #{item.enable,jdbcType=BIT} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectVersionMapper.java b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectVersionMapper.java index f0f25d2b3d..db15971578 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectVersionMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectVersionMapper.java @@ -27,4 +27,8 @@ public interface ProjectVersionMapper { int updateByPrimaryKeySelective(ProjectVersion record); int updateByPrimaryKey(ProjectVersion record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") ProjectVersion.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectVersionMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectVersionMapper.xml index 20dc92aa8f..e286b9d746 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectVersionMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/ProjectVersionMapper.xml @@ -303,4 +303,63 @@ create_user = #{createUser,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into project_version + (id, project_id, `name`, description, `status`, latest, publish_time, start_time, + end_time, create_time, create_user) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, + #{item.description,jdbcType=VARCHAR}, #{item.status,jdbcType=VARCHAR}, #{item.latest,jdbcType=BIT}, + #{item.publishTime,jdbcType=BIGINT}, #{item.startTime,jdbcType=BIGINT}, #{item.endTime,jdbcType=BIGINT}, + #{item.createTime,jdbcType=BIGINT}, #{item.createUser,jdbcType=VARCHAR}) + + + + insert into project_version ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.projectId,jdbcType=VARCHAR} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.description,jdbcType=VARCHAR} + + + #{item.status,jdbcType=VARCHAR} + + + #{item.latest,jdbcType=BIT} + + + #{item.publishTime,jdbcType=BIGINT} + + + #{item.startTime,jdbcType=BIGINT} + + + #{item.endTime,jdbcType=BIGINT} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.createUser,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/AuthSource.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/AuthSource.java index e7a7ee188c..5caec1dad8 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/AuthSource.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/AuthSource.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -13,8 +15,7 @@ public class AuthSource implements Serializable { @Size(min = 1, max = 50, message = "{auth_source.id.length_range}", groups = {Created.class, Updated.class}) private String id; - @Schema(title = "是否启用", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{auth_source.enable.not_blank}", groups = {Created.class}) + @Schema(title = "是否启用") private Boolean enable; @Schema(title = "创建时间") @@ -37,4 +38,82 @@ public class AuthSource implements Serializable { private byte[] configuration; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + enable("enable", "enable", "BIT", true), + createTime("create_time", "createTime", "BIGINT", false), + updateTime("update_time", "updateTime", "BIGINT", false), + description("description", "description", "VARCHAR", false), + name("name", "name", "VARCHAR", true), + type("type", "type", "VARCHAR", true), + configuration("configuration", "configuration", "LONGVARBINARY", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/License.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/License.java index 82b2e11c6f..bd35280f03 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/License.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/License.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -23,4 +25,78 @@ public class License implements Serializable { private String licenseCode; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + createTime("create_time", "createTime", "BIGINT", false), + updateTime("update_time", "updateTime", "BIGINT", false), + licenseCode("license_code", "licenseCode", "LONGVARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/MessageTask.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/MessageTask.java index 256129095e..409b9df99c 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/MessageTask.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/MessageTask.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -36,9 +38,7 @@ public class MessageTask implements Serializable { @Schema(title = "webhook地址") private String webhook; - @Schema(title = "具体测试的ID", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{message_task.test_id.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 50, message = "{message_task.test_id.length_range}", groups = {Created.class, Updated.class}) + @Schema(title = "具体测试的ID") private String testId; @Schema(title = "创建时间") @@ -50,4 +50,83 @@ public class MessageTask implements Serializable { private String projectId; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + type("type", "type", "VARCHAR", true), + event("event", "event", "VARCHAR", false), + receiver("receiver", "receiver", "VARCHAR", false), + taskType("task_type", "taskType", "VARCHAR", false), + webhook("webhook", "webhook", "VARCHAR", false), + testId("test_id", "testId", "VARCHAR", false), + createTime("create_time", "createTime", "BIGINT", false), + projectId("project_id", "projectId", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/MessageTaskBlob.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/MessageTaskBlob.java index 261d5fe084..14266d495d 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/MessageTaskBlob.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/MessageTaskBlob.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -17,4 +19,76 @@ public class MessageTaskBlob implements Serializable { private String template; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + template("template", "template", "LONGVARCHAR", true); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/Notification.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/Notification.java index a251c9064a..41c1f8e3ea 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/Notification.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/Notification.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -61,4 +63,85 @@ public class Notification implements Serializable { private String resourceName; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "BIGINT", false), + type("type", "type", "VARCHAR", true), + receiver("receiver", "receiver", "VARCHAR", false), + title("title", "title", "VARCHAR", false), + status("status", "status", "VARCHAR", true), + createTime("create_time", "createTime", "BIGINT", false), + operator("operator", "operator", "VARCHAR", true), + operation("operation", "operation", "VARCHAR", true), + resourceId("resource_id", "resourceId", "VARCHAR", false), + resourceType("resource_type", "resourceType", "VARCHAR", false), + resourceName("resource_name", "resourceName", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/NoviceStatistics.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/NoviceStatistics.java index 91b03f6672..a2b782bc09 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/NoviceStatistics.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/NoviceStatistics.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -16,12 +18,10 @@ public class NoviceStatistics implements Serializable { @Schema(title = "用户id") private String userId; - @Schema(title = "新手引导完成的步骤", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{novice_statistics.guide_step.not_blank}", groups = {Created.class}) + @Schema(title = "新手引导完成的步骤") private Boolean guideStep; - @Schema(title = "新手引导的次数", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{novice_statistics.guide_num.not_blank}", groups = {Created.class}) + @Schema(title = "新手引导的次数") private Integer guideNum; @Schema(title = "") @@ -34,4 +34,81 @@ public class NoviceStatistics implements Serializable { private byte[] dataOption; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + userId("user_id", "userId", "VARCHAR", false), + guideStep("guide_step", "guideStep", "BIT", false), + guideNum("guide_num", "guideNum", "INTEGER", false), + createTime("create_time", "createTime", "BIGINT", false), + updateTime("update_time", "updateTime", "BIGINT", false), + dataOption("data_option", "dataOption", "LONGVARBINARY", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/Organization.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/Organization.java index 393f3e1855..f28418a17d 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/Organization.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/Organization.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -49,4 +51,86 @@ public class Organization implements Serializable { private Boolean enable; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + num("num", "num", "BIGINT", false), + name("name", "name", "VARCHAR", true), + description("description", "description", "VARCHAR", false), + createTime("create_time", "createTime", "BIGINT", false), + updateTime("update_time", "updateTime", "BIGINT", false), + createUser("create_user", "createUser", "VARCHAR", false), + updateUser("update_user", "updateUser", "VARCHAR", false), + deleted("deleted", "deleted", "BIT", false), + deleteUser("delete_user", "deleteUser", "VARCHAR", false), + deleteTime("delete_time", "deleteTime", "BIGINT", false), + enable("enable", "enable", "BIT", true); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/Plugin.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/Plugin.java index ad5f90b2d8..3a5d9f81e8 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/Plugin.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/Plugin.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -55,4 +57,86 @@ public class Plugin implements Serializable { private String scenario; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + name("name", "name", "VARCHAR", true), + pluginId("plugin_id", "pluginId", "VARCHAR", false), + fileName("file_name", "fileName", "VARCHAR", false), + createTime("create_time", "createTime", "BIGINT", false), + updateTime("update_time", "updateTime", "BIGINT", false), + createUser("create_user", "createUser", "VARCHAR", false), + enable("enable", "enable", "BIT", true), + global("global", "global", "BIT", true), + xpack("xpack", "xpack", "BIT", false), + description("description", "description", "VARCHAR", false), + scenario("scenario", "scenario", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/PluginFrontScript.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/PluginFrontScript.java index 2c5bff357d..6101cd698d 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/PluginFrontScript.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/PluginFrontScript.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -22,4 +24,77 @@ public class PluginFrontScript implements Serializable { private String script; private static final long serialVersionUID = 1L; + + public enum Column { + pluginId("plugin_id", "pluginId", "VARCHAR", false), + scriptId("script_id", "scriptId", "VARCHAR", false), + script("script", "script", "LONGVARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/PluginOrganization.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/PluginOrganization.java index f6547d91ea..9a2eac776a 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/PluginOrganization.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/PluginOrganization.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -19,4 +21,76 @@ public class PluginOrganization implements Serializable { private String organizationId; private static final long serialVersionUID = 1L; + + public enum Column { + pluginId("plugin_id", "pluginId", "VARCHAR", false), + organizationId("organization_id", "organizationId", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/Schedule.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/Schedule.java index 4708cb81d0..fafa40b81c 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/Schedule.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/Schedule.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -56,4 +58,87 @@ public class Schedule implements Serializable { private String config; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + key("key", "key", "VARCHAR", true), + type("type", "type", "VARCHAR", true), + value("value", "value", "VARCHAR", true), + job("job", "job", "VARCHAR", false), + enable("enable", "enable", "BIT", true), + resourceId("resource_id", "resourceId", "VARCHAR", false), + createUser("create_user", "createUser", "VARCHAR", false), + createTime("create_time", "createTime", "BIGINT", false), + updateTime("update_time", "updateTime", "BIGINT", false), + projectId("project_id", "projectId", "VARCHAR", false), + name("name", "name", "VARCHAR", true), + config("config", "config", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/ServiceIntegration.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/ServiceIntegration.java index 3b23f6ad49..3ff1a8eece 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/ServiceIntegration.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/ServiceIntegration.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -26,4 +28,78 @@ public class ServiceIntegration implements Serializable { private byte[] configuration; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + platform("platform", "platform", "VARCHAR", false), + organizationId("organization_id", "organizationId", "VARCHAR", false), + configuration("configuration", "configuration", "LONGVARBINARY", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/SystemParameter.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/SystemParameter.java index b30bbe3e0c..65c76ac131 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/SystemParameter.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/SystemParameter.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -16,10 +18,81 @@ public class SystemParameter implements Serializable { @Schema(title = "参数值") private String paramValue; - @Schema(title = "类型", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{system_parameter.type.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 100, message = "{system_parameter.type.length_range}", groups = {Created.class, Updated.class}) + @Schema(title = "类型") private String type; private static final long serialVersionUID = 1L; + + public enum Column { + paramKey("param_key", "paramKey", "VARCHAR", false), + paramValue("param_value", "paramValue", "VARCHAR", false), + type("type", "type", "VARCHAR", true); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/TestResourcePool.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/TestResourcePool.java index 2d7adf8ed6..7de50715c8 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/TestResourcePool.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/TestResourcePool.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -18,7 +20,7 @@ public class TestResourcePool implements Serializable { @Size(min = 1, max = 255, message = "{test_resource_pool.name.length_range}", groups = {Created.class, Updated.class}) private String name; - @Schema(title = "类型(node/k8s)", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(title = "类型", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{test_resource_pool.type.not_blank}", groups = {Created.class}) @Size(min = 1, max = 30, message = "{test_resource_pool.type.length_range}", groups = {Created.class, Updated.class}) private String type; @@ -50,13 +52,95 @@ public class TestResourcePool implements Serializable { @Schema(title = "ms部署地址") private String serverUrl; - @Schema(title = "资源池应用类型(组织/全部)", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{test_resource_pool.all_org.not_blank}", groups = {Created.class}) + @Schema(title = "资源池应用类型(组织/全部)") private Boolean allOrg; - @Schema(title = "是否删除", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{test_resource_pool.deleted.not_blank}", groups = {Created.class}) + @Schema(title = "是否删除") private Boolean deleted; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + name("name", "name", "VARCHAR", true), + type("type", "type", "VARCHAR", true), + description("description", "description", "VARCHAR", false), + enable("enable", "enable", "BIT", true), + createTime("create_time", "createTime", "BIGINT", false), + updateTime("update_time", "updateTime", "BIGINT", false), + createUser("create_user", "createUser", "VARCHAR", false), + apiTest("api_test", "apiTest", "BIT", false), + loadTest("load_test", "loadTest", "BIT", false), + uiTest("ui_test", "uiTest", "BIT", false), + serverUrl("server_url", "serverUrl", "VARCHAR", false), + allOrg("all_org", "allOrg", "BIT", false), + deleted("deleted", "deleted", "BIT", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/User.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/User.java index ea15bea5bd..18101eb407 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/User.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/User.java @@ -1,20 +1,18 @@ package io.metersphere.system.domain; -import io.metersphere.validation.groups.Created; -import io.metersphere.validation.groups.Updated; +import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.NotNull; -import jakarta.validation.constraints.Size; -import lombok.Data; - +import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import lombok.Data; @Data public class User implements Serializable { @Schema(title = "用户ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{user.id.not_blank}", groups = {Updated.class}) - @Size(min = 1, max = 50, message = "{user.id.length_range}", groups = {Updated.class}) + @Size(min = 1, max = 50, message = "{user.id.length_range}", groups = {Created.class, Updated.class}) private String id; @Schema(title = "用户名", requiredMode = Schema.RequiredMode.REQUIRED) @@ -62,9 +60,93 @@ public class User implements Serializable { @Schema(title = "修改人") private String updateUser; - @Schema(title = "是否删除", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{user.deleted.not_blank}", groups = {Created.class}) + @Schema(title = "是否删除") private Boolean deleted; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + name("name", "name", "VARCHAR", true), + email("email", "email", "VARCHAR", false), + password("password", "password", "VARCHAR", true), + enable("enable", "enable", "BIT", true), + createTime("create_time", "createTime", "BIGINT", false), + updateTime("update_time", "updateTime", "BIGINT", false), + language("language", "language", "VARCHAR", true), + lastOrganizationId("last_organization_id", "lastOrganizationId", "VARCHAR", false), + phone("phone", "phone", "VARCHAR", false), + source("source", "source", "VARCHAR", true), + lastProjectId("last_project_id", "lastProjectId", "VARCHAR", false), + createUser("create_user", "createUser", "VARCHAR", false), + updateUser("update_user", "updateUser", "VARCHAR", false), + deleted("deleted", "deleted", "BIT", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserExtend.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserExtend.java index 04712caf51..92618effb5 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserExtend.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserExtend.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -20,4 +22,77 @@ public class UserExtend implements Serializable { private byte[] platformInfo; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + seleniumServer("selenium_server", "seleniumServer", "VARCHAR", false), + platformInfo("platform_info", "platformInfo", "LONGVARBINARY", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserKey.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserKey.java index 57e200329d..f17aa63d1d 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserKey.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserKey.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -33,4 +35,80 @@ public class UserKey implements Serializable { private Boolean enable; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + createUser("create_user", "createUser", "VARCHAR", false), + accessKey("access_key", "accessKey", "VARCHAR", false), + secretKey("secret_key", "secretKey", "VARCHAR", false), + createTime("create_time", "createTime", "BIGINT", false), + enable("enable", "enable", "BIT", true); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserRole.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserRole.java index 6a2cdefa3b..7df5e641e3 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserRole.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserRole.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -45,4 +47,83 @@ public class UserRole implements Serializable { private String scopeId; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + name("name", "name", "VARCHAR", true), + description("description", "description", "VARCHAR", false), + internal("internal", "internal", "BIT", false), + type("type", "type", "VARCHAR", true), + createTime("create_time", "createTime", "BIGINT", false), + updateTime("update_time", "updateTime", "BIGINT", false), + createUser("create_user", "createUser", "VARCHAR", false), + scopeId("scope_id", "scopeId", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserRolePermission.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserRolePermission.java index 6422b44f1c..1c4ddd3cd3 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserRolePermission.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserRolePermission.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -24,4 +26,77 @@ public class UserRolePermission implements Serializable { private String permissionId; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + roleId("role_id", "roleId", "VARCHAR", false), + permissionId("permission_id", "permissionId", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserRoleRelation.java b/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserRoleRelation.java index 029c724a67..a341ae5564 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserRoleRelation.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/domain/UserRoleRelation.java @@ -2,19 +2,13 @@ package io.metersphere.system.domain; import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.NotBlank; -import jakarta.validation.constraints.Size; -import lombok.AllArgsConstructor; +import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; -import lombok.NoArgsConstructor; -/** - * @author jianxing - */ @Data -@AllArgsConstructor -@NoArgsConstructor public class UserRoleRelation implements Serializable { @Schema(title = "用户组关系ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{user_role_relation.id.not_blank}", groups = {Updated.class}) @@ -43,4 +37,80 @@ public class UserRoleRelation implements Serializable { private String createUser; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + userId("user_id", "userId", "VARCHAR", false), + roleId("role_id", "roleId", "VARCHAR", false), + sourceId("source_id", "sourceId", "VARCHAR", false), + createTime("create_time", "createTime", "BIGINT", false), + createUser("create_user", "createUser", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/AuthSourceMapper.java b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/AuthSourceMapper.java index 8029572b57..3ee3b58170 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/AuthSourceMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/AuthSourceMapper.java @@ -33,4 +33,8 @@ public interface AuthSourceMapper { int updateByPrimaryKeyWithBLOBs(AuthSource record); int updateByPrimaryKey(AuthSource record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") AuthSource.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/AuthSourceMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/AuthSourceMapper.xml index ddf95c94d8..75066ea7b6 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/AuthSourceMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/AuthSourceMapper.xml @@ -301,4 +301,53 @@ `type` = #{type,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into auth_source + (id, `enable`, create_time, update_time, description, `name`, `type`, configuration + ) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.enable,jdbcType=BIT}, #{item.createTime,jdbcType=BIGINT}, + #{item.updateTime,jdbcType=BIGINT}, #{item.description,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, + #{item.type,jdbcType=VARCHAR}, #{item.configuration,jdbcType=LONGVARBINARY}) + + + + insert into auth_source ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.enable,jdbcType=BIT} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.updateTime,jdbcType=BIGINT} + + + #{item.description,jdbcType=VARCHAR} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.type,jdbcType=VARCHAR} + + + #{item.configuration,jdbcType=LONGVARBINARY} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/LicenseMapper.java b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/LicenseMapper.java index acfb7d1c9d..f841714617 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/LicenseMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/LicenseMapper.java @@ -33,4 +33,8 @@ public interface LicenseMapper { int updateByPrimaryKeyWithBLOBs(License record); int updateByPrimaryKey(License record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") License.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/LicenseMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/LicenseMapper.xml index 2009d1887e..22fede72ab 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/LicenseMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/LicenseMapper.xml @@ -231,4 +231,39 @@ update_time = #{updateTime,jdbcType=BIGINT} where id = #{id,jdbcType=VARCHAR} + + insert into license + (id, create_time, update_time, license_code) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, #{item.updateTime,jdbcType=BIGINT}, + #{item.licenseCode,jdbcType=LONGVARCHAR}) + + + + insert into license ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.updateTime,jdbcType=BIGINT} + + + #{item.licenseCode,jdbcType=LONGVARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/MessageTaskBlobMapper.java b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/MessageTaskBlobMapper.java index 66468beeb2..a82a60fba2 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/MessageTaskBlobMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/MessageTaskBlobMapper.java @@ -31,4 +31,8 @@ public interface MessageTaskBlobMapper { int updateByPrimaryKeySelective(MessageTaskBlob record); int updateByPrimaryKeyWithBLOBs(MessageTaskBlob record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") MessageTaskBlob.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/MessageTaskBlobMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/MessageTaskBlobMapper.xml index b9cedc122d..d7151a468a 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/MessageTaskBlobMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/MessageTaskBlobMapper.xml @@ -191,4 +191,32 @@ set `template` = #{template,jdbcType=LONGVARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into message_task_blob + (id, `template`) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.template,jdbcType=LONGVARCHAR}) + + + + insert into message_task_blob ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.template,jdbcType=LONGVARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/MessageTaskMapper.java b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/MessageTaskMapper.java index d2d26afc86..005a7bc1b2 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/MessageTaskMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/MessageTaskMapper.java @@ -27,4 +27,8 @@ public interface MessageTaskMapper { int updateByPrimaryKeySelective(MessageTask record); int updateByPrimaryKey(MessageTask record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") MessageTask.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/MessageTaskMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/MessageTaskMapper.xml index 3da55773ca..cb8f4d8e18 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/MessageTaskMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/MessageTaskMapper.xml @@ -272,4 +272,57 @@ project_id = #{projectId,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into message_task + (id, `type`, event, receiver, task_type, webhook, test_id, create_time, project_id + ) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR}, #{item.event,jdbcType=VARCHAR}, + #{item.receiver,jdbcType=VARCHAR}, #{item.taskType,jdbcType=VARCHAR}, #{item.webhook,jdbcType=VARCHAR}, + #{item.testId,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, #{item.projectId,jdbcType=VARCHAR} + ) + + + + insert into message_task ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.type,jdbcType=VARCHAR} + + + #{item.event,jdbcType=VARCHAR} + + + #{item.receiver,jdbcType=VARCHAR} + + + #{item.taskType,jdbcType=VARCHAR} + + + #{item.webhook,jdbcType=VARCHAR} + + + #{item.testId,jdbcType=VARCHAR} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.projectId,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/NotificationMapper.java b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/NotificationMapper.java index b4fd7a156d..bb744afacc 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/NotificationMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/NotificationMapper.java @@ -27,4 +27,8 @@ public interface NotificationMapper { int updateByPrimaryKeySelective(Notification record); int updateByPrimaryKey(Notification record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") Notification.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/NotificationMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/NotificationMapper.xml index 75669bdd64..2fa8efd689 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/NotificationMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/NotificationMapper.xml @@ -303,4 +303,63 @@ resource_name = #{resourceName,jdbcType=VARCHAR} where id = #{id,jdbcType=BIGINT} + + insert into notification + (id, `type`, receiver, title, `status`, create_time, `operator`, `operation`, resource_id, + resource_type, resource_name) + values + + (#{item.id,jdbcType=BIGINT}, #{item.type,jdbcType=VARCHAR}, #{item.receiver,jdbcType=VARCHAR}, + #{item.title,jdbcType=VARCHAR}, #{item.status,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, + #{item.operator,jdbcType=VARCHAR}, #{item.operation,jdbcType=VARCHAR}, #{item.resourceId,jdbcType=VARCHAR}, + #{item.resourceType,jdbcType=VARCHAR}, #{item.resourceName,jdbcType=VARCHAR}) + + + + insert into notification ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=BIGINT} + + + #{item.type,jdbcType=VARCHAR} + + + #{item.receiver,jdbcType=VARCHAR} + + + #{item.title,jdbcType=VARCHAR} + + + #{item.status,jdbcType=VARCHAR} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.operator,jdbcType=VARCHAR} + + + #{item.operation,jdbcType=VARCHAR} + + + #{item.resourceId,jdbcType=VARCHAR} + + + #{item.resourceType,jdbcType=VARCHAR} + + + #{item.resourceName,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/NoviceStatisticsMapper.java b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/NoviceStatisticsMapper.java index 6816d69a94..30816fc508 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/NoviceStatisticsMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/NoviceStatisticsMapper.java @@ -33,4 +33,8 @@ public interface NoviceStatisticsMapper { int updateByPrimaryKeyWithBLOBs(NoviceStatistics record); int updateByPrimaryKey(NoviceStatistics record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") NoviceStatistics.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/NoviceStatisticsMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/NoviceStatisticsMapper.xml index 42539b3ba6..1bae41ca33 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/NoviceStatisticsMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/NoviceStatisticsMapper.xml @@ -284,4 +284,49 @@ update_time = #{updateTime,jdbcType=BIGINT} where id = #{id,jdbcType=VARCHAR} + + insert into novice_statistics + (id, user_id, guide_step, guide_num, create_time, update_time, data_option) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.userId,jdbcType=VARCHAR}, #{item.guideStep,jdbcType=BIT}, + #{item.guideNum,jdbcType=INTEGER}, #{item.createTime,jdbcType=BIGINT}, #{item.updateTime,jdbcType=BIGINT}, + #{item.dataOption,jdbcType=LONGVARBINARY}) + + + + insert into novice_statistics ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.userId,jdbcType=VARCHAR} + + + #{item.guideStep,jdbcType=BIT} + + + #{item.guideNum,jdbcType=INTEGER} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.updateTime,jdbcType=BIGINT} + + + #{item.dataOption,jdbcType=LONGVARBINARY} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/OrganizationMapper.java b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/OrganizationMapper.java index cfc09cdc72..1d9b5fa350 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/OrganizationMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/OrganizationMapper.java @@ -27,4 +27,8 @@ public interface OrganizationMapper { int updateByPrimaryKeySelective(Organization record); int updateByPrimaryKey(Organization record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") Organization.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/OrganizationMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/OrganizationMapper.xml index 4f17f78b4e..630cd513f0 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/OrganizationMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/OrganizationMapper.xml @@ -320,4 +320,67 @@ `enable` = #{enable,jdbcType=BIT} where id = #{id,jdbcType=VARCHAR} + + insert into organization + (id, num, `name`, description, create_time, update_time, create_user, update_user, + deleted, delete_user, delete_time, `enable`) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.num,jdbcType=BIGINT}, #{item.name,jdbcType=VARCHAR}, + #{item.description,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, #{item.updateTime,jdbcType=BIGINT}, + #{item.createUser,jdbcType=VARCHAR}, #{item.updateUser,jdbcType=VARCHAR}, #{item.deleted,jdbcType=BIT}, + #{item.deleteUser,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=BIGINT}, #{item.enable,jdbcType=BIT} + ) + + + + insert into organization ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.num,jdbcType=BIGINT} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.description,jdbcType=VARCHAR} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.updateTime,jdbcType=BIGINT} + + + #{item.createUser,jdbcType=VARCHAR} + + + #{item.updateUser,jdbcType=VARCHAR} + + + #{item.deleted,jdbcType=BIT} + + + #{item.deleteUser,jdbcType=VARCHAR} + + + #{item.deleteTime,jdbcType=BIGINT} + + + #{item.enable,jdbcType=BIT} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/PluginFrontScriptMapper.java b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/PluginFrontScriptMapper.java index 0be7dee207..80199f3db0 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/PluginFrontScriptMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/PluginFrontScriptMapper.java @@ -31,4 +31,8 @@ public interface PluginFrontScriptMapper { int updateByPrimaryKeySelective(PluginFrontScript record); int updateByPrimaryKeyWithBLOBs(PluginFrontScript record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") PluginFrontScript.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/PluginFrontScriptMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/PluginFrontScriptMapper.xml index 035d292550..050e7d88bf 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/PluginFrontScriptMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/PluginFrontScriptMapper.xml @@ -209,4 +209,36 @@ where plugin_id = #{pluginId,jdbcType=VARCHAR} and script_id = #{scriptId,jdbcType=VARCHAR} + + insert into plugin_front_script + (plugin_id, script_id, script) + values + + (#{item.pluginId,jdbcType=VARCHAR}, #{item.scriptId,jdbcType=VARCHAR}, #{item.script,jdbcType=LONGVARCHAR} + ) + + + + insert into plugin_front_script ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.pluginId,jdbcType=VARCHAR} + + + #{item.scriptId,jdbcType=VARCHAR} + + + #{item.script,jdbcType=LONGVARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/PluginMapper.java b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/PluginMapper.java index 83b3c96803..e30cf0e962 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/PluginMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/PluginMapper.java @@ -27,4 +27,8 @@ public interface PluginMapper { int updateByPrimaryKeySelective(Plugin record); int updateByPrimaryKey(Plugin record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") Plugin.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/PluginMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/PluginMapper.xml index 5dd3ee50f0..641747acb7 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/PluginMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/PluginMapper.xml @@ -320,4 +320,67 @@ scenario = #{scenario,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into plugin + (id, `name`, plugin_id, file_name, create_time, update_time, create_user, `enable`, + `global`, xpack, description, scenario) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.pluginId,jdbcType=VARCHAR}, + #{item.fileName,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, #{item.updateTime,jdbcType=BIGINT}, + #{item.createUser,jdbcType=VARCHAR}, #{item.enable,jdbcType=BIT}, #{item.global,jdbcType=BIT}, + #{item.xpack,jdbcType=BIT}, #{item.description,jdbcType=VARCHAR}, #{item.scenario,jdbcType=VARCHAR} + ) + + + + insert into plugin ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.pluginId,jdbcType=VARCHAR} + + + #{item.fileName,jdbcType=VARCHAR} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.updateTime,jdbcType=BIGINT} + + + #{item.createUser,jdbcType=VARCHAR} + + + #{item.enable,jdbcType=BIT} + + + #{item.global,jdbcType=BIT} + + + #{item.xpack,jdbcType=BIT} + + + #{item.description,jdbcType=VARCHAR} + + + #{item.scenario,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/PluginOrganizationMapper.java b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/PluginOrganizationMapper.java index e93dffba78..abe9a1ec10 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/PluginOrganizationMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/PluginOrganizationMapper.java @@ -21,4 +21,8 @@ public interface PluginOrganizationMapper { int updateByExampleSelective(@Param("record") PluginOrganization record, @Param("example") PluginOrganizationExample example); int updateByExample(@Param("record") PluginOrganization record, @Param("example") PluginOrganizationExample example); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") PluginOrganization.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/PluginOrganizationMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/PluginOrganizationMapper.xml index 7840cc69c0..8623e66cf2 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/PluginOrganizationMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/PluginOrganizationMapper.xml @@ -142,4 +142,32 @@ + + insert into plugin_organization + (plugin_id, organization_id) + values + + (#{item.pluginId,jdbcType=VARCHAR}, #{item.organizationId,jdbcType=VARCHAR}) + + + + insert into plugin_organization ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.pluginId,jdbcType=VARCHAR} + + + #{item.organizationId,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/ScheduleMapper.java b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/ScheduleMapper.java index 5c9c668496..8d1ba331e5 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/ScheduleMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/ScheduleMapper.java @@ -27,4 +27,8 @@ public interface ScheduleMapper { int updateByPrimaryKeySelective(Schedule record); int updateByPrimaryKey(Schedule record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") Schedule.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/ScheduleMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/ScheduleMapper.xml index 33597f18d4..b1083e1ec2 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/ScheduleMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/ScheduleMapper.xml @@ -335,4 +335,70 @@ config = #{config,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into schedule + (id, `key`, `type`, `value`, job, `enable`, resource_id, create_user, create_time, + update_time, project_id, `name`, config) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.key,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR}, + #{item.value,jdbcType=VARCHAR}, #{item.job,jdbcType=VARCHAR}, #{item.enable,jdbcType=BIT}, + #{item.resourceId,jdbcType=VARCHAR}, #{item.createUser,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, + #{item.updateTime,jdbcType=BIGINT}, #{item.projectId,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, + #{item.config,jdbcType=VARCHAR}) + + + + insert into schedule ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.key,jdbcType=VARCHAR} + + + #{item.type,jdbcType=VARCHAR} + + + #{item.value,jdbcType=VARCHAR} + + + #{item.job,jdbcType=VARCHAR} + + + #{item.enable,jdbcType=BIT} + + + #{item.resourceId,jdbcType=VARCHAR} + + + #{item.createUser,jdbcType=VARCHAR} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.updateTime,jdbcType=BIGINT} + + + #{item.projectId,jdbcType=VARCHAR} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.config,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/ServiceIntegrationMapper.java b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/ServiceIntegrationMapper.java index efc798377f..2632976aa2 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/ServiceIntegrationMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/ServiceIntegrationMapper.java @@ -33,4 +33,8 @@ public interface ServiceIntegrationMapper { int updateByPrimaryKeyWithBLOBs(ServiceIntegration record); int updateByPrimaryKey(ServiceIntegration record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") ServiceIntegration.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/ServiceIntegrationMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/ServiceIntegrationMapper.xml index f143f3628b..fd242d5209 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/ServiceIntegrationMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/ServiceIntegrationMapper.xml @@ -231,4 +231,39 @@ organization_id = #{organizationId,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into service_integration + (id, platform, organization_id, configuration) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.platform,jdbcType=VARCHAR}, #{item.organizationId,jdbcType=VARCHAR}, + #{item.configuration,jdbcType=LONGVARBINARY}) + + + + insert into service_integration ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.platform,jdbcType=VARCHAR} + + + #{item.organizationId,jdbcType=VARCHAR} + + + #{item.configuration,jdbcType=LONGVARBINARY} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/SystemParameterMapper.java b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/SystemParameterMapper.java index 55f01c4977..b58bb0c4cc 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/SystemParameterMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/SystemParameterMapper.java @@ -27,4 +27,8 @@ public interface SystemParameterMapper { int updateByPrimaryKeySelective(SystemParameter record); int updateByPrimaryKey(SystemParameter record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") SystemParameter.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/SystemParameterMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/SystemParameterMapper.xml index 61bf10222b..60c8cf294d 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/SystemParameterMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/SystemParameterMapper.xml @@ -178,4 +178,36 @@ `type` = #{type,jdbcType=VARCHAR} where param_key = #{paramKey,jdbcType=VARCHAR} + + insert into system_parameter + (param_key, param_value, `type`) + values + + (#{item.paramKey,jdbcType=VARCHAR}, #{item.paramValue,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR} + ) + + + + insert into system_parameter ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.paramKey,jdbcType=VARCHAR} + + + #{item.paramValue,jdbcType=VARCHAR} + + + #{item.type,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/TestResourcePoolMapper.java b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/TestResourcePoolMapper.java index 74f78ac89f..cbc599b907 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/TestResourcePoolMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/TestResourcePoolMapper.java @@ -27,4 +27,8 @@ public interface TestResourcePoolMapper { int updateByPrimaryKeySelective(TestResourcePool record); int updateByPrimaryKey(TestResourcePool record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") TestResourcePool.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/TestResourcePoolMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/TestResourcePoolMapper.xml index 905b8b98e3..891244e2a9 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/TestResourcePoolMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/TestResourcePoolMapper.xml @@ -350,4 +350,73 @@ deleted = #{deleted,jdbcType=BIT} where id = #{id,jdbcType=VARCHAR} + + insert into test_resource_pool + (id, `name`, `type`, description, `enable`, create_time, update_time, create_user, + api_test, load_test, ui_test, server_url, all_org, deleted) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.type,jdbcType=VARCHAR}, + #{item.description,jdbcType=VARCHAR}, #{item.enable,jdbcType=BIT}, #{item.createTime,jdbcType=BIGINT}, + #{item.updateTime,jdbcType=BIGINT}, #{item.createUser,jdbcType=VARCHAR}, #{item.apiTest,jdbcType=BIT}, + #{item.loadTest,jdbcType=BIT}, #{item.uiTest,jdbcType=BIT}, #{item.serverUrl,jdbcType=VARCHAR}, + #{item.allOrg,jdbcType=BIT}, #{item.deleted,jdbcType=BIT}) + + + + insert into test_resource_pool ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.type,jdbcType=VARCHAR} + + + #{item.description,jdbcType=VARCHAR} + + + #{item.enable,jdbcType=BIT} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.updateTime,jdbcType=BIGINT} + + + #{item.createUser,jdbcType=VARCHAR} + + + #{item.apiTest,jdbcType=BIT} + + + #{item.loadTest,jdbcType=BIT} + + + #{item.uiTest,jdbcType=BIT} + + + #{item.serverUrl,jdbcType=VARCHAR} + + + #{item.allOrg,jdbcType=BIT} + + + #{item.deleted,jdbcType=BIT} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserExtendMapper.java b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserExtendMapper.java index 84d27b447f..ddb99f9068 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserExtendMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserExtendMapper.java @@ -33,4 +33,8 @@ public interface UserExtendMapper { int updateByPrimaryKeyWithBLOBs(UserExtend record); int updateByPrimaryKey(UserExtend record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") UserExtend.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserExtendMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserExtendMapper.xml index a1d5a06a6e..b46349743b 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserExtendMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserExtendMapper.xml @@ -214,4 +214,36 @@ set selenium_server = #{seleniumServer,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into user_extend + (id, selenium_server, platform_info) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.seleniumServer,jdbcType=VARCHAR}, #{item.platformInfo,jdbcType=LONGVARBINARY} + ) + + + + insert into user_extend ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.seleniumServer,jdbcType=VARCHAR} + + + #{item.platformInfo,jdbcType=LONGVARBINARY} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserKeyMapper.java b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserKeyMapper.java index 6c8b266c6c..31209701ae 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserKeyMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserKeyMapper.java @@ -27,4 +27,8 @@ public interface UserKeyMapper { int updateByPrimaryKeySelective(UserKey record); int updateByPrimaryKey(UserKey record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") UserKey.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserKeyMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserKeyMapper.xml index 6fe5cbe122..2e644d6bdc 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserKeyMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserKeyMapper.xml @@ -225,4 +225,46 @@ `enable` = #{enable,jdbcType=BIT} where id = #{id,jdbcType=VARCHAR} + + insert into user_key + (id, create_user, access_key, secret_key, create_time, `enable`) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.createUser,jdbcType=VARCHAR}, #{item.accessKey,jdbcType=VARCHAR}, + #{item.secretKey,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, #{item.enable,jdbcType=BIT} + ) + + + + insert into user_key ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.createUser,jdbcType=VARCHAR} + + + #{item.accessKey,jdbcType=VARCHAR} + + + #{item.secretKey,jdbcType=VARCHAR} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.enable,jdbcType=BIT} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserMapper.java b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserMapper.java index 6aefbb9d80..f53b9ff712 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserMapper.java @@ -27,4 +27,8 @@ public interface UserMapper { int updateByPrimaryKeySelective(User record); int updateByPrimaryKey(User record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") User.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserMapper.xml index 0945bd3a28..9ba99324aa 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserMapper.xml @@ -367,4 +367,77 @@ deleted = #{deleted,jdbcType=BIT} where id = #{id,jdbcType=VARCHAR} + + insert into user + (id, `name`, email, `password`, `enable`, create_time, update_time, `language`, last_organization_id, + phone, `source`, last_project_id, create_user, update_user, deleted) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.email,jdbcType=VARCHAR}, + #{item.password,jdbcType=VARCHAR}, #{item.enable,jdbcType=BIT}, #{item.createTime,jdbcType=BIGINT}, + #{item.updateTime,jdbcType=BIGINT}, #{item.language,jdbcType=VARCHAR}, #{item.lastOrganizationId,jdbcType=VARCHAR}, + #{item.phone,jdbcType=VARCHAR}, #{item.source,jdbcType=VARCHAR}, #{item.lastProjectId,jdbcType=VARCHAR}, + #{item.createUser,jdbcType=VARCHAR}, #{item.updateUser,jdbcType=VARCHAR}, #{item.deleted,jdbcType=BIT} + ) + + + + insert into user ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.email,jdbcType=VARCHAR} + + + #{item.password,jdbcType=VARCHAR} + + + #{item.enable,jdbcType=BIT} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.updateTime,jdbcType=BIGINT} + + + #{item.language,jdbcType=VARCHAR} + + + #{item.lastOrganizationId,jdbcType=VARCHAR} + + + #{item.phone,jdbcType=VARCHAR} + + + #{item.source,jdbcType=VARCHAR} + + + #{item.lastProjectId,jdbcType=VARCHAR} + + + #{item.createUser,jdbcType=VARCHAR} + + + #{item.updateUser,jdbcType=VARCHAR} + + + #{item.deleted,jdbcType=BIT} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserRoleMapper.java b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserRoleMapper.java index 2c9207790f..73393ace13 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserRoleMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserRoleMapper.java @@ -27,4 +27,8 @@ public interface UserRoleMapper { int updateByPrimaryKeySelective(UserRole record); int updateByPrimaryKey(UserRole record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") UserRole.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserRoleMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserRoleMapper.xml index ba8972e3f2..d18744649a 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserRoleMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserRoleMapper.xml @@ -273,4 +273,57 @@ scope_id = #{scopeId,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into user_role + (id, `name`, description, internal, `type`, create_time, update_time, create_user, + scope_id) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.description,jdbcType=VARCHAR}, + #{item.internal,jdbcType=BIT}, #{item.type,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, + #{item.updateTime,jdbcType=BIGINT}, #{item.createUser,jdbcType=VARCHAR}, #{item.scopeId,jdbcType=VARCHAR} + ) + + + + insert into user_role ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.description,jdbcType=VARCHAR} + + + #{item.internal,jdbcType=BIT} + + + #{item.type,jdbcType=VARCHAR} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.updateTime,jdbcType=BIGINT} + + + #{item.createUser,jdbcType=VARCHAR} + + + #{item.scopeId,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserRolePermissionMapper.java b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserRolePermissionMapper.java index 178d4da89d..0f4bd10761 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserRolePermissionMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserRolePermissionMapper.java @@ -27,4 +27,8 @@ public interface UserRolePermissionMapper { int updateByPrimaryKeySelective(UserRolePermission record); int updateByPrimaryKey(UserRolePermission record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") UserRolePermission.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserRolePermissionMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserRolePermissionMapper.xml index 44c442e67b..6991847f01 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserRolePermissionMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserRolePermissionMapper.xml @@ -178,4 +178,36 @@ permission_id = #{permissionId,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into user_role_permission + (id, role_id, permission_id) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.roleId,jdbcType=VARCHAR}, #{item.permissionId,jdbcType=VARCHAR} + ) + + + + insert into user_role_permission ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.roleId,jdbcType=VARCHAR} + + + #{item.permissionId,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserRoleRelationMapper.java b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserRoleRelationMapper.java index dc5c970cd0..68940aab3d 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserRoleRelationMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserRoleRelationMapper.java @@ -27,4 +27,8 @@ public interface UserRoleRelationMapper { int updateByPrimaryKeySelective(UserRoleRelation record); int updateByPrimaryKey(UserRoleRelation record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") UserRoleRelation.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserRoleRelationMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserRoleRelationMapper.xml index 515de8af30..4b77fd9e1b 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserRoleRelationMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/system/mapper/UserRoleRelationMapper.xml @@ -225,4 +225,46 @@ create_user = #{createUser,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into user_role_relation + (id, user_id, role_id, source_id, create_time, create_user) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.userId,jdbcType=VARCHAR}, #{item.roleId,jdbcType=VARCHAR}, + #{item.sourceId,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, #{item.createUser,jdbcType=VARCHAR} + ) + + + + insert into user_role_relation ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.userId,jdbcType=VARCHAR} + + + #{item.roleId,jdbcType=VARCHAR} + + + #{item.sourceId,jdbcType=VARCHAR} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.createUser,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file 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 88f3d75689..8b52f1019f 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 @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -58,12 +60,10 @@ public class UiCustomCommand implements Serializable { @Schema(title = "最后执行结果") private String lastResult; - @Schema(title = "num", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{ui_custom_command.num.not_blank}", groups = {Created.class}) + @Schema(title = "num") private Integer num; - @Schema(title = "删除状态", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{ui_custom_command.deleted.not_blank}", groups = {Created.class}) + @Schema(title = "删除状态") private Boolean deleted; @Schema(title = "自定义num") @@ -92,12 +92,104 @@ public class UiCustomCommand implements Serializable { @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) - @NotNull(message = "{ui_custom_command.latest.not_blank}", groups = {Created.class}) + @Schema(title = "是否为最新版本 0:否,1:是") private Boolean latest; @Schema(title = "描述") private String description; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + projectId("project_id", "projectId", "VARCHAR", false), + tags("tags", "tags", "VARCHAR", false), + moduleId("module_id", "moduleId", "VARCHAR", false), + modulePath("module_path", "modulePath", "VARCHAR", false), + name("name", "name", "VARCHAR", true), + level("level", "level", "VARCHAR", true), + status("status", "status", "VARCHAR", true), + principal("principal", "principal", "VARCHAR", false), + createTime("create_time", "createTime", "BIGINT", false), + updateTime("update_time", "updateTime", "BIGINT", false), + lastResult("last_result", "lastResult", "VARCHAR", false), + num("num", "num", "INTEGER", false), + deleted("deleted", "deleted", "BIT", false), + customNum("custom_num", "customNum", "VARCHAR", false), + createUser("create_user", "createUser", "VARCHAR", false), + deleteTime("delete_time", "deleteTime", "BIGINT", false), + deleteUser("delete_user", "deleteUser", "VARCHAR", false), + pos("pos", "pos", "BIGINT", false), + versionId("version_id", "versionId", "VARCHAR", false), + refId("ref_id", "refId", "VARCHAR", false), + latest("latest", "latest", "BIT", false), + description("description", "description", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiCustomCommandBlob.java b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiCustomCommandBlob.java index 9e8a111e0e..33d40aaefc 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiCustomCommandBlob.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiCustomCommandBlob.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -20,4 +22,77 @@ public class UiCustomCommandBlob implements Serializable { private byte[] commandViewStruct; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + scenarioDefinition("scenario_definition", "scenarioDefinition", "LONGVARBINARY", false), + commandViewStruct("command_view_struct", "commandViewStruct", "LONGVARBINARY", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file 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 49deebb886..d5fa2e0e34 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 @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -23,13 +25,10 @@ public class UiCustomCommandModule implements Serializable { @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) - @NotBlank(message = "{ui_custom_command_module.parent_id.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 50, message = "{ui_custom_command_module.parent_id.length_range}", groups = {Created.class, Updated.class}) + @Schema(title = "父级ID") private String parentId; - @Schema(title = "模块等级", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{ui_custom_command_module.level.not_blank}", groups = {Created.class}) + @Schema(title = "模块等级") private Integer level; @Schema(title = "创建时间") @@ -46,4 +45,83 @@ public class UiCustomCommandModule implements Serializable { private String createUser; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + projectId("project_id", "projectId", "VARCHAR", false), + name("name", "name", "VARCHAR", true), + parentId("parent_id", "parentId", "VARCHAR", false), + level("level", "level", "INTEGER", true), + createTime("create_time", "createTime", "BIGINT", false), + updateTime("update_time", "updateTime", "BIGINT", false), + pos("pos", "pos", "DOUBLE", false), + createUser("create_user", "createUser", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiElement.java b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiElement.java index 5171f3704a..5e7d195ade 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiElement.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiElement.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -13,8 +15,7 @@ public class UiElement implements Serializable { @Size(min = 1, max = 50, message = "{ui_element.id.length_range}", groups = {Created.class, Updated.class}) private String id; - @Schema(title = "元素num", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{ui_element.num.not_blank}", groups = {Created.class}) + @Schema(title = "元素num") private Integer num; @Schema(title = "元素所属模块id", requiredMode = Schema.RequiredMode.REQUIRED) @@ -62,8 +63,7 @@ public class UiElement implements Serializable { @NotNull(message = "{ui_element.pos.not_blank}", groups = {Created.class}) private Long pos; - @Schema(title = "是否为最新版本 0:否,1:是", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{ui_element.latest.not_blank}", groups = {Created.class}) + @Schema(title = "是否为最新版本 0:否,1:是") private Boolean latest; @Schema(title = "元素描述") @@ -76,4 +76,90 @@ public class UiElement implements Serializable { private Long updateTime; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + num("num", "num", "INTEGER", false), + moduleId("module_id", "moduleId", "VARCHAR", false), + projectId("project_id", "projectId", "VARCHAR", false), + name("name", "name", "VARCHAR", true), + locationType("location_type", "locationType", "VARCHAR", false), + location("location", "location", "VARCHAR", true), + createUser("create_user", "createUser", "VARCHAR", false), + updateUser("update_user", "updateUser", "VARCHAR", false), + versionId("version_id", "versionId", "VARCHAR", false), + refId("ref_id", "refId", "VARCHAR", false), + pos("pos", "pos", "BIGINT", false), + latest("latest", "latest", "BIT", false), + description("description", "description", "VARCHAR", false), + createTime("create_time", "createTime", "BIGINT", false), + updateTime("update_time", "updateTime", "BIGINT", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiElementCommandReference.java b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiElementCommandReference.java index 9a824ff0cd..c5542d2063 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiElementCommandReference.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiElementCommandReference.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -34,4 +36,79 @@ public class UiElementCommandReference implements Serializable { private String projectId; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + elementId("element_id", "elementId", "VARCHAR", false), + elementModuleId("element_module_id", "elementModuleId", "VARCHAR", false), + commandId("command_id", "commandId", "VARCHAR", false), + projectId("project_id", "projectId", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiElementModule.java b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiElementModule.java index 9594c2e157..d853321e35 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiElementModule.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiElementModule.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -23,13 +25,10 @@ public class UiElementModule implements Serializable { @Size(min = 1, max = 255, message = "{ui_element_module.name.length_range}", groups = {Created.class, Updated.class}) private String name; - @Schema(title = "父级ID", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{ui_element_module.parent_id.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 50, message = "{ui_element_module.parent_id.length_range}", groups = {Created.class, Updated.class}) + @Schema(title = "父级ID") private String parentId; - @Schema(title = "模块等级", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{ui_element_module.level.not_blank}", groups = {Created.class}) + @Schema(title = "模块等级") private Integer level; @Schema(title = "创建时间") @@ -46,4 +45,83 @@ public class UiElementModule implements Serializable { private String createUser; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + projectId("project_id", "projectId", "VARCHAR", false), + name("name", "name", "VARCHAR", true), + parentId("parent_id", "parentId", "VARCHAR", false), + level("level", "level", "INTEGER", true), + createTime("create_time", "createTime", "BIGINT", false), + updateTime("update_time", "updateTime", "BIGINT", false), + pos("pos", "pos", "DOUBLE", false), + createUser("create_user", "createUser", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiElementScenarioReference.java b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiElementScenarioReference.java index bc7c550651..2c0e7dad11 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiElementScenarioReference.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiElementScenarioReference.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -34,4 +36,79 @@ public class UiElementScenarioReference implements Serializable { private String projectId; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + elementId("element_id", "elementId", "VARCHAR", false), + elementModuleId("element_module_id", "elementModuleId", "VARCHAR", false), + scenarioId("scenario_id", "scenarioId", "VARCHAR", false), + projectId("project_id", "projectId", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenario.java b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenario.java index df56ac3c69..3150987282 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenario.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenario.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -46,8 +48,7 @@ public class UiScenario implements Serializable { @Size(min = 1, max = 50, message = "{ui_scenario.principal.length_range}", groups = {Created.class, Updated.class}) private String principal; - @Schema(title = "步骤总数", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{ui_scenario.step_total.not_blank}", groups = {Created.class}) + @Schema(title = "步骤总数") private Integer stepTotal; @Schema(title = "创建时间") @@ -62,12 +63,10 @@ public class UiScenario implements Serializable { @Schema(title = "最后执行结果的报告ID") private String reportId; - @Schema(title = "num", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{ui_scenario.num.not_blank}", groups = {Created.class}) + @Schema(title = "num") private Integer num; - @Schema(title = "删除状态", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{ui_scenario.deleted.not_blank}", groups = {Created.class}) + @Schema(title = "删除状态") private Boolean deleted; @Schema(title = "自定义num") @@ -96,12 +95,105 @@ public class UiScenario implements Serializable { @Size(min = 1, max = 50, message = "{ui_scenario.ref_id.length_range}", groups = {Created.class, Updated.class}) private String refId; - @Schema(title = "是否为最新版本 0:否,1:是", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{ui_scenario.latest.not_blank}", groups = {Created.class}) + @Schema(title = "是否为最新版本 0:否,1:是") private Boolean latest; @Schema(title = "描述") private String description; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + projectId("project_id", "projectId", "VARCHAR", false), + tags("tags", "tags", "VARCHAR", false), + moduleId("module_id", "moduleId", "VARCHAR", false), + name("name", "name", "VARCHAR", true), + level("level", "level", "VARCHAR", true), + status("status", "status", "VARCHAR", true), + principal("principal", "principal", "VARCHAR", false), + stepTotal("step_total", "stepTotal", "INTEGER", false), + createTime("create_time", "createTime", "BIGINT", false), + updateTime("update_time", "updateTime", "BIGINT", false), + lastResult("last_result", "lastResult", "VARCHAR", false), + reportId("report_id", "reportId", "VARCHAR", false), + num("num", "num", "INTEGER", false), + deleted("deleted", "deleted", "BIT", false), + customNum("custom_num", "customNum", "VARCHAR", false), + createUser("create_user", "createUser", "VARCHAR", false), + deleteTime("delete_time", "deleteTime", "BIGINT", false), + deleteUser("delete_user", "deleteUser", "VARCHAR", false), + pos("pos", "pos", "BIGINT", false), + versionId("version_id", "versionId", "VARCHAR", false), + refId("ref_id", "refId", "VARCHAR", false), + latest("latest", "latest", "BIT", false), + description("description", "description", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioBlob.java b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioBlob.java index 40a76b4110..4cd01b6aaa 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioBlob.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioBlob.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -20,4 +22,77 @@ public class UiScenarioBlob implements Serializable { private byte[] environmentJson; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + scenarioDefinition("scenario_definition", "scenarioDefinition", "LONGVARBINARY", false), + environmentJson("environment_json", "environmentJson", "LONGVARBINARY", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioFollower.java b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioFollower.java index e626b2f1a8..3ada181b93 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioFollower.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioFollower.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -19,4 +21,76 @@ public class UiScenarioFollower implements Serializable { private String userId; private static final long serialVersionUID = 1L; + + public enum Column { + scenarioId("scenario_id", "scenarioId", "VARCHAR", false), + userId("user_id", "userId", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioModule.java b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioModule.java index 5642e40a8a..fe1196b087 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioModule.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioModule.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -23,13 +25,10 @@ public class UiScenarioModule implements Serializable { @Size(min = 1, max = 255, message = "{ui_scenario_module.name.length_range}", groups = {Created.class, Updated.class}) private String name; - @Schema(title = "父级ID", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{ui_scenario_module.parent_id.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 50, message = "{ui_scenario_module.parent_id.length_range}", groups = {Created.class, Updated.class}) + @Schema(title = "父级ID") private String parentId; - @Schema(title = "模块等级", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{ui_scenario_module.level.not_blank}", groups = {Created.class}) + @Schema(title = "模块等级") private Integer level; @Schema(title = "创建时间") @@ -46,4 +45,83 @@ public class UiScenarioModule implements Serializable { private String createUser; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + projectId("project_id", "projectId", "VARCHAR", false), + name("name", "name", "VARCHAR", true), + parentId("parent_id", "parentId", "VARCHAR", false), + level("level", "level", "INTEGER", true), + createTime("create_time", "createTime", "BIGINT", false), + updateTime("update_time", "updateTime", "BIGINT", false), + pos("pos", "pos", "DOUBLE", false), + createUser("create_user", "createUser", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioReference.java b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioReference.java index 5a9e1e5dd9..6d498f1c33 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioReference.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioReference.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -35,4 +37,80 @@ public class UiScenarioReference implements Serializable { private String dataType; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + uiScenarioId("ui_scenario_id", "uiScenarioId", "VARCHAR", false), + createTime("create_time", "createTime", "BIGINT", false), + createUser("create_user", "createUser", "VARCHAR", false), + referenceId("reference_id", "referenceId", "VARCHAR", false), + dataType("data_type", "dataType", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioReport.java b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioReport.java index bfd9e7a759..56329d0cb8 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioReport.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioReport.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -39,9 +41,7 @@ public class UiScenarioReport implements Serializable { @Size(min = 1, max = 64, message = "{ui_scenario_report.trigger_mode.length_range}", groups = {Created.class, Updated.class}) private String triggerMode; - @Schema(title = "执行类型(并行,串行)", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{ui_scenario_report.execute_type.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 200, message = "{ui_scenario_report.execute_type.length_range}", groups = {Created.class, Updated.class}) + @Schema(title = "执行类型(并行,串行)") private String executeType; @Schema(title = "场景名称", requiredMode = Schema.RequiredMode.REQUIRED) @@ -66,12 +66,102 @@ public class UiScenarioReport implements Serializable { @NotNull(message = "{ui_scenario_report.end_time.not_blank}", groups = {Created.class}) private Long endTime; - @Schema(title = "报告类型(集合,独立)", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "{ui_scenario_report.integrated.not_blank}", groups = {Created.class}) + @Schema(title = "报告类型(集合,独立)") private Boolean integrated; @Schema(title = "关联的测试计划报告ID(可以为空)") private String relevanceTestPlanReportId; + @Schema(title = "报告生成来源(生成报告,后端调试,本地调试)", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{ui_scenario_report.report_source.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 64, message = "{ui_scenario_report.report_source.length_range}", groups = {Created.class, Updated.class}) + private String reportSource; + private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + projectId("project_id", "projectId", "VARCHAR", false), + name("name", "name", "VARCHAR", true), + createTime("create_time", "createTime", "BIGINT", false), + updateTime("update_time", "updateTime", "BIGINT", false), + status("status", "status", "VARCHAR", true), + triggerMode("trigger_mode", "triggerMode", "VARCHAR", false), + executeType("execute_type", "executeType", "VARCHAR", false), + scenarioName("scenario_name", "scenarioName", "VARCHAR", false), + scenarioId("scenario_id", "scenarioId", "VARCHAR", false), + createUser("create_user", "createUser", "VARCHAR", false), + poolId("pool_id", "poolId", "VARCHAR", false), + endTime("end_time", "endTime", "BIGINT", false), + integrated("integrated", "integrated", "BIT", false), + relevanceTestPlanReportId("relevance_test_plan_report_id", "relevanceTestPlanReportId", "VARCHAR", false), + reportSource("report_source", "reportSource", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioReportDetail.java b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioReportDetail.java index cb219d851d..6384a495ae 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioReportDetail.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioReportDetail.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -49,4 +51,84 @@ public class UiScenarioReportDetail implements Serializable { private byte[] baseInfo; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + resourceId("resource_id", "resourceId", "VARCHAR", false), + reportId("report_id", "reportId", "VARCHAR", false), + createTime("create_time", "createTime", "BIGINT", false), + status("status", "status", "VARCHAR", true), + requestTime("request_time", "requestTime", "BIGINT", false), + totalAssertions("total_assertions", "totalAssertions", "BIGINT", false), + passAssertions("pass_assertions", "passAssertions", "BIGINT", false), + content("content", "content", "LONGVARBINARY", false), + baseInfo("base_info", "baseInfo", "LONGVARBINARY", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioReportEnvironment.java b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioReportEnvironment.java index a1f499fd46..603d64cc35 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioReportEnvironment.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioReportEnvironment.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -20,4 +22,77 @@ public class UiScenarioReportEnvironment implements Serializable { private String environmentId; private static final long serialVersionUID = 1L; + + public enum Column { + reportId("report_id", "reportId", "VARCHAR", false), + projectId("project_id", "projectId", "VARCHAR", false), + environmentId("environment_id", "environmentId", "VARCHAR", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioReportExample.java b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioReportExample.java index dc5c815369..c859b4c5c0 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioReportExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioReportExample.java @@ -1113,6 +1113,76 @@ public class UiScenarioReportExample { addCriterion("relevance_test_plan_report_id not between", value1, value2, "relevanceTestPlanReportId"); return (Criteria) this; } + + public Criteria andReportSourceIsNull() { + addCriterion("report_source is null"); + return (Criteria) this; + } + + public Criteria andReportSourceIsNotNull() { + addCriterion("report_source is not null"); + return (Criteria) this; + } + + public Criteria andReportSourceEqualTo(String value) { + addCriterion("report_source =", value, "reportSource"); + return (Criteria) this; + } + + public Criteria andReportSourceNotEqualTo(String value) { + addCriterion("report_source <>", value, "reportSource"); + return (Criteria) this; + } + + public Criteria andReportSourceGreaterThan(String value) { + addCriterion("report_source >", value, "reportSource"); + return (Criteria) this; + } + + public Criteria andReportSourceGreaterThanOrEqualTo(String value) { + addCriterion("report_source >=", value, "reportSource"); + return (Criteria) this; + } + + public Criteria andReportSourceLessThan(String value) { + addCriterion("report_source <", value, "reportSource"); + return (Criteria) this; + } + + public Criteria andReportSourceLessThanOrEqualTo(String value) { + addCriterion("report_source <=", value, "reportSource"); + return (Criteria) this; + } + + public Criteria andReportSourceLike(String value) { + addCriterion("report_source like", value, "reportSource"); + return (Criteria) this; + } + + public Criteria andReportSourceNotLike(String value) { + addCriterion("report_source not like", value, "reportSource"); + return (Criteria) this; + } + + public Criteria andReportSourceIn(List values) { + addCriterion("report_source in", values, "reportSource"); + return (Criteria) this; + } + + public Criteria andReportSourceNotIn(List values) { + addCriterion("report_source not in", values, "reportSource"); + return (Criteria) this; + } + + public Criteria andReportSourceBetween(String value1, String value2) { + addCriterion("report_source between", value1, value2, "reportSource"); + return (Criteria) this; + } + + public Criteria andReportSourceNotBetween(String value1, String value2) { + addCriterion("report_source not between", value1, value2, "reportSource"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioReportLog.java b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioReportLog.java index 06a6c02239..a44aa1ac6d 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioReportLog.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioReportLog.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -26,4 +28,78 @@ public class UiScenarioReportLog implements Serializable { private byte[] console; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + reportId("report_id", "reportId", "VARCHAR", false), + createTime("create_time", "createTime", "BIGINT", false), + console("console", "console", "LONGVARBINARY", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioReportStructure.java b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioReportStructure.java index e0ad5dfc22..50a4fb0ed5 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioReportStructure.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/domain/UiScenarioReportStructure.java @@ -4,6 +4,8 @@ import io.metersphere.validation.groups.*; import io.swagger.v3.oas.annotations.media.Schema; import jakarta.validation.constraints.*; import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; import lombok.Data; @Data @@ -26,4 +28,78 @@ public class UiScenarioReportStructure implements Serializable { private byte[] resourceTree; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + reportId("report_id", "reportId", "VARCHAR", false), + createTime("create_time", "createTime", "BIGINT", false), + resourceTree("resource_tree", "resourceTree", "LONGVARBINARY", false); + + private static final String BEGINNING_DELIMITER = "`"; + + private static final String ENDING_DELIMITER = "`"; + + private final String column; + + private final boolean isColumnNameDelimited; + + private final String javaProperty; + + private final String jdbcType; + + public String value() { + return this.column; + } + + public String getValue() { + return this.column; + } + + public String getJavaProperty() { + return this.javaProperty; + } + + public String getJdbcType() { + return this.jdbcType; + } + + Column(String column, String javaProperty, String jdbcType, boolean isColumnNameDelimited) { + this.column = column; + this.javaProperty = javaProperty; + this.jdbcType = jdbcType; + this.isColumnNameDelimited = isColumnNameDelimited; + } + + public String desc() { + return this.getEscapedColumnName() + " DESC"; + } + + public String asc() { + return this.getEscapedColumnName() + " ASC"; + } + + public static Column[] excludes(Column ... excludes) { + ArrayList columns = new ArrayList<>(Arrays.asList(Column.values())); + if (excludes != null && excludes.length > 0) { + columns.removeAll(new ArrayList<>(Arrays.asList(excludes))); + } + return columns.toArray(new Column[]{}); + } + + public static Column[] all() { + return Column.values(); + } + + public String getEscapedColumnName() { + if (this.isColumnNameDelimited) { + return new StringBuilder().append(BEGINNING_DELIMITER).append(this.column).append(ENDING_DELIMITER).toString(); + } else { + return this.column; + } + } + + public String getAliasedEscapedColumnName() { + return this.getEscapedColumnName(); + } + } } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomCommandBlobMapper.java b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomCommandBlobMapper.java index 650c008a4c..2758086c26 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomCommandBlobMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomCommandBlobMapper.java @@ -31,4 +31,8 @@ public interface UiCustomCommandBlobMapper { int updateByPrimaryKeySelective(UiCustomCommandBlob record); int updateByPrimaryKeyWithBLOBs(UiCustomCommandBlob record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") UiCustomCommandBlob.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomCommandBlobMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomCommandBlobMapper.xml index 402d52dde7..650be0502a 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomCommandBlobMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomCommandBlobMapper.xml @@ -208,4 +208,36 @@ command_view_struct = #{commandViewStruct,jdbcType=LONGVARBINARY} where id = #{id,jdbcType=VARCHAR} + + insert into ui_custom_command_blob + (id, scenario_definition, command_view_struct) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.scenarioDefinition,jdbcType=LONGVARBINARY}, + #{item.commandViewStruct,jdbcType=LONGVARBINARY}) + + + + insert into ui_custom_command_blob ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.scenarioDefinition,jdbcType=LONGVARBINARY} + + + #{item.commandViewStruct,jdbcType=LONGVARBINARY} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomCommandMapper.java b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomCommandMapper.java index 4074b1fa7a..27bbb3bc95 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomCommandMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomCommandMapper.java @@ -27,4 +27,8 @@ public interface UiCustomCommandMapper { int updateByPrimaryKeySelective(UiCustomCommand record); int updateByPrimaryKey(UiCustomCommand record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") UiCustomCommand.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomCommandMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomCommandMapper.xml index 7384024dce..625f5c8be6 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomCommandMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomCommandMapper.xml @@ -492,4 +492,104 @@ description = #{description,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into ui_custom_command + (id, project_id, tags, module_id, module_path, `name`, `level`, `status`, principal, + create_time, update_time, last_result, num, deleted, custom_num, create_user, delete_time, + delete_user, pos, version_id, ref_id, latest, description) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}, #{item.tags,jdbcType=VARCHAR}, + #{item.moduleId,jdbcType=VARCHAR}, #{item.modulePath,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, + #{item.level,jdbcType=VARCHAR}, #{item.status,jdbcType=VARCHAR}, #{item.principal,jdbcType=VARCHAR}, + #{item.createTime,jdbcType=BIGINT}, #{item.updateTime,jdbcType=BIGINT}, #{item.lastResult,jdbcType=VARCHAR}, + #{item.num,jdbcType=INTEGER}, #{item.deleted,jdbcType=BIT}, #{item.customNum,jdbcType=VARCHAR}, + #{item.createUser,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=BIGINT}, #{item.deleteUser,jdbcType=VARCHAR}, + #{item.pos,jdbcType=BIGINT}, #{item.versionId,jdbcType=VARCHAR}, #{item.refId,jdbcType=VARCHAR}, + #{item.latest,jdbcType=BIT}, #{item.description,jdbcType=VARCHAR}) + + + + insert into ui_custom_command ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.projectId,jdbcType=VARCHAR} + + + #{item.tags,jdbcType=VARCHAR} + + + #{item.moduleId,jdbcType=VARCHAR} + + + #{item.modulePath,jdbcType=VARCHAR} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.level,jdbcType=VARCHAR} + + + #{item.status,jdbcType=VARCHAR} + + + #{item.principal,jdbcType=VARCHAR} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.updateTime,jdbcType=BIGINT} + + + #{item.lastResult,jdbcType=VARCHAR} + + + #{item.num,jdbcType=INTEGER} + + + #{item.deleted,jdbcType=BIT} + + + #{item.customNum,jdbcType=VARCHAR} + + + #{item.createUser,jdbcType=VARCHAR} + + + #{item.deleteTime,jdbcType=BIGINT} + + + #{item.deleteUser,jdbcType=VARCHAR} + + + #{item.pos,jdbcType=BIGINT} + + + #{item.versionId,jdbcType=VARCHAR} + + + #{item.refId,jdbcType=VARCHAR} + + + #{item.latest,jdbcType=BIT} + + + #{item.description,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomCommandModuleMapper.java b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomCommandModuleMapper.java index 2f5b1cfb58..78cf1cdacf 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomCommandModuleMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomCommandModuleMapper.java @@ -27,4 +27,8 @@ public interface UiCustomCommandModuleMapper { int updateByPrimaryKeySelective(UiCustomCommandModule record); int updateByPrimaryKey(UiCustomCommandModule record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") UiCustomCommandModule.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomCommandModuleMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomCommandModuleMapper.xml index 350bfee7f1..625d40e08f 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomCommandModuleMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiCustomCommandModuleMapper.xml @@ -272,4 +272,57 @@ create_user = #{createUser,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into ui_custom_command_module + (id, project_id, `name`, parent_id, `level`, create_time, update_time, pos, create_user + ) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, + #{item.parentId,jdbcType=VARCHAR}, #{item.level,jdbcType=INTEGER}, #{item.createTime,jdbcType=BIGINT}, + #{item.updateTime,jdbcType=BIGINT}, #{item.pos,jdbcType=DOUBLE}, #{item.createUser,jdbcType=VARCHAR} + ) + + + + insert into ui_custom_command_module ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.projectId,jdbcType=VARCHAR} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.parentId,jdbcType=VARCHAR} + + + #{item.level,jdbcType=INTEGER} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.updateTime,jdbcType=BIGINT} + + + #{item.pos,jdbcType=DOUBLE} + + + #{item.createUser,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementCommandReferenceMapper.java b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementCommandReferenceMapper.java index 4e9ff4f95d..4ece5af1c0 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementCommandReferenceMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementCommandReferenceMapper.java @@ -27,4 +27,8 @@ public interface UiElementCommandReferenceMapper { int updateByPrimaryKeySelective(UiElementCommandReference record); int updateByPrimaryKey(UiElementCommandReference record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") UiElementCommandReference.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementCommandReferenceMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementCommandReferenceMapper.xml index be5c4b05b5..b1bd68469a 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementCommandReferenceMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementCommandReferenceMapper.xml @@ -208,4 +208,42 @@ project_id = #{projectId,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into ui_element_command_reference + (id, element_id, element_module_id, command_id, project_id) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.elementId,jdbcType=VARCHAR}, #{item.elementModuleId,jdbcType=VARCHAR}, + #{item.commandId,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}) + + + + insert into ui_element_command_reference ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.elementId,jdbcType=VARCHAR} + + + #{item.elementModuleId,jdbcType=VARCHAR} + + + #{item.commandId,jdbcType=VARCHAR} + + + #{item.projectId,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementMapper.java b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementMapper.java index 6340d12296..11e290d465 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementMapper.java @@ -27,4 +27,8 @@ public interface UiElementMapper { int updateByPrimaryKeySelective(UiElement record); int updateByPrimaryKey(UiElement record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") UiElement.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementMapper.xml index fbca13bb79..aa76500a9b 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementMapper.xml @@ -382,4 +382,81 @@ update_time = #{updateTime,jdbcType=BIGINT} where id = #{id,jdbcType=VARCHAR} + + insert into ui_element + (id, num, module_id, project_id, `name`, location_type, `location`, create_user, + update_user, version_id, ref_id, pos, latest, description, create_time, update_time + ) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.num,jdbcType=INTEGER}, #{item.moduleId,jdbcType=VARCHAR}, + #{item.projectId,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.locationType,jdbcType=VARCHAR}, + #{item.location,jdbcType=VARCHAR}, #{item.createUser,jdbcType=VARCHAR}, #{item.updateUser,jdbcType=VARCHAR}, + #{item.versionId,jdbcType=VARCHAR}, #{item.refId,jdbcType=VARCHAR}, #{item.pos,jdbcType=BIGINT}, + #{item.latest,jdbcType=BIT}, #{item.description,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, + #{item.updateTime,jdbcType=BIGINT}) + + + + insert into ui_element ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.num,jdbcType=INTEGER} + + + #{item.moduleId,jdbcType=VARCHAR} + + + #{item.projectId,jdbcType=VARCHAR} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.locationType,jdbcType=VARCHAR} + + + #{item.location,jdbcType=VARCHAR} + + + #{item.createUser,jdbcType=VARCHAR} + + + #{item.updateUser,jdbcType=VARCHAR} + + + #{item.versionId,jdbcType=VARCHAR} + + + #{item.refId,jdbcType=VARCHAR} + + + #{item.pos,jdbcType=BIGINT} + + + #{item.latest,jdbcType=BIT} + + + #{item.description,jdbcType=VARCHAR} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.updateTime,jdbcType=BIGINT} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementModuleMapper.java b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementModuleMapper.java index a7ee820552..54cf2cf141 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementModuleMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementModuleMapper.java @@ -27,4 +27,8 @@ public interface UiElementModuleMapper { int updateByPrimaryKeySelective(UiElementModule record); int updateByPrimaryKey(UiElementModule record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") UiElementModule.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementModuleMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementModuleMapper.xml index 0647c343e0..8ac45b9fec 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementModuleMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementModuleMapper.xml @@ -272,4 +272,57 @@ create_user = #{createUser,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into ui_element_module + (id, project_id, `name`, parent_id, `level`, create_time, update_time, pos, create_user + ) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, + #{item.parentId,jdbcType=VARCHAR}, #{item.level,jdbcType=INTEGER}, #{item.createTime,jdbcType=BIGINT}, + #{item.updateTime,jdbcType=BIGINT}, #{item.pos,jdbcType=DOUBLE}, #{item.createUser,jdbcType=VARCHAR} + ) + + + + insert into ui_element_module ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.projectId,jdbcType=VARCHAR} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.parentId,jdbcType=VARCHAR} + + + #{item.level,jdbcType=INTEGER} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.updateTime,jdbcType=BIGINT} + + + #{item.pos,jdbcType=DOUBLE} + + + #{item.createUser,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementScenarioReferenceMapper.java b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementScenarioReferenceMapper.java index b2756aef4d..e7fbb2bb35 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementScenarioReferenceMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementScenarioReferenceMapper.java @@ -27,4 +27,8 @@ public interface UiElementScenarioReferenceMapper { int updateByPrimaryKeySelective(UiElementScenarioReference record); int updateByPrimaryKey(UiElementScenarioReference record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") UiElementScenarioReference.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementScenarioReferenceMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementScenarioReferenceMapper.xml index aae581f26d..effe18d538 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementScenarioReferenceMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiElementScenarioReferenceMapper.xml @@ -208,4 +208,42 @@ project_id = #{projectId,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into ui_element_scenario_reference + (id, element_id, element_module_id, scenario_id, project_id) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.elementId,jdbcType=VARCHAR}, #{item.elementModuleId,jdbcType=VARCHAR}, + #{item.scenarioId,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}) + + + + insert into ui_element_scenario_reference ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.elementId,jdbcType=VARCHAR} + + + #{item.elementModuleId,jdbcType=VARCHAR} + + + #{item.scenarioId,jdbcType=VARCHAR} + + + #{item.projectId,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioBlobMapper.java b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioBlobMapper.java index 6f3579249d..3a5cf44bda 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioBlobMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioBlobMapper.java @@ -31,4 +31,8 @@ public interface UiScenarioBlobMapper { int updateByPrimaryKeySelective(UiScenarioBlob record); int updateByPrimaryKeyWithBLOBs(UiScenarioBlob record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") UiScenarioBlob.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioBlobMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioBlobMapper.xml index 1268d16a30..c9411d4cfc 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioBlobMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioBlobMapper.xml @@ -208,4 +208,36 @@ environment_json = #{environmentJson,jdbcType=LONGVARBINARY} where id = #{id,jdbcType=VARCHAR} + + insert into ui_scenario_blob + (id, scenario_definition, environment_json) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.scenarioDefinition,jdbcType=LONGVARBINARY}, + #{item.environmentJson,jdbcType=LONGVARBINARY}) + + + + insert into ui_scenario_blob ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.scenarioDefinition,jdbcType=LONGVARBINARY} + + + #{item.environmentJson,jdbcType=LONGVARBINARY} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioFollowerMapper.java b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioFollowerMapper.java index 54f92e256d..cd6202e3f1 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioFollowerMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioFollowerMapper.java @@ -21,4 +21,8 @@ public interface UiScenarioFollowerMapper { int updateByExampleSelective(@Param("record") UiScenarioFollower record, @Param("example") UiScenarioFollowerExample example); int updateByExample(@Param("record") UiScenarioFollower record, @Param("example") UiScenarioFollowerExample example); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") UiScenarioFollower.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioFollowerMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioFollowerMapper.xml index 02deae6d8c..e377f48c3c 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioFollowerMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioFollowerMapper.xml @@ -142,4 +142,32 @@ + + insert into ui_scenario_follower + (scenario_id, user_id) + values + + (#{item.scenarioId,jdbcType=VARCHAR}, #{item.userId,jdbcType=VARCHAR}) + + + + insert into ui_scenario_follower ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.scenarioId,jdbcType=VARCHAR} + + + #{item.userId,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioMapper.java b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioMapper.java index 4e80892882..f1ba903c27 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioMapper.java @@ -27,4 +27,8 @@ public interface UiScenarioMapper { int updateByPrimaryKeySelective(UiScenario record); int updateByPrimaryKey(UiScenario record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") UiScenario.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioMapper.xml index 9af427d9ae..76544a19ab 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioMapper.xml @@ -509,4 +509,108 @@ description = #{description,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into ui_scenario + (id, project_id, tags, module_id, `name`, `level`, `status`, principal, step_total, + create_time, update_time, last_result, report_id, num, deleted, custom_num, create_user, + delete_time, delete_user, pos, version_id, ref_id, latest, description) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}, #{item.tags,jdbcType=VARCHAR}, + #{item.moduleId,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, #{item.level,jdbcType=VARCHAR}, + #{item.status,jdbcType=VARCHAR}, #{item.principal,jdbcType=VARCHAR}, #{item.stepTotal,jdbcType=INTEGER}, + #{item.createTime,jdbcType=BIGINT}, #{item.updateTime,jdbcType=BIGINT}, #{item.lastResult,jdbcType=VARCHAR}, + #{item.reportId,jdbcType=VARCHAR}, #{item.num,jdbcType=INTEGER}, #{item.deleted,jdbcType=BIT}, + #{item.customNum,jdbcType=VARCHAR}, #{item.createUser,jdbcType=VARCHAR}, #{item.deleteTime,jdbcType=BIGINT}, + #{item.deleteUser,jdbcType=VARCHAR}, #{item.pos,jdbcType=BIGINT}, #{item.versionId,jdbcType=VARCHAR}, + #{item.refId,jdbcType=VARCHAR}, #{item.latest,jdbcType=BIT}, #{item.description,jdbcType=VARCHAR} + ) + + + + insert into ui_scenario ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.projectId,jdbcType=VARCHAR} + + + #{item.tags,jdbcType=VARCHAR} + + + #{item.moduleId,jdbcType=VARCHAR} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.level,jdbcType=VARCHAR} + + + #{item.status,jdbcType=VARCHAR} + + + #{item.principal,jdbcType=VARCHAR} + + + #{item.stepTotal,jdbcType=INTEGER} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.updateTime,jdbcType=BIGINT} + + + #{item.lastResult,jdbcType=VARCHAR} + + + #{item.reportId,jdbcType=VARCHAR} + + + #{item.num,jdbcType=INTEGER} + + + #{item.deleted,jdbcType=BIT} + + + #{item.customNum,jdbcType=VARCHAR} + + + #{item.createUser,jdbcType=VARCHAR} + + + #{item.deleteTime,jdbcType=BIGINT} + + + #{item.deleteUser,jdbcType=VARCHAR} + + + #{item.pos,jdbcType=BIGINT} + + + #{item.versionId,jdbcType=VARCHAR} + + + #{item.refId,jdbcType=VARCHAR} + + + #{item.latest,jdbcType=BIT} + + + #{item.description,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioModuleMapper.java b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioModuleMapper.java index 88569b2277..cfee0ff5ca 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioModuleMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioModuleMapper.java @@ -27,4 +27,8 @@ public interface UiScenarioModuleMapper { int updateByPrimaryKeySelective(UiScenarioModule record); int updateByPrimaryKey(UiScenarioModule record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") UiScenarioModule.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioModuleMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioModuleMapper.xml index 1b36010b6d..e61b07be11 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioModuleMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioModuleMapper.xml @@ -272,4 +272,57 @@ create_user = #{createUser,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into ui_scenario_module + (id, project_id, `name`, parent_id, `level`, create_time, update_time, pos, create_user + ) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, + #{item.parentId,jdbcType=VARCHAR}, #{item.level,jdbcType=INTEGER}, #{item.createTime,jdbcType=BIGINT}, + #{item.updateTime,jdbcType=BIGINT}, #{item.pos,jdbcType=DOUBLE}, #{item.createUser,jdbcType=VARCHAR} + ) + + + + insert into ui_scenario_module ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.projectId,jdbcType=VARCHAR} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.parentId,jdbcType=VARCHAR} + + + #{item.level,jdbcType=INTEGER} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.updateTime,jdbcType=BIGINT} + + + #{item.pos,jdbcType=DOUBLE} + + + #{item.createUser,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReferenceMapper.java b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReferenceMapper.java index 598c07c28a..e4a287ffc9 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReferenceMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReferenceMapper.java @@ -27,4 +27,8 @@ public interface UiScenarioReferenceMapper { int updateByPrimaryKeySelective(UiScenarioReference record); int updateByPrimaryKey(UiScenarioReference record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") UiScenarioReference.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReferenceMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReferenceMapper.xml index 2e892a77aa..e1018eb628 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReferenceMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReferenceMapper.xml @@ -225,4 +225,46 @@ data_type = #{dataType,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into ui_scenario_reference + (id, ui_scenario_id, create_time, create_user, reference_id, data_type) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.uiScenarioId,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, + #{item.createUser,jdbcType=VARCHAR}, #{item.referenceId,jdbcType=VARCHAR}, #{item.dataType,jdbcType=VARCHAR} + ) + + + + insert into ui_scenario_reference ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.uiScenarioId,jdbcType=VARCHAR} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.createUser,jdbcType=VARCHAR} + + + #{item.referenceId,jdbcType=VARCHAR} + + + #{item.dataType,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportDetailMapper.java b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportDetailMapper.java index 2088dda91a..1e107be44f 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportDetailMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportDetailMapper.java @@ -33,4 +33,8 @@ public interface UiScenarioReportDetailMapper { int updateByPrimaryKeyWithBLOBs(UiScenarioReportDetail record); int updateByPrimaryKey(UiScenarioReportDetail record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") UiScenarioReportDetail.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportDetailMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportDetailMapper.xml index d5f6665a01..e3d0edf5bc 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportDetailMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportDetailMapper.xml @@ -336,4 +336,61 @@ pass_assertions = #{passAssertions,jdbcType=BIGINT} where id = #{id,jdbcType=VARCHAR} + + insert into ui_scenario_report_detail + (id, resource_id, report_id, create_time, `status`, request_time, total_assertions, + pass_assertions, content, base_info) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.resourceId,jdbcType=VARCHAR}, #{item.reportId,jdbcType=VARCHAR}, + #{item.createTime,jdbcType=BIGINT}, #{item.status,jdbcType=VARCHAR}, #{item.requestTime,jdbcType=BIGINT}, + #{item.totalAssertions,jdbcType=BIGINT}, #{item.passAssertions,jdbcType=BIGINT}, + #{item.content,jdbcType=LONGVARBINARY}, #{item.baseInfo,jdbcType=LONGVARBINARY} + ) + + + + insert into ui_scenario_report_detail ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.resourceId,jdbcType=VARCHAR} + + + #{item.reportId,jdbcType=VARCHAR} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.status,jdbcType=VARCHAR} + + + #{item.requestTime,jdbcType=BIGINT} + + + #{item.totalAssertions,jdbcType=BIGINT} + + + #{item.passAssertions,jdbcType=BIGINT} + + + #{item.content,jdbcType=LONGVARBINARY} + + + #{item.baseInfo,jdbcType=LONGVARBINARY} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportEnvironmentMapper.java b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportEnvironmentMapper.java index 7bcbab9398..53ae2a5ce0 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportEnvironmentMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportEnvironmentMapper.java @@ -27,4 +27,8 @@ public interface UiScenarioReportEnvironmentMapper { int updateByPrimaryKeySelective(UiScenarioReportEnvironment record); int updateByPrimaryKey(UiScenarioReportEnvironment record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") UiScenarioReportEnvironment.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportEnvironmentMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportEnvironmentMapper.xml index 30d0719b25..a7f99433d9 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportEnvironmentMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportEnvironmentMapper.xml @@ -178,4 +178,36 @@ environment_id = #{environmentId,jdbcType=VARCHAR} where report_id = #{reportId,jdbcType=VARCHAR} + + insert into ui_scenario_report_environment + (report_id, project_id, environment_id) + values + + (#{item.reportId,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}, #{item.environmentId,jdbcType=VARCHAR} + ) + + + + insert into ui_scenario_report_environment ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.reportId,jdbcType=VARCHAR} + + + #{item.projectId,jdbcType=VARCHAR} + + + #{item.environmentId,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportLogMapper.java b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportLogMapper.java index ac7a1c8ddb..aa78a60dc9 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportLogMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportLogMapper.java @@ -33,4 +33,8 @@ public interface UiScenarioReportLogMapper { int updateByPrimaryKeyWithBLOBs(UiScenarioReportLog record); int updateByPrimaryKey(UiScenarioReportLog record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") UiScenarioReportLog.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportLogMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportLogMapper.xml index b79a5c0393..8da3667607 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportLogMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportLogMapper.xml @@ -231,4 +231,39 @@ create_time = #{createTime,jdbcType=BIGINT} where id = #{id,jdbcType=VARCHAR} + + insert into ui_scenario_report_log + (id, report_id, create_time, console) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.reportId,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, + #{item.console,jdbcType=LONGVARBINARY}) + + + + insert into ui_scenario_report_log ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.reportId,jdbcType=VARCHAR} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.console,jdbcType=LONGVARBINARY} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportMapper.java b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportMapper.java index b6991cd000..b4bcf41269 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportMapper.java @@ -27,4 +27,8 @@ public interface UiScenarioReportMapper { int updateByPrimaryKeySelective(UiScenarioReport record); int updateByPrimaryKey(UiScenarioReport record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") UiScenarioReport.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportMapper.xml index b81403e7ab..7cd11a00ce 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportMapper.xml @@ -17,6 +17,7 @@ + @@ -78,7 +79,8 @@ id, project_id, `name`, create_time, update_time, `status`, trigger_mode, execute_type, - scenario_name, scenario_id, create_user, pool_id, end_time, integrated, relevance_test_plan_report_id + scenario_name, scenario_id, create_user, pool_id, end_time, integrated, relevance_test_plan_report_id, + report_source @@ -275,6 +283,9 @@ relevance_test_plan_report_id = #{record.relevanceTestPlanReportId,jdbcType=VARCHAR}, + + report_source = #{record.reportSource,jdbcType=VARCHAR}, + @@ -296,7 +307,8 @@ pool_id = #{record.poolId,jdbcType=VARCHAR}, end_time = #{record.endTime,jdbcType=BIGINT}, integrated = #{record.integrated,jdbcType=BIT}, - relevance_test_plan_report_id = #{record.relevanceTestPlanReportId,jdbcType=VARCHAR} + relevance_test_plan_report_id = #{record.relevanceTestPlanReportId,jdbcType=VARCHAR}, + report_source = #{record.reportSource,jdbcType=VARCHAR} @@ -346,6 +358,9 @@ relevance_test_plan_report_id = #{relevanceTestPlanReportId,jdbcType=VARCHAR}, + + report_source = #{reportSource,jdbcType=VARCHAR}, + where id = #{id,jdbcType=VARCHAR} @@ -364,7 +379,85 @@ pool_id = #{poolId,jdbcType=VARCHAR}, end_time = #{endTime,jdbcType=BIGINT}, integrated = #{integrated,jdbcType=BIT}, - relevance_test_plan_report_id = #{relevanceTestPlanReportId,jdbcType=VARCHAR} + relevance_test_plan_report_id = #{relevanceTestPlanReportId,jdbcType=VARCHAR}, + report_source = #{reportSource,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} + + insert into ui_scenario_report + (id, project_id, `name`, create_time, update_time, `status`, trigger_mode, execute_type, + scenario_name, scenario_id, create_user, pool_id, end_time, integrated, relevance_test_plan_report_id, + report_source) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.projectId,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}, + #{item.createTime,jdbcType=BIGINT}, #{item.updateTime,jdbcType=BIGINT}, #{item.status,jdbcType=VARCHAR}, + #{item.triggerMode,jdbcType=VARCHAR}, #{item.executeType,jdbcType=VARCHAR}, #{item.scenarioName,jdbcType=VARCHAR}, + #{item.scenarioId,jdbcType=VARCHAR}, #{item.createUser,jdbcType=VARCHAR}, #{item.poolId,jdbcType=VARCHAR}, + #{item.endTime,jdbcType=BIGINT}, #{item.integrated,jdbcType=BIT}, #{item.relevanceTestPlanReportId,jdbcType=VARCHAR}, + #{item.reportSource,jdbcType=VARCHAR}) + + + + insert into ui_scenario_report ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.projectId,jdbcType=VARCHAR} + + + #{item.name,jdbcType=VARCHAR} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.updateTime,jdbcType=BIGINT} + + + #{item.status,jdbcType=VARCHAR} + + + #{item.triggerMode,jdbcType=VARCHAR} + + + #{item.executeType,jdbcType=VARCHAR} + + + #{item.scenarioName,jdbcType=VARCHAR} + + + #{item.scenarioId,jdbcType=VARCHAR} + + + #{item.createUser,jdbcType=VARCHAR} + + + #{item.poolId,jdbcType=VARCHAR} + + + #{item.endTime,jdbcType=BIGINT} + + + #{item.integrated,jdbcType=BIT} + + + #{item.relevanceTestPlanReportId,jdbcType=VARCHAR} + + + #{item.reportSource,jdbcType=VARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportStructureMapper.java b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportStructureMapper.java index 1c947716a3..f9a7edf4ee 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportStructureMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportStructureMapper.java @@ -33,4 +33,8 @@ public interface UiScenarioReportStructureMapper { int updateByPrimaryKeyWithBLOBs(UiScenarioReportStructure record); int updateByPrimaryKey(UiScenarioReportStructure record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") UiScenarioReportStructure.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportStructureMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportStructureMapper.xml index 4764686c74..191b73db03 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportStructureMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/ui/mapper/UiScenarioReportStructureMapper.xml @@ -231,4 +231,39 @@ create_time = #{createTime,jdbcType=BIGINT} where id = #{id,jdbcType=VARCHAR} + + insert into ui_scenario_report_structure + (id, report_id, create_time, resource_tree) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.reportId,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, + #{item.resourceTree,jdbcType=LONGVARBINARY}) + + + + insert into ui_scenario_report_structure ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.reportId,jdbcType=VARCHAR} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.resourceTree,jdbcType=LONGVARBINARY} + + + ) + + \ No newline at end of file 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 84a351f3cf..088d24abda 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 @@ -32,7 +32,6 @@ CREATE TABLE IF NOT EXISTS user_role `update_time` BIGINT NOT NULL COMMENT '更新时间', `create_user` VARCHAR(50) NOT NULL COMMENT '创建人(操作人)', `scope_id` VARCHAR(50) NOT NULL COMMENT '应用范围', - `pos` BIGINT NOT NULL DEFAULT 0 COMMENT '自定义排序,间隔5000' , PRIMARY KEY (id) ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 diff --git a/backend/framework/sdk/src/main/resources/sdkGeneratorConfig.xml b/backend/framework/sdk/src/main/resources/sdkGeneratorConfig.xml index bdb030559d..bf6bf45b1b 100644 --- a/backend/framework/sdk/src/main/resources/sdkGeneratorConfig.xml +++ b/backend/framework/sdk/src/main/resources/sdkGeneratorConfig.xml @@ -17,6 +17,8 @@ + + diff --git a/backend/services/api-test/src/main/resources/apiGeneratorConfig.xml b/backend/services/api-test/src/main/resources/apiGeneratorConfig.xml index c3522dda48..b1203d74ce 100644 --- a/backend/services/api-test/src/main/resources/apiGeneratorConfig.xml +++ b/backend/services/api-test/src/main/resources/apiGeneratorConfig.xml @@ -17,6 +17,8 @@ + + diff --git a/backend/services/bug-management/src/main/resources/bugGeneratorConfig.xml b/backend/services/bug-management/src/main/resources/bugGeneratorConfig.xml index 2cd5ce5dc2..2157086a5f 100644 --- a/backend/services/bug-management/src/main/resources/bugGeneratorConfig.xml +++ b/backend/services/bug-management/src/main/resources/bugGeneratorConfig.xml @@ -17,6 +17,8 @@ + + diff --git a/backend/services/case-management/pom.xml b/backend/services/case-management/pom.xml index aad51586ee..730502da82 100644 --- a/backend/services/case-management/pom.xml +++ b/backend/services/case-management/pom.xml @@ -30,7 +30,7 @@ true true - src/main/resources/apiGeneratorConfig.xml + src/main/resources/functionalGeneratorConfig.xml diff --git a/backend/services/case-management/src/main/resources/functionalGeneratorConfig.xml b/backend/services/case-management/src/main/resources/functionalGeneratorConfig.xml index bec53f5835..3e03f2da4e 100644 --- a/backend/services/case-management/src/main/resources/functionalGeneratorConfig.xml +++ b/backend/services/case-management/src/main/resources/functionalGeneratorConfig.xml @@ -17,6 +17,8 @@ + + diff --git a/backend/services/load-test/src/main/resources/loadGeneratorConfig.xml b/backend/services/load-test/src/main/resources/loadGeneratorConfig.xml index 05fe8eef57..0ac27e1503 100644 --- a/backend/services/load-test/src/main/resources/loadGeneratorConfig.xml +++ b/backend/services/load-test/src/main/resources/loadGeneratorConfig.xml @@ -17,6 +17,8 @@ + + diff --git a/backend/services/project-management/src/main/resources/projectGeneratorConfig.xml b/backend/services/project-management/src/main/resources/projectGeneratorConfig.xml index d4494548fa..f07911757f 100644 --- a/backend/services/project-management/src/main/resources/projectGeneratorConfig.xml +++ b/backend/services/project-management/src/main/resources/projectGeneratorConfig.xml @@ -17,6 +17,8 @@ + + diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/service/SystemProjectService.java b/backend/services/system-setting/src/main/java/io/metersphere/system/service/SystemProjectService.java index a369ca2338..6e06a3693d 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/service/SystemProjectService.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/service/SystemProjectService.java @@ -221,13 +221,13 @@ public class SystemProjectService { userRoleRelationExample.createCriteria().andUserIdEqualTo(userId) .andSourceIdEqualTo(projectId).andRoleIdEqualTo(InternalUserRole.PROJECT_MEMBER.getValue()); if (userRoleRelationMapper.selectByExample(userRoleRelationExample).size() == 0) { - UserRoleRelation adminRole = new UserRoleRelation( - UUID.randomUUID().toString(), - userId, - InternalUserRole.PROJECT_ADMIN.getValue(), - projectId, - System.currentTimeMillis(), - createUser); + UserRoleRelation adminRole = new UserRoleRelation(); + adminRole.setId(UUID.randomUUID().toString()); + adminRole.setUserId(userId); + adminRole.setRoleId(InternalUserRole.PROJECT_ADMIN.getValue()); + adminRole.setSourceId(projectId); + adminRole.setCreateTime(System.currentTimeMillis()); + adminRole.setCreateUser(createUser); batchMapper.insert(adminRole); setLog(projectId, path, content + Translator.get("project_admin") + ": " + user.getName(), createUser, "", type, method, logDTOList); } @@ -236,13 +236,13 @@ public class SystemProjectService { userRoleRelationExample.createCriteria().andUserIdEqualTo(userId) .andSourceIdEqualTo(projectId).andRoleIdEqualTo(InternalUserRole.PROJECT_MEMBER.getValue()); if (userRoleRelationMapper.selectByExample(userRoleRelationExample).size() == 0) { - UserRoleRelation memberRole = new UserRoleRelation( - UUID.randomUUID().toString(), - userId, - InternalUserRole.PROJECT_MEMBER.getValue(), - projectId, - System.currentTimeMillis(), - createUser); + UserRoleRelation memberRole = new UserRoleRelation(); + memberRole.setId(UUID.randomUUID().toString()); + memberRole.setUserId(userId); + memberRole.setRoleId(InternalUserRole.PROJECT_MEMBER.getValue()); + memberRole.setSourceId(projectId); + memberRole.setCreateTime(System.currentTimeMillis()); + memberRole.setCreateUser(createUser); batchMapper.insert(memberRole); setLog(projectId, path, content + Translator.get("project_member") + ": " + user.getName(), createUser, "", type, method, logDTOList); } diff --git a/backend/services/system-setting/src/main/resources/systemGeneratorConfig.xml b/backend/services/system-setting/src/main/resources/systemGeneratorConfig.xml index 57f952e638..088b64a1ca 100644 --- a/backend/services/system-setting/src/main/resources/systemGeneratorConfig.xml +++ b/backend/services/system-setting/src/main/resources/systemGeneratorConfig.xml @@ -17,6 +17,8 @@ + + @@ -33,7 +35,6 @@ - diff --git a/backend/services/ui-test/src/main/resources/uiGeneratorConfig.xml b/backend/services/ui-test/src/main/resources/uiGeneratorConfig.xml index d8707ce86f..d8be0949a3 100644 --- a/backend/services/ui-test/src/main/resources/uiGeneratorConfig.xml +++ b/backend/services/ui-test/src/main/resources/uiGeneratorConfig.xml @@ -17,6 +17,8 @@ + +