diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileMetadataRepository.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileMetadataRepository.java index cb7ed9b3b8..9dafafed5a 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileMetadataRepository.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileMetadataRepository.java @@ -10,19 +10,41 @@ import lombok.Data; @Data public class FileMetadataRepository implements Serializable { - @Schema(title = "文件ID", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{file_metadata_repository.id.not_blank}", groups = {Updated.class}) - @Size(min = 1, max = 50, message = "{file_metadata_repository.id.length_range}", groups = {Created.class, Updated.class}) - private String id; + @Schema(description = "文件ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{file_metadata_repository.file_metadata_id.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{file_metadata_repository.file_metadata_id.length_range}", groups = {Created.class, Updated.class}) + private String fileMetadataId; - @Schema(title = "储存库") - private byte[] gitInfo; + @Schema(description = "分支", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{file_metadata_repository.branch.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 255, message = "{file_metadata_repository.branch.length_range}", groups = {Created.class, Updated.class}) + private String branch; + + @Schema(description = "存储库地址", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{file_metadata_repository.repository_url.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 255, message = "{file_metadata_repository.repository_url.length_range}", groups = {Created.class, Updated.class}) + private String repositoryUrl; + + @Schema(description = "token", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{file_metadata_repository.token.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 1000, message = "{file_metadata_repository.token.length_range}", groups = {Created.class, Updated.class}) + private String token; + + @Schema(description = "提交ID") + private String commitId; + + @Schema(description = "提交信息") + private String commitMessage; private static final long serialVersionUID = 1L; public enum Column { - id("id", "id", "VARCHAR", false), - gitInfo("git_info", "gitInfo", "LONGVARBINARY", false); + fileMetadataId("file_metadata_id", "fileMetadataId", "VARCHAR", false), + branch("branch", "branch", "VARCHAR", false), + repositoryUrl("repository_url", "repositoryUrl", "VARCHAR", false), + token("token", "token", "VARCHAR", false), + commitId("commit_id", "commitId", "VARCHAR", false), + commitMessage("commit_message", "commitMessage", "LONGVARCHAR", false); private static final String BEGINNING_DELIMITER = "`"; diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileMetadataRepositoryExample.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileMetadataRepositoryExample.java index 29ece574c5..b04874843c 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileMetadataRepositoryExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileMetadataRepositoryExample.java @@ -104,73 +104,353 @@ public class FileMetadataRepositoryExample { criteria.add(new Criterion(condition, value1, value2)); } - public Criteria andIdIsNull() { - addCriterion("id is null"); + public Criteria andFileMetadataIdIsNull() { + addCriterion("file_metadata_id is null"); return (Criteria) this; } - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); + public Criteria andFileMetadataIdIsNotNull() { + addCriterion("file_metadata_id is not null"); return (Criteria) this; } - public Criteria andIdEqualTo(String value) { - addCriterion("id =", value, "id"); + public Criteria andFileMetadataIdEqualTo(String value) { + addCriterion("file_metadata_id =", value, "fileMetadataId"); return (Criteria) this; } - public Criteria andIdNotEqualTo(String value) { - addCriterion("id <>", value, "id"); + public Criteria andFileMetadataIdNotEqualTo(String value) { + addCriterion("file_metadata_id <>", value, "fileMetadataId"); return (Criteria) this; } - public Criteria andIdGreaterThan(String value) { - addCriterion("id >", value, "id"); + public Criteria andFileMetadataIdGreaterThan(String value) { + addCriterion("file_metadata_id >", value, "fileMetadataId"); return (Criteria) this; } - public Criteria andIdGreaterThanOrEqualTo(String value) { - addCriterion("id >=", value, "id"); + public Criteria andFileMetadataIdGreaterThanOrEqualTo(String value) { + addCriterion("file_metadata_id >=", value, "fileMetadataId"); return (Criteria) this; } - public Criteria andIdLessThan(String value) { - addCriterion("id <", value, "id"); + public Criteria andFileMetadataIdLessThan(String value) { + addCriterion("file_metadata_id <", value, "fileMetadataId"); return (Criteria) this; } - public Criteria andIdLessThanOrEqualTo(String value) { - addCriterion("id <=", value, "id"); + public Criteria andFileMetadataIdLessThanOrEqualTo(String value) { + addCriterion("file_metadata_id <=", value, "fileMetadataId"); return (Criteria) this; } - public Criteria andIdLike(String value) { - addCriterion("id like", value, "id"); + public Criteria andFileMetadataIdLike(String value) { + addCriterion("file_metadata_id like", value, "fileMetadataId"); return (Criteria) this; } - public Criteria andIdNotLike(String value) { - addCriterion("id not like", value, "id"); + public Criteria andFileMetadataIdNotLike(String value) { + addCriterion("file_metadata_id not like", value, "fileMetadataId"); return (Criteria) this; } - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); + public Criteria andFileMetadataIdIn(List values) { + addCriterion("file_metadata_id in", values, "fileMetadataId"); return (Criteria) this; } - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); + public Criteria andFileMetadataIdNotIn(List values) { + addCriterion("file_metadata_id not in", values, "fileMetadataId"); return (Criteria) this; } - public Criteria andIdBetween(String value1, String value2) { - addCriterion("id between", value1, value2, "id"); + public Criteria andFileMetadataIdBetween(String value1, String value2) { + addCriterion("file_metadata_id between", value1, value2, "fileMetadataId"); return (Criteria) this; } - public Criteria andIdNotBetween(String value1, String value2) { - addCriterion("id not between", value1, value2, "id"); + public Criteria andFileMetadataIdNotBetween(String value1, String value2) { + addCriterion("file_metadata_id not between", value1, value2, "fileMetadataId"); + return (Criteria) this; + } + + public Criteria andBranchIsNull() { + addCriterion("branch is null"); + return (Criteria) this; + } + + public Criteria andBranchIsNotNull() { + addCriterion("branch is not null"); + return (Criteria) this; + } + + public Criteria andBranchEqualTo(String value) { + addCriterion("branch =", value, "branch"); + return (Criteria) this; + } + + public Criteria andBranchNotEqualTo(String value) { + addCriterion("branch <>", value, "branch"); + return (Criteria) this; + } + + public Criteria andBranchGreaterThan(String value) { + addCriterion("branch >", value, "branch"); + return (Criteria) this; + } + + public Criteria andBranchGreaterThanOrEqualTo(String value) { + addCriterion("branch >=", value, "branch"); + return (Criteria) this; + } + + public Criteria andBranchLessThan(String value) { + addCriterion("branch <", value, "branch"); + return (Criteria) this; + } + + public Criteria andBranchLessThanOrEqualTo(String value) { + addCriterion("branch <=", value, "branch"); + return (Criteria) this; + } + + public Criteria andBranchLike(String value) { + addCriterion("branch like", value, "branch"); + return (Criteria) this; + } + + public Criteria andBranchNotLike(String value) { + addCriterion("branch not like", value, "branch"); + return (Criteria) this; + } + + public Criteria andBranchIn(List values) { + addCriterion("branch in", values, "branch"); + return (Criteria) this; + } + + public Criteria andBranchNotIn(List values) { + addCriterion("branch not in", values, "branch"); + return (Criteria) this; + } + + public Criteria andBranchBetween(String value1, String value2) { + addCriterion("branch between", value1, value2, "branch"); + return (Criteria) this; + } + + public Criteria andBranchNotBetween(String value1, String value2) { + addCriterion("branch not between", value1, value2, "branch"); + return (Criteria) this; + } + + public Criteria andRepositoryUrlIsNull() { + addCriterion("repository_url is null"); + return (Criteria) this; + } + + public Criteria andRepositoryUrlIsNotNull() { + addCriterion("repository_url is not null"); + return (Criteria) this; + } + + public Criteria andRepositoryUrlEqualTo(String value) { + addCriterion("repository_url =", value, "repositoryUrl"); + return (Criteria) this; + } + + public Criteria andRepositoryUrlNotEqualTo(String value) { + addCriterion("repository_url <>", value, "repositoryUrl"); + return (Criteria) this; + } + + public Criteria andRepositoryUrlGreaterThan(String value) { + addCriterion("repository_url >", value, "repositoryUrl"); + return (Criteria) this; + } + + public Criteria andRepositoryUrlGreaterThanOrEqualTo(String value) { + addCriterion("repository_url >=", value, "repositoryUrl"); + return (Criteria) this; + } + + public Criteria andRepositoryUrlLessThan(String value) { + addCriterion("repository_url <", value, "repositoryUrl"); + return (Criteria) this; + } + + public Criteria andRepositoryUrlLessThanOrEqualTo(String value) { + addCriterion("repository_url <=", value, "repositoryUrl"); + return (Criteria) this; + } + + public Criteria andRepositoryUrlLike(String value) { + addCriterion("repository_url like", value, "repositoryUrl"); + return (Criteria) this; + } + + public Criteria andRepositoryUrlNotLike(String value) { + addCriterion("repository_url not like", value, "repositoryUrl"); + return (Criteria) this; + } + + public Criteria andRepositoryUrlIn(List values) { + addCriterion("repository_url in", values, "repositoryUrl"); + return (Criteria) this; + } + + public Criteria andRepositoryUrlNotIn(List values) { + addCriterion("repository_url not in", values, "repositoryUrl"); + return (Criteria) this; + } + + public Criteria andRepositoryUrlBetween(String value1, String value2) { + addCriterion("repository_url between", value1, value2, "repositoryUrl"); + return (Criteria) this; + } + + public Criteria andRepositoryUrlNotBetween(String value1, String value2) { + addCriterion("repository_url not between", value1, value2, "repositoryUrl"); + return (Criteria) this; + } + + public Criteria andTokenIsNull() { + addCriterion("token is null"); + return (Criteria) this; + } + + public Criteria andTokenIsNotNull() { + addCriterion("token is not null"); + return (Criteria) this; + } + + public Criteria andTokenEqualTo(String value) { + addCriterion("token =", value, "token"); + return (Criteria) this; + } + + public Criteria andTokenNotEqualTo(String value) { + addCriterion("token <>", value, "token"); + return (Criteria) this; + } + + public Criteria andTokenGreaterThan(String value) { + addCriterion("token >", value, "token"); + return (Criteria) this; + } + + public Criteria andTokenGreaterThanOrEqualTo(String value) { + addCriterion("token >=", value, "token"); + return (Criteria) this; + } + + public Criteria andTokenLessThan(String value) { + addCriterion("token <", value, "token"); + return (Criteria) this; + } + + public Criteria andTokenLessThanOrEqualTo(String value) { + addCriterion("token <=", value, "token"); + return (Criteria) this; + } + + public Criteria andTokenLike(String value) { + addCriterion("token like", value, "token"); + return (Criteria) this; + } + + public Criteria andTokenNotLike(String value) { + addCriterion("token not like", value, "token"); + return (Criteria) this; + } + + public Criteria andTokenIn(List values) { + addCriterion("token in", values, "token"); + return (Criteria) this; + } + + public Criteria andTokenNotIn(List values) { + addCriterion("token not in", values, "token"); + return (Criteria) this; + } + + public Criteria andTokenBetween(String value1, String value2) { + addCriterion("token between", value1, value2, "token"); + return (Criteria) this; + } + + public Criteria andTokenNotBetween(String value1, String value2) { + addCriterion("token not between", value1, value2, "token"); + return (Criteria) this; + } + + public Criteria andCommitIdIsNull() { + addCriterion("commit_id is null"); + return (Criteria) this; + } + + public Criteria andCommitIdIsNotNull() { + addCriterion("commit_id is not null"); + return (Criteria) this; + } + + public Criteria andCommitIdEqualTo(String value) { + addCriterion("commit_id =", value, "commitId"); + return (Criteria) this; + } + + public Criteria andCommitIdNotEqualTo(String value) { + addCriterion("commit_id <>", value, "commitId"); + return (Criteria) this; + } + + public Criteria andCommitIdGreaterThan(String value) { + addCriterion("commit_id >", value, "commitId"); + return (Criteria) this; + } + + public Criteria andCommitIdGreaterThanOrEqualTo(String value) { + addCriterion("commit_id >=", value, "commitId"); + return (Criteria) this; + } + + public Criteria andCommitIdLessThan(String value) { + addCriterion("commit_id <", value, "commitId"); + return (Criteria) this; + } + + public Criteria andCommitIdLessThanOrEqualTo(String value) { + addCriterion("commit_id <=", value, "commitId"); + return (Criteria) this; + } + + public Criteria andCommitIdLike(String value) { + addCriterion("commit_id like", value, "commitId"); + return (Criteria) this; + } + + public Criteria andCommitIdNotLike(String value) { + addCriterion("commit_id not like", value, "commitId"); + return (Criteria) this; + } + + public Criteria andCommitIdIn(List values) { + addCriterion("commit_id in", values, "commitId"); + return (Criteria) this; + } + + public Criteria andCommitIdNotIn(List values) { + addCriterion("commit_id not in", values, "commitId"); + return (Criteria) this; + } + + public Criteria andCommitIdBetween(String value1, String value2) { + addCriterion("commit_id between", value1, value2, "commitId"); + return (Criteria) this; + } + + public Criteria andCommitIdNotBetween(String value1, String value2) { + addCriterion("commit_id not between", value1, value2, "commitId"); return (Criteria) this; } } diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModuleRepository.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModuleRepository.java index dfb8ad992c..fb1bd6f84d 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModuleRepository.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModuleRepository.java @@ -1,15 +1,12 @@ package io.metersphere.project.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 FileModuleRepository implements Serializable { @@ -18,26 +15,32 @@ public class FileModuleRepository implements Serializable { @Size(min = 1, max = 50, message = "{file_module_repository.file_module_id.length_range}", groups = {Created.class, Updated.class}) private String fileModuleId; - @Schema(description = "所属平台;GitHub/Gitlab/Gitee") + @Schema(description = "所属平台;GitHub/Gitlab/Gitee", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{file_module_repository.platform.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 10, message = "{file_module_repository.platform.length_range}", groups = {Created.class, Updated.class}) private String platform; - @Schema(description = "存储库地址") - private String repositoryPath; + @Schema(description = "存储库地址", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{file_module_repository.url.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 255, message = "{file_module_repository.url.length_range}", groups = {Created.class, Updated.class}) + private String url; - @Schema(description = "存储库Token;platform为Gitee时必填") - private String repositoryUserName; + @Schema(description = "存储库Token", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{file_module_repository.token.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 255, message = "{file_module_repository.token.length_range}", groups = {Created.class, Updated.class}) + private String token; - @Schema(description = "存储库Token") - private String repositoryToken; + @Schema(description = "用户名;platform为Gitee时必填") + private String userName; private static final long serialVersionUID = 1L; public enum Column { fileModuleId("file_module_id", "fileModuleId", "VARCHAR", false), platform("platform", "platform", "VARCHAR", false), - repositoryPath("repository_path", "repositoryPath", "VARCHAR", false), - repositoryUserName("repository_user_name", "repositoryUserName", "VARCHAR", false), - repositoryToken("repository_token", "repositoryToken", "VARCHAR", false); + url("url", "url", "VARCHAR", false), + token("token", "token", "VARCHAR", false), + userName("user_name", "userName", "VARCHAR", false); private static final String BEGINNING_DELIMITER = "`"; diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModuleRepositoryExample.java b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModuleRepositoryExample.java index f5d81aeeb0..9c29712192 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModuleRepositoryExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/domain/FileModuleRepositoryExample.java @@ -244,213 +244,213 @@ public class FileModuleRepositoryExample { return (Criteria) this; } - public Criteria andRepositoryPathIsNull() { - addCriterion("repository_path is null"); + public Criteria andUrlIsNull() { + addCriterion("url is null"); return (Criteria) this; } - public Criteria andRepositoryPathIsNotNull() { - addCriterion("repository_path is not null"); + public Criteria andUrlIsNotNull() { + addCriterion("url is not null"); return (Criteria) this; } - public Criteria andRepositoryPathEqualTo(String value) { - addCriterion("repository_path =", value, "repositoryPath"); + public Criteria andUrlEqualTo(String value) { + addCriterion("url =", value, "url"); return (Criteria) this; } - public Criteria andRepositoryPathNotEqualTo(String value) { - addCriterion("repository_path <>", value, "repositoryPath"); + public Criteria andUrlNotEqualTo(String value) { + addCriterion("url <>", value, "url"); return (Criteria) this; } - public Criteria andRepositoryPathGreaterThan(String value) { - addCriterion("repository_path >", value, "repositoryPath"); + public Criteria andUrlGreaterThan(String value) { + addCriterion("url >", value, "url"); return (Criteria) this; } - public Criteria andRepositoryPathGreaterThanOrEqualTo(String value) { - addCriterion("repository_path >=", value, "repositoryPath"); + public Criteria andUrlGreaterThanOrEqualTo(String value) { + addCriterion("url >=", value, "url"); return (Criteria) this; } - public Criteria andRepositoryPathLessThan(String value) { - addCriterion("repository_path <", value, "repositoryPath"); + public Criteria andUrlLessThan(String value) { + addCriterion("url <", value, "url"); return (Criteria) this; } - public Criteria andRepositoryPathLessThanOrEqualTo(String value) { - addCriterion("repository_path <=", value, "repositoryPath"); + public Criteria andUrlLessThanOrEqualTo(String value) { + addCriterion("url <=", value, "url"); return (Criteria) this; } - public Criteria andRepositoryPathLike(String value) { - addCriterion("repository_path like", value, "repositoryPath"); + public Criteria andUrlLike(String value) { + addCriterion("url like", value, "url"); return (Criteria) this; } - public Criteria andRepositoryPathNotLike(String value) { - addCriterion("repository_path not like", value, "repositoryPath"); + public Criteria andUrlNotLike(String value) { + addCriterion("url not like", value, "url"); return (Criteria) this; } - public Criteria andRepositoryPathIn(List values) { - addCriterion("repository_path in", values, "repositoryPath"); + public Criteria andUrlIn(List values) { + addCriterion("url in", values, "url"); return (Criteria) this; } - public Criteria andRepositoryPathNotIn(List values) { - addCriterion("repository_path not in", values, "repositoryPath"); + public Criteria andUrlNotIn(List values) { + addCriterion("url not in", values, "url"); return (Criteria) this; } - public Criteria andRepositoryPathBetween(String value1, String value2) { - addCriterion("repository_path between", value1, value2, "repositoryPath"); + public Criteria andUrlBetween(String value1, String value2) { + addCriterion("url between", value1, value2, "url"); return (Criteria) this; } - public Criteria andRepositoryPathNotBetween(String value1, String value2) { - addCriterion("repository_path not between", value1, value2, "repositoryPath"); + public Criteria andUrlNotBetween(String value1, String value2) { + addCriterion("url not between", value1, value2, "url"); return (Criteria) this; } - public Criteria andRepositoryUserNameIsNull() { - addCriterion("repository_user_name is null"); + public Criteria andTokenIsNull() { + addCriterion("token is null"); return (Criteria) this; } - public Criteria andRepositoryUserNameIsNotNull() { - addCriterion("repository_user_name is not null"); + public Criteria andTokenIsNotNull() { + addCriterion("token is not null"); return (Criteria) this; } - public Criteria andRepositoryUserNameEqualTo(String value) { - addCriterion("repository_user_name =", value, "repositoryUserName"); + public Criteria andTokenEqualTo(String value) { + addCriterion("token =", value, "token"); return (Criteria) this; } - public Criteria andRepositoryUserNameNotEqualTo(String value) { - addCriterion("repository_user_name <>", value, "repositoryUserName"); + public Criteria andTokenNotEqualTo(String value) { + addCriterion("token <>", value, "token"); return (Criteria) this; } - public Criteria andRepositoryUserNameGreaterThan(String value) { - addCriterion("repository_user_name >", value, "repositoryUserName"); + public Criteria andTokenGreaterThan(String value) { + addCriterion("token >", value, "token"); return (Criteria) this; } - public Criteria andRepositoryUserNameGreaterThanOrEqualTo(String value) { - addCriterion("repository_user_name >=", value, "repositoryUserName"); + public Criteria andTokenGreaterThanOrEqualTo(String value) { + addCriterion("token >=", value, "token"); return (Criteria) this; } - public Criteria andRepositoryUserNameLessThan(String value) { - addCriterion("repository_user_name <", value, "repositoryUserName"); + public Criteria andTokenLessThan(String value) { + addCriterion("token <", value, "token"); return (Criteria) this; } - public Criteria andRepositoryUserNameLessThanOrEqualTo(String value) { - addCriterion("repository_user_name <=", value, "repositoryUserName"); + public Criteria andTokenLessThanOrEqualTo(String value) { + addCriterion("token <=", value, "token"); return (Criteria) this; } - public Criteria andRepositoryUserNameLike(String value) { - addCriterion("repository_user_name like", value, "repositoryUserName"); + public Criteria andTokenLike(String value) { + addCriterion("token like", value, "token"); return (Criteria) this; } - public Criteria andRepositoryUserNameNotLike(String value) { - addCriterion("repository_user_name not like", value, "repositoryUserName"); + public Criteria andTokenNotLike(String value) { + addCriterion("token not like", value, "token"); return (Criteria) this; } - public Criteria andRepositoryUserNameIn(List values) { - addCriterion("repository_user_name in", values, "repositoryUserName"); + public Criteria andTokenIn(List values) { + addCriterion("token in", values, "token"); return (Criteria) this; } - public Criteria andRepositoryUserNameNotIn(List values) { - addCriterion("repository_user_name not in", values, "repositoryUserName"); + public Criteria andTokenNotIn(List values) { + addCriterion("token not in", values, "token"); return (Criteria) this; } - public Criteria andRepositoryUserNameBetween(String value1, String value2) { - addCriterion("repository_user_name between", value1, value2, "repositoryUserName"); + public Criteria andTokenBetween(String value1, String value2) { + addCriterion("token between", value1, value2, "token"); return (Criteria) this; } - public Criteria andRepositoryUserNameNotBetween(String value1, String value2) { - addCriterion("repository_user_name not between", value1, value2, "repositoryUserName"); + public Criteria andTokenNotBetween(String value1, String value2) { + addCriterion("token not between", value1, value2, "token"); return (Criteria) this; } - public Criteria andRepositoryTokenIsNull() { - addCriterion("repository_token is null"); + public Criteria andUserNameIsNull() { + addCriterion("user_name is null"); return (Criteria) this; } - public Criteria andRepositoryTokenIsNotNull() { - addCriterion("repository_token is not null"); + public Criteria andUserNameIsNotNull() { + addCriterion("user_name is not null"); return (Criteria) this; } - public Criteria andRepositoryTokenEqualTo(String value) { - addCriterion("repository_token =", value, "repositoryToken"); + public Criteria andUserNameEqualTo(String value) { + addCriterion("user_name =", value, "userName"); return (Criteria) this; } - public Criteria andRepositoryTokenNotEqualTo(String value) { - addCriterion("repository_token <>", value, "repositoryToken"); + public Criteria andUserNameNotEqualTo(String value) { + addCriterion("user_name <>", value, "userName"); return (Criteria) this; } - public Criteria andRepositoryTokenGreaterThan(String value) { - addCriterion("repository_token >", value, "repositoryToken"); + public Criteria andUserNameGreaterThan(String value) { + addCriterion("user_name >", value, "userName"); return (Criteria) this; } - public Criteria andRepositoryTokenGreaterThanOrEqualTo(String value) { - addCriterion("repository_token >=", value, "repositoryToken"); + public Criteria andUserNameGreaterThanOrEqualTo(String value) { + addCriterion("user_name >=", value, "userName"); return (Criteria) this; } - public Criteria andRepositoryTokenLessThan(String value) { - addCriterion("repository_token <", value, "repositoryToken"); + public Criteria andUserNameLessThan(String value) { + addCriterion("user_name <", value, "userName"); return (Criteria) this; } - public Criteria andRepositoryTokenLessThanOrEqualTo(String value) { - addCriterion("repository_token <=", value, "repositoryToken"); + public Criteria andUserNameLessThanOrEqualTo(String value) { + addCriterion("user_name <=", value, "userName"); return (Criteria) this; } - public Criteria andRepositoryTokenLike(String value) { - addCriterion("repository_token like", value, "repositoryToken"); + public Criteria andUserNameLike(String value) { + addCriterion("user_name like", value, "userName"); return (Criteria) this; } - public Criteria andRepositoryTokenNotLike(String value) { - addCriterion("repository_token not like", value, "repositoryToken"); + public Criteria andUserNameNotLike(String value) { + addCriterion("user_name not like", value, "userName"); return (Criteria) this; } - public Criteria andRepositoryTokenIn(List values) { - addCriterion("repository_token in", values, "repositoryToken"); + public Criteria andUserNameIn(List values) { + addCriterion("user_name in", values, "userName"); return (Criteria) this; } - public Criteria andRepositoryTokenNotIn(List values) { - addCriterion("repository_token not in", values, "repositoryToken"); + public Criteria andUserNameNotIn(List values) { + addCriterion("user_name not in", values, "userName"); return (Criteria) this; } - public Criteria andRepositoryTokenBetween(String value1, String value2) { - addCriterion("repository_token between", value1, value2, "repositoryToken"); + public Criteria andUserNameBetween(String value1, String value2) { + addCriterion("user_name between", value1, value2, "userName"); return (Criteria) this; } - public Criteria andRepositoryTokenNotBetween(String value1, String value2) { - addCriterion("repository_token not between", value1, value2, "repositoryToken"); + public Criteria andUserNameNotBetween(String value1, String value2) { + addCriterion("user_name not between", value1, value2, "userName"); return (Criteria) this; } } diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileMetadataRepositoryMapper.java b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileMetadataRepositoryMapper.java index 1f71c828f1..b9b0b781a4 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileMetadataRepositoryMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileMetadataRepositoryMapper.java @@ -10,7 +10,7 @@ public interface FileMetadataRepositoryMapper { int deleteByExample(FileMetadataRepositoryExample example); - int deleteByPrimaryKey(String id); + int deleteByPrimaryKey(String fileMetadataId); int insert(FileMetadataRepository record); @@ -20,7 +20,7 @@ public interface FileMetadataRepositoryMapper { List selectByExample(FileMetadataRepositoryExample example); - FileMetadataRepository selectByPrimaryKey(String id); + FileMetadataRepository selectByPrimaryKey(String fileMetadataId); int updateByExampleSelective(@Param("record") FileMetadataRepository record, @Param("example") FileMetadataRepositoryExample example); @@ -32,6 +32,8 @@ public interface FileMetadataRepositoryMapper { int updateByPrimaryKeyWithBLOBs(FileMetadataRepository record); + int updateByPrimaryKey(FileMetadataRepository record); + int batchInsert(@Param("list") List list); int batchInsertSelective(@Param("list") List list, @Param("selective") FileMetadataRepository.Column ... selective); diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileMetadataRepositoryMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileMetadataRepositoryMapper.xml index fcedf4adf0..5f63bd2a9e 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileMetadataRepositoryMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileMetadataRepositoryMapper.xml @@ -2,10 +2,14 @@ - + + + + + - + @@ -66,10 +70,10 @@ - id + file_metadata_id, branch, repository_url, token, commit_id - git_info + commit_message delete from file_metadata_repository - where id = #{id,jdbcType=VARCHAR} + where file_metadata_id = #{fileMetadataId,jdbcType=VARCHAR} delete from file_metadata_repository @@ -120,25 +124,53 @@ - insert into file_metadata_repository (id, git_info) - values (#{id,jdbcType=VARCHAR}, #{gitInfo,jdbcType=LONGVARBINARY}) + insert into file_metadata_repository (file_metadata_id, branch, repository_url, + token, commit_id, commit_message + ) + values (#{fileMetadataId,jdbcType=VARCHAR}, #{branch,jdbcType=VARCHAR}, #{repositoryUrl,jdbcType=VARCHAR}, + #{token,jdbcType=VARCHAR}, #{commitId,jdbcType=VARCHAR}, #{commitMessage,jdbcType=LONGVARCHAR} + ) insert into file_metadata_repository - - id, + + file_metadata_id, - - git_info, + + branch, + + + repository_url, + + + token, + + + commit_id, + + + commit_message, - - #{id,jdbcType=VARCHAR}, + + #{fileMetadataId,jdbcType=VARCHAR}, - - #{gitInfo,jdbcType=LONGVARBINARY}, + + #{branch,jdbcType=VARCHAR}, + + + #{repositoryUrl,jdbcType=VARCHAR}, + + + #{token,jdbcType=VARCHAR}, + + + #{commitId,jdbcType=VARCHAR}, + + + #{commitMessage,jdbcType=LONGVARCHAR}, @@ -151,11 +183,23 @@ update file_metadata_repository - - id = #{record.id,jdbcType=VARCHAR}, + + file_metadata_id = #{record.fileMetadataId,jdbcType=VARCHAR}, - - git_info = #{record.gitInfo,jdbcType=LONGVARBINARY}, + + branch = #{record.branch,jdbcType=VARCHAR}, + + + repository_url = #{record.repositoryUrl,jdbcType=VARCHAR}, + + + token = #{record.token,jdbcType=VARCHAR}, + + + commit_id = #{record.commitId,jdbcType=VARCHAR}, + + + commit_message = #{record.commitMessage,jdbcType=LONGVARCHAR}, @@ -164,15 +208,23 @@ update file_metadata_repository - set id = #{record.id,jdbcType=VARCHAR}, - git_info = #{record.gitInfo,jdbcType=LONGVARBINARY} + set file_metadata_id = #{record.fileMetadataId,jdbcType=VARCHAR}, + branch = #{record.branch,jdbcType=VARCHAR}, + repository_url = #{record.repositoryUrl,jdbcType=VARCHAR}, + token = #{record.token,jdbcType=VARCHAR}, + commit_id = #{record.commitId,jdbcType=VARCHAR}, + commit_message = #{record.commitMessage,jdbcType=LONGVARCHAR} update file_metadata_repository - set id = #{record.id,jdbcType=VARCHAR} + set file_metadata_id = #{record.fileMetadataId,jdbcType=VARCHAR}, + branch = #{record.branch,jdbcType=VARCHAR}, + repository_url = #{record.repositoryUrl,jdbcType=VARCHAR}, + token = #{record.token,jdbcType=VARCHAR}, + commit_id = #{record.commitId,jdbcType=VARCHAR} @@ -180,23 +232,49 @@ update file_metadata_repository - - git_info = #{gitInfo,jdbcType=LONGVARBINARY}, + + branch = #{branch,jdbcType=VARCHAR}, + + + repository_url = #{repositoryUrl,jdbcType=VARCHAR}, + + + token = #{token,jdbcType=VARCHAR}, + + + commit_id = #{commitId,jdbcType=VARCHAR}, + + + commit_message = #{commitMessage,jdbcType=LONGVARCHAR}, - where id = #{id,jdbcType=VARCHAR} + where file_metadata_id = #{fileMetadataId,jdbcType=VARCHAR} update file_metadata_repository - set git_info = #{gitInfo,jdbcType=LONGVARBINARY} - where id = #{id,jdbcType=VARCHAR} + set branch = #{branch,jdbcType=VARCHAR}, + repository_url = #{repositoryUrl,jdbcType=VARCHAR}, + token = #{token,jdbcType=VARCHAR}, + commit_id = #{commitId,jdbcType=VARCHAR}, + commit_message = #{commitMessage,jdbcType=LONGVARCHAR} + where file_metadata_id = #{fileMetadataId,jdbcType=VARCHAR} + + + update file_metadata_repository + set branch = #{branch,jdbcType=VARCHAR}, + repository_url = #{repositoryUrl,jdbcType=VARCHAR}, + token = #{token,jdbcType=VARCHAR}, + commit_id = #{commitId,jdbcType=VARCHAR} + where file_metadata_id = #{fileMetadataId,jdbcType=VARCHAR} insert into file_metadata_repository - (id, git_info) + (file_metadata_id, branch, repository_url, token, commit_id, commit_message) values - (#{item.id,jdbcType=VARCHAR}, #{item.gitInfo,jdbcType=LONGVARBINARY}) + (#{item.fileMetadataId,jdbcType=VARCHAR}, #{item.branch,jdbcType=VARCHAR}, #{item.repositoryUrl,jdbcType=VARCHAR}, + #{item.token,jdbcType=VARCHAR}, #{item.commitId,jdbcType=VARCHAR}, #{item.commitMessage,jdbcType=LONGVARCHAR} + ) @@ -209,11 +287,23 @@ ( - - #{item.id,jdbcType=VARCHAR} + + #{item.fileMetadataId,jdbcType=VARCHAR} - - #{item.gitInfo,jdbcType=LONGVARBINARY} + + #{item.branch,jdbcType=VARCHAR} + + + #{item.repositoryUrl,jdbcType=VARCHAR} + + + #{item.token,jdbcType=VARCHAR} + + + #{item.commitId,jdbcType=VARCHAR} + + + #{item.commitMessage,jdbcType=LONGVARCHAR} ) diff --git a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileModuleRepositoryMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileModuleRepositoryMapper.xml index a25e6910f5..4f76d4fca8 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileModuleRepositoryMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/project/mapper/FileModuleRepositoryMapper.xml @@ -4,9 +4,9 @@ - - - + + + @@ -67,7 +67,7 @@ - file_module_id, platform, repository_path, repository_user_name, repository_token + file_module_id, platform, url, token, user_name SELECT max(pos) FROM file_module - WHERE parent_id = #{0} + WHERE parent_id = #{parentId} + AND module_type = #{fileType}