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 2c9aea3fd0..f380350fd9 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 @@ -1,55 +1,70 @@ package io.metersphere.bug.domain; -import io.metersphere.validation.groups.*; +import io.metersphere.validation.groups.Created; +import io.metersphere.validation.groups.Updated; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.*; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; +import lombok.Data; + import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; -import lombok.Data; @Data public class Bug implements Serializable { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{bug.id.not_blank}", groups = {Updated.class}) @Size(min = 1, max = 50, message = "{bug.id.length_range}", groups = {Created.class, Updated.class}) private String id; - @Schema(description = "业务ID") + @Schema(description = "业务ID") private Integer num; - @Schema(description = "缺陷标题", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "缺陷标题", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{bug.title.not_blank}", groups = {Created.class}) @Size(min = 1, max = 300, message = "{bug.title.length_range}", groups = {Created.class, Updated.class}) private String title; - @Schema(description = "创建时间") + @Schema(description = "指派人", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{bug.assign_user.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{bug.assign_user.length_range}", groups = {Created.class, Updated.class}) + private String assignUser; + + @Schema(description = "创建人") + private String createUser; + + @Schema(description = "创建时间") private Long createTime; - @Schema(description = "更新时间") + @Schema(description = "更新时间") private Long updateTime; - @Schema(description = "缺陷平台", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{bug.platform.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 50, message = "{bug.platform.length_range}", groups = {Created.class, Updated.class}) - private String platform; - - @Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{bug.project_id.not_blank}", groups = {Created.class}) @Size(min = 1, max = 50, message = "{bug.project_id.length_range}", groups = {Created.class, Updated.class}) private String projectId; - @Schema(description = "创建人") - private String createUser; + @Schema(description = "模板ID") + private String templateId; - @Schema(description = "缺陷来源,记录创建该缺陷的测试计划的ID") - private String sourceId; + @Schema(description = "缺陷平台", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{bug.platform.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{bug.platform.length_range}", groups = {Created.class, Updated.class}) + private String platform; - @Schema(description = "第三方平台状态") - private String platformStatus; + @Schema(description = "平台状态", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{bug.status.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{bug.status.length_range}", groups = {Created.class, Updated.class}) + private String status; - @Schema(description = "第三方平台缺陷ID") - private String platformId; + @Schema(description = "第三方平台缺陷ID") + private String platformBugId; + + @Schema(description = "是否回收站", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "{bug.trash.not_blank}", groups = {Created.class}) + private Boolean trash; private static final long serialVersionUID = 1L; @@ -57,14 +72,16 @@ public class Bug implements Serializable { id("id", "id", "VARCHAR", false), num("num", "num", "INTEGER", false), title("title", "title", "VARCHAR", false), + assignUser("assign_user", "assignUser", "VARCHAR", false), + createUser("create_user", "createUser", "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); + templateId("template_id", "templateId", "VARCHAR", false), + platform("platform", "platform", "VARCHAR", false), + status("status", "status", "VARCHAR", true), + platformBugId("platform_bug_id", "platformBugId", "VARCHAR", false), + trash("trash", "trash", "BIT", false); private static final String BEGINNING_DELIMITER = "`"; diff --git a/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugAttachment.java b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugAttachment.java index 1dc20d6b83..d4295cf5f7 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugAttachment.java +++ b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugAttachment.java @@ -1,22 +1,130 @@ package io.metersphere.bug.domain; -import io.metersphere.validation.groups.*; +import io.metersphere.validation.groups.Created; +import io.metersphere.validation.groups.Updated; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.*; -import java.io.Serializable; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Size; import lombok.Data; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; + @Data public class BugAttachment implements Serializable { - @Schema(description = "缺陷ID", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{bug_attachment.id.not_blank}", groups = {Updated.class}) + @Size(min = 1, max = 255, message = "{bug_attachment.id.length_range}", groups = {Created.class, Updated.class}) + private String id; + + @Schema(description = "缺陷ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{bug_attachment.bug_id.not_blank}", groups = {Created.class}) @Size(min = 1, max = 50, message = "{bug_attachment.bug_id.length_range}", groups = {Created.class, Updated.class}) private String bugId; - @Schema(description = "文件的ID", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "文件ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{bug_attachment.file_id.not_blank}", groups = {Created.class}) @Size(min = 1, max = 50, message = "{bug_attachment.file_id.length_range}", groups = {Created.class, Updated.class}) private String fileId; + @Schema(description = "文件名称", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{bug_attachment.file_name.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 255, message = "{bug_attachment.file_name.length_range}", groups = {Created.class, Updated.class}) + private String fileName; + + @Schema(description = "文件大小", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "{bug_attachment.size.not_blank}", groups = {Created.class}) + private Long size; + + @Schema(description = "是否关联", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "{bug_attachment.association.not_blank}", groups = {Created.class}) + private Boolean association; + + @Schema(description = "创建人") + private String createUser; + + @Schema(description = "创建时间") + private Long createTime; + private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + bugId("bug_id", "bugId", "VARCHAR", false), + fileId("file_id", "fileId", "VARCHAR", false), + fileName("file_name", "fileName", "VARCHAR", false), + size("size", "size", "BIGINT", true), + association("association", "association", "BIT", false), + createUser("create_user", "createUser", "VARCHAR", false), + createTime("create_time", "createTime", "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/bug/domain/BugAttachmentExample.java b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugAttachmentExample.java index b225d508d4..436f387932 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugAttachmentExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugAttachmentExample.java @@ -104,6 +104,76 @@ public class BugAttachmentExample { criteria.add(new Criterion(condition, value1, value2)); } + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(String value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(String value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(String value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(String value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(String value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(String value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLike(String value) { + addCriterion("id like", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotLike(String value) { + addCriterion("id not like", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(String value1, String value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(String value1, String value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + public Criteria andBugIdIsNull() { addCriterion("bug_id is null"); return (Criteria) this; @@ -243,6 +313,326 @@ public class BugAttachmentExample { addCriterion("file_id not between", value1, value2, "fileId"); return (Criteria) this; } + + public Criteria andFileNameIsNull() { + addCriterion("file_name is null"); + return (Criteria) this; + } + + public Criteria andFileNameIsNotNull() { + addCriterion("file_name is not null"); + return (Criteria) this; + } + + public Criteria andFileNameEqualTo(String value) { + addCriterion("file_name =", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameNotEqualTo(String value) { + addCriterion("file_name <>", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameGreaterThan(String value) { + addCriterion("file_name >", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameGreaterThanOrEqualTo(String value) { + addCriterion("file_name >=", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameLessThan(String value) { + addCriterion("file_name <", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameLessThanOrEqualTo(String value) { + addCriterion("file_name <=", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameLike(String value) { + addCriterion("file_name like", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameNotLike(String value) { + addCriterion("file_name not like", value, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameIn(List values) { + addCriterion("file_name in", values, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameNotIn(List values) { + addCriterion("file_name not in", values, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameBetween(String value1, String value2) { + addCriterion("file_name between", value1, value2, "fileName"); + return (Criteria) this; + } + + public Criteria andFileNameNotBetween(String value1, String value2) { + addCriterion("file_name not between", value1, value2, "fileName"); + return (Criteria) this; + } + + public Criteria andSizeIsNull() { + addCriterion("`size` is null"); + return (Criteria) this; + } + + public Criteria andSizeIsNotNull() { + addCriterion("`size` is not null"); + return (Criteria) this; + } + + public Criteria andSizeEqualTo(Long value) { + addCriterion("`size` =", value, "size"); + return (Criteria) this; + } + + public Criteria andSizeNotEqualTo(Long value) { + addCriterion("`size` <>", value, "size"); + return (Criteria) this; + } + + public Criteria andSizeGreaterThan(Long value) { + addCriterion("`size` >", value, "size"); + return (Criteria) this; + } + + public Criteria andSizeGreaterThanOrEqualTo(Long value) { + addCriterion("`size` >=", value, "size"); + return (Criteria) this; + } + + public Criteria andSizeLessThan(Long value) { + addCriterion("`size` <", value, "size"); + return (Criteria) this; + } + + public Criteria andSizeLessThanOrEqualTo(Long value) { + addCriterion("`size` <=", value, "size"); + return (Criteria) this; + } + + public Criteria andSizeIn(List values) { + addCriterion("`size` in", values, "size"); + return (Criteria) this; + } + + public Criteria andSizeNotIn(List values) { + addCriterion("`size` not in", values, "size"); + return (Criteria) this; + } + + public Criteria andSizeBetween(Long value1, Long value2) { + addCriterion("`size` between", value1, value2, "size"); + return (Criteria) this; + } + + public Criteria andSizeNotBetween(Long value1, Long value2) { + addCriterion("`size` not between", value1, value2, "size"); + return (Criteria) this; + } + + public Criteria andAssociationIsNull() { + addCriterion("association is null"); + return (Criteria) this; + } + + public Criteria andAssociationIsNotNull() { + addCriterion("association is not null"); + return (Criteria) this; + } + + public Criteria andAssociationEqualTo(Boolean value) { + addCriterion("association =", value, "association"); + return (Criteria) this; + } + + public Criteria andAssociationNotEqualTo(Boolean value) { + addCriterion("association <>", value, "association"); + return (Criteria) this; + } + + public Criteria andAssociationGreaterThan(Boolean value) { + addCriterion("association >", value, "association"); + return (Criteria) this; + } + + public Criteria andAssociationGreaterThanOrEqualTo(Boolean value) { + addCriterion("association >=", value, "association"); + return (Criteria) this; + } + + public Criteria andAssociationLessThan(Boolean value) { + addCriterion("association <", value, "association"); + return (Criteria) this; + } + + public Criteria andAssociationLessThanOrEqualTo(Boolean value) { + addCriterion("association <=", value, "association"); + return (Criteria) this; + } + + public Criteria andAssociationIn(List values) { + addCriterion("association in", values, "association"); + return (Criteria) this; + } + + public Criteria andAssociationNotIn(List values) { + addCriterion("association not in", values, "association"); + return (Criteria) this; + } + + public Criteria andAssociationBetween(Boolean value1, Boolean value2) { + addCriterion("association between", value1, value2, "association"); + return (Criteria) this; + } + + public Criteria andAssociationNotBetween(Boolean value1, Boolean value2) { + addCriterion("association not between", value1, value2, "association"); + return (Criteria) this; + } + + public Criteria andCreateUserIsNull() { + addCriterion("create_user is null"); + return (Criteria) this; + } + + public Criteria andCreateUserIsNotNull() { + addCriterion("create_user is not null"); + return (Criteria) this; + } + + public Criteria andCreateUserEqualTo(String value) { + addCriterion("create_user =", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserNotEqualTo(String value) { + addCriterion("create_user <>", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserGreaterThan(String value) { + addCriterion("create_user >", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserGreaterThanOrEqualTo(String value) { + addCriterion("create_user >=", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserLessThan(String value) { + addCriterion("create_user <", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserLessThanOrEqualTo(String value) { + addCriterion("create_user <=", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserLike(String value) { + addCriterion("create_user like", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserNotLike(String value) { + addCriterion("create_user not like", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserIn(List values) { + addCriterion("create_user in", values, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserNotIn(List values) { + addCriterion("create_user not in", values, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserBetween(String value1, String value2) { + addCriterion("create_user between", value1, value2, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserNotBetween(String value1, String value2) { + addCriterion("create_user not between", value1, value2, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Long value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Long value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Long value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Long value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Long value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Long value1, Long value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Long value1, Long value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugBlob.java b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugBlob.java deleted file mode 100644 index b045ed93ef..0000000000 --- a/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugBlob.java +++ /dev/null @@ -1,20 +0,0 @@ -package io.metersphere.bug.domain; - -import io.metersphere.validation.groups.*; -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.*; -import java.io.Serializable; -import lombok.Data; - -@Data -public class BugBlob implements Serializable { - @Schema(description = "缺陷ID", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{bug_blob.id.not_blank}", groups = {Updated.class}) - @Size(min = 1, max = 50, message = "{bug_blob.id.length_range}", groups = {Created.class, Updated.class}) - private String id; - - @Schema(description = "缺陷描述") - private String description; - - private static final long serialVersionUID = 1L; -} \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugComment.java b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugComment.java index b10770310f..59a4f07aa8 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugComment.java +++ b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugComment.java @@ -1,36 +1,129 @@ package io.metersphere.bug.domain; -import io.metersphere.validation.groups.*; +import io.metersphere.validation.groups.Created; +import io.metersphere.validation.groups.Updated; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.*; -import java.io.Serializable; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Size; import lombok.Data; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; + @Data public class BugComment implements Serializable { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{bug_comment.id.not_blank}", groups = {Updated.class}) - @Size(min = 1, max = 64, message = "{bug_comment.id.length_range}", groups = {Created.class, Updated.class}) + @Size(min = 1, max = 50, message = "{bug_comment.id.length_range}", groups = {Created.class, Updated.class}) private String id; - @Schema(description = "缺陷ID", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "缺陷ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{bug_comment.bug_id.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 64, message = "{bug_comment.bug_id.length_range}", groups = {Created.class, Updated.class}) + @Size(min = 1, max = 50, message = "{bug_comment.bug_id.length_range}", groups = {Created.class, Updated.class}) private String bugId; - @Schema(description = "评论人") + @Schema(description = "回复人") + private String replyUser; + + @Schema(description = "父评论ID") + private String parentId; + + @Schema(description = "评论人") private String createUser; - @Schema(description = "创建时间") + @Schema(description = "创建时间") private Long createTime; - @Schema(description = "更新时间") + @Schema(description = "更新人") + private String updateUser; + + @Schema(description = "更新时间") private Long updateTime; - @Schema(description = "内容", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "内容", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{bug_comment.description.not_blank}", groups = {Created.class}) @Size(min = 1, max = 65535, message = "{bug_comment.description.length_range}", groups = {Created.class, Updated.class}) private String description; private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + bugId("bug_id", "bugId", "VARCHAR", false), + replyUser("reply_user", "replyUser", "VARCHAR", false), + parentId("parent_id", "parentId", "VARCHAR", false), + createUser("create_user", "createUser", "VARCHAR", false), + createTime("create_time", "createTime", "BIGINT", false), + updateUser("update_user", "updateUser", "VARCHAR", false), + updateTime("update_time", "updateTime", "BIGINT", 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/bug/domain/BugCommentExample.java b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugCommentExample.java index 2b0177b2f9..56ff83234d 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugCommentExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugCommentExample.java @@ -244,6 +244,146 @@ public class BugCommentExample { return (Criteria) this; } + public Criteria andReplyUserIsNull() { + addCriterion("reply_user is null"); + return (Criteria) this; + } + + public Criteria andReplyUserIsNotNull() { + addCriterion("reply_user is not null"); + return (Criteria) this; + } + + public Criteria andReplyUserEqualTo(String value) { + addCriterion("reply_user =", value, "replyUser"); + return (Criteria) this; + } + + public Criteria andReplyUserNotEqualTo(String value) { + addCriterion("reply_user <>", value, "replyUser"); + return (Criteria) this; + } + + public Criteria andReplyUserGreaterThan(String value) { + addCriterion("reply_user >", value, "replyUser"); + return (Criteria) this; + } + + public Criteria andReplyUserGreaterThanOrEqualTo(String value) { + addCriterion("reply_user >=", value, "replyUser"); + return (Criteria) this; + } + + public Criteria andReplyUserLessThan(String value) { + addCriterion("reply_user <", value, "replyUser"); + return (Criteria) this; + } + + public Criteria andReplyUserLessThanOrEqualTo(String value) { + addCriterion("reply_user <=", value, "replyUser"); + return (Criteria) this; + } + + public Criteria andReplyUserLike(String value) { + addCriterion("reply_user like", value, "replyUser"); + return (Criteria) this; + } + + public Criteria andReplyUserNotLike(String value) { + addCriterion("reply_user not like", value, "replyUser"); + return (Criteria) this; + } + + public Criteria andReplyUserIn(List values) { + addCriterion("reply_user in", values, "replyUser"); + return (Criteria) this; + } + + public Criteria andReplyUserNotIn(List values) { + addCriterion("reply_user not in", values, "replyUser"); + return (Criteria) this; + } + + public Criteria andReplyUserBetween(String value1, String value2) { + addCriterion("reply_user between", value1, value2, "replyUser"); + return (Criteria) this; + } + + public Criteria andReplyUserNotBetween(String value1, String value2) { + addCriterion("reply_user not between", value1, value2, "replyUser"); + return (Criteria) this; + } + + public Criteria andParentIdIsNull() { + addCriterion("parent_id is null"); + return (Criteria) this; + } + + public Criteria andParentIdIsNotNull() { + addCriterion("parent_id is not null"); + return (Criteria) this; + } + + public Criteria andParentIdEqualTo(String value) { + addCriterion("parent_id =", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotEqualTo(String value) { + addCriterion("parent_id <>", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdGreaterThan(String value) { + addCriterion("parent_id >", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdGreaterThanOrEqualTo(String value) { + addCriterion("parent_id >=", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLessThan(String value) { + addCriterion("parent_id <", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLessThanOrEqualTo(String value) { + addCriterion("parent_id <=", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdLike(String value) { + addCriterion("parent_id like", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotLike(String value) { + addCriterion("parent_id not like", value, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdIn(List values) { + addCriterion("parent_id in", values, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotIn(List values) { + addCriterion("parent_id not in", values, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdBetween(String value1, String value2) { + addCriterion("parent_id between", value1, value2, "parentId"); + return (Criteria) this; + } + + public Criteria andParentIdNotBetween(String value1, String value2) { + addCriterion("parent_id not between", value1, value2, "parentId"); + return (Criteria) this; + } + public Criteria andCreateUserIsNull() { addCriterion("create_user is null"); return (Criteria) this; @@ -374,6 +514,76 @@ public class BugCommentExample { return (Criteria) this; } + public Criteria andUpdateUserIsNull() { + addCriterion("update_user is null"); + return (Criteria) this; + } + + public Criteria andUpdateUserIsNotNull() { + addCriterion("update_user is not null"); + return (Criteria) this; + } + + public Criteria andUpdateUserEqualTo(String value) { + addCriterion("update_user =", value, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserNotEqualTo(String value) { + addCriterion("update_user <>", value, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserGreaterThan(String value) { + addCriterion("update_user >", value, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserGreaterThanOrEqualTo(String value) { + addCriterion("update_user >=", value, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserLessThan(String value) { + addCriterion("update_user <", value, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserLessThanOrEqualTo(String value) { + addCriterion("update_user <=", value, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserLike(String value) { + addCriterion("update_user like", value, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserNotLike(String value) { + addCriterion("update_user not like", value, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserIn(List values) { + addCriterion("update_user in", values, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserNotIn(List values) { + addCriterion("update_user not in", values, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserBetween(String value1, String value2) { + addCriterion("update_user between", value1, value2, "updateUser"); + return (Criteria) this; + } + + public Criteria andUpdateUserNotBetween(String value1, String value2) { + addCriterion("update_user not between", value1, value2, "updateUser"); + return (Criteria) this; + } + public Criteria andUpdateTimeIsNull() { addCriterion("update_time is null"); return (Criteria) this; diff --git a/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugContent.java b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugContent.java new file mode 100644 index 0000000000..31524810b1 --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugContent.java @@ -0,0 +1,97 @@ +package io.metersphere.bug.domain; + +import io.metersphere.validation.groups.Created; +import io.metersphere.validation.groups.Updated; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Size; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; + +@Data +public class BugContent implements Serializable { + @Schema(description = "缺陷ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{bug_content.bug_id.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{bug_content.bug_id.length_range}", groups = {Created.class, Updated.class}) + private String bugId; + + @Schema(description = "缺陷描述") + private String description; + + private static final long serialVersionUID = 1L; + + public enum Column { + bugId("bug_id", "bugId", "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/bug/domain/BugBlobExample.java b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugContentExample.java similarity index 77% rename from backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugBlobExample.java rename to backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugContentExample.java index f9c3c8408a..6c5d6084f1 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugBlobExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugContentExample.java @@ -3,14 +3,14 @@ package io.metersphere.bug.domain; import java.util.ArrayList; import java.util.List; -public class BugBlobExample { +public class BugContentExample { protected String orderByClause; protected boolean distinct; protected List oredCriteria; - public BugBlobExample() { + public BugContentExample() { oredCriteria = new ArrayList(); } @@ -104,73 +104,73 @@ public class BugBlobExample { criteria.add(new Criterion(condition, value1, value2)); } - public Criteria andIdIsNull() { - addCriterion("id is null"); + public Criteria andBugIdIsNull() { + addCriterion("bug_id is null"); return (Criteria) this; } - public Criteria andIdIsNotNull() { - addCriterion("id is not null"); + public Criteria andBugIdIsNotNull() { + addCriterion("bug_id is not null"); return (Criteria) this; } - public Criteria andIdEqualTo(String value) { - addCriterion("id =", value, "id"); + public Criteria andBugIdEqualTo(String value) { + addCriterion("bug_id =", value, "bugId"); return (Criteria) this; } - public Criteria andIdNotEqualTo(String value) { - addCriterion("id <>", value, "id"); + public Criteria andBugIdNotEqualTo(String value) { + addCriterion("bug_id <>", value, "bugId"); return (Criteria) this; } - public Criteria andIdGreaterThan(String value) { - addCriterion("id >", value, "id"); + public Criteria andBugIdGreaterThan(String value) { + addCriterion("bug_id >", value, "bugId"); return (Criteria) this; } - public Criteria andIdGreaterThanOrEqualTo(String value) { - addCriterion("id >=", value, "id"); + public Criteria andBugIdGreaterThanOrEqualTo(String value) { + addCriterion("bug_id >=", value, "bugId"); return (Criteria) this; } - public Criteria andIdLessThan(String value) { - addCriterion("id <", value, "id"); + public Criteria andBugIdLessThan(String value) { + addCriterion("bug_id <", value, "bugId"); return (Criteria) this; } - public Criteria andIdLessThanOrEqualTo(String value) { - addCriterion("id <=", value, "id"); + public Criteria andBugIdLessThanOrEqualTo(String value) { + addCriterion("bug_id <=", value, "bugId"); return (Criteria) this; } - public Criteria andIdLike(String value) { - addCriterion("id like", value, "id"); + public Criteria andBugIdLike(String value) { + addCriterion("bug_id like", value, "bugId"); return (Criteria) this; } - public Criteria andIdNotLike(String value) { - addCriterion("id not like", value, "id"); + public Criteria andBugIdNotLike(String value) { + addCriterion("bug_id not like", value, "bugId"); return (Criteria) this; } - public Criteria andIdIn(List values) { - addCriterion("id in", values, "id"); + public Criteria andBugIdIn(List values) { + addCriterion("bug_id in", values, "bugId"); return (Criteria) this; } - public Criteria andIdNotIn(List values) { - addCriterion("id not in", values, "id"); + public Criteria andBugIdNotIn(List values) { + addCriterion("bug_id not in", values, "bugId"); return (Criteria) this; } - public Criteria andIdBetween(String value1, String value2) { - addCriterion("id between", value1, value2, "id"); + public Criteria andBugIdBetween(String value1, String value2) { + addCriterion("bug_id between", value1, value2, "bugId"); return (Criteria) this; } - public Criteria andIdNotBetween(String value1, String value2) { - addCriterion("id not between", value1, value2, "id"); + public Criteria andBugIdNotBetween(String value1, String value2) { + addCriterion("bug_id not between", value1, value2, "bugId"); return (Criteria) this; } } diff --git a/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugCustomField.java b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugCustomField.java index 6af10a11d3..19adc8398b 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugCustomField.java +++ b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugCustomField.java @@ -1,28 +1,103 @@ package io.metersphere.bug.domain; -import io.metersphere.validation.groups.*; +import io.metersphere.validation.groups.Created; +import io.metersphere.validation.groups.Updated; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.*; -import java.io.Serializable; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Size; import lombok.Data; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; + @Data public class BugCustomField implements Serializable { - @Schema(description = "资源ID", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "缺陷ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{bug_custom_field.bug_id.not_blank}", groups = {Created.class}) @Size(min = 1, max = 50, message = "{bug_custom_field.bug_id.length_range}", groups = {Created.class, Updated.class}) private String bugId; - @Schema(description = "字段ID", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "字段ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{bug_custom_field.field_id.not_blank}", groups = {Created.class}) @Size(min = 1, max = 50, message = "{bug_custom_field.field_id.length_range}", groups = {Created.class, Updated.class}) private String fieldId; - @Schema(description = "字段值") + @Schema(description = "字段值") private String value; - @Schema(description = "文本类型字段值") - private byte[] textValue; - private static final long serialVersionUID = 1L; + + public enum Column { + bugId("bug_id", "bugId", "VARCHAR", false), + fieldId("field_id", "fieldId", "VARCHAR", false), + value("value", "value", "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/bug/domain/BugExample.java b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugExample.java index db02318075..6c1e66890a 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugExample.java @@ -304,6 +304,146 @@ public class BugExample { return (Criteria) this; } + public Criteria andAssignUserIsNull() { + addCriterion("assign_user is null"); + return (Criteria) this; + } + + public Criteria andAssignUserIsNotNull() { + addCriterion("assign_user is not null"); + return (Criteria) this; + } + + public Criteria andAssignUserEqualTo(String value) { + addCriterion("assign_user =", value, "assignUser"); + return (Criteria) this; + } + + public Criteria andAssignUserNotEqualTo(String value) { + addCriterion("assign_user <>", value, "assignUser"); + return (Criteria) this; + } + + public Criteria andAssignUserGreaterThan(String value) { + addCriterion("assign_user >", value, "assignUser"); + return (Criteria) this; + } + + public Criteria andAssignUserGreaterThanOrEqualTo(String value) { + addCriterion("assign_user >=", value, "assignUser"); + return (Criteria) this; + } + + public Criteria andAssignUserLessThan(String value) { + addCriterion("assign_user <", value, "assignUser"); + return (Criteria) this; + } + + public Criteria andAssignUserLessThanOrEqualTo(String value) { + addCriterion("assign_user <=", value, "assignUser"); + return (Criteria) this; + } + + public Criteria andAssignUserLike(String value) { + addCriterion("assign_user like", value, "assignUser"); + return (Criteria) this; + } + + public Criteria andAssignUserNotLike(String value) { + addCriterion("assign_user not like", value, "assignUser"); + return (Criteria) this; + } + + public Criteria andAssignUserIn(List values) { + addCriterion("assign_user in", values, "assignUser"); + return (Criteria) this; + } + + public Criteria andAssignUserNotIn(List values) { + addCriterion("assign_user not in", values, "assignUser"); + return (Criteria) this; + } + + public Criteria andAssignUserBetween(String value1, String value2) { + addCriterion("assign_user between", value1, value2, "assignUser"); + return (Criteria) this; + } + + public Criteria andAssignUserNotBetween(String value1, String value2) { + addCriterion("assign_user not between", value1, value2, "assignUser"); + return (Criteria) this; + } + + public Criteria andCreateUserIsNull() { + addCriterion("create_user is null"); + return (Criteria) this; + } + + public Criteria andCreateUserIsNotNull() { + addCriterion("create_user is not null"); + return (Criteria) this; + } + + public Criteria andCreateUserEqualTo(String value) { + addCriterion("create_user =", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserNotEqualTo(String value) { + addCriterion("create_user <>", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserGreaterThan(String value) { + addCriterion("create_user >", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserGreaterThanOrEqualTo(String value) { + addCriterion("create_user >=", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserLessThan(String value) { + addCriterion("create_user <", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserLessThanOrEqualTo(String value) { + addCriterion("create_user <=", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserLike(String value) { + addCriterion("create_user like", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserNotLike(String value) { + addCriterion("create_user not like", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserIn(List values) { + addCriterion("create_user in", values, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserNotIn(List values) { + addCriterion("create_user not in", values, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserBetween(String value1, String value2) { + addCriterion("create_user between", value1, value2, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserNotBetween(String value1, String value2) { + addCriterion("create_user not between", value1, value2, "createUser"); + return (Criteria) this; + } + public Criteria andCreateTimeIsNull() { addCriterion("create_time is null"); return (Criteria) this; @@ -424,76 +564,6 @@ public class BugExample { return (Criteria) this; } - public Criteria andPlatformIsNull() { - addCriterion("platform is null"); - return (Criteria) this; - } - - public Criteria andPlatformIsNotNull() { - addCriterion("platform is not null"); - return (Criteria) this; - } - - public Criteria andPlatformEqualTo(String value) { - addCriterion("platform =", value, "platform"); - return (Criteria) this; - } - - public Criteria andPlatformNotEqualTo(String value) { - addCriterion("platform <>", value, "platform"); - return (Criteria) this; - } - - public Criteria andPlatformGreaterThan(String value) { - addCriterion("platform >", value, "platform"); - return (Criteria) this; - } - - public Criteria andPlatformGreaterThanOrEqualTo(String value) { - addCriterion("platform >=", value, "platform"); - return (Criteria) this; - } - - public Criteria andPlatformLessThan(String value) { - addCriterion("platform <", value, "platform"); - return (Criteria) this; - } - - public Criteria andPlatformLessThanOrEqualTo(String value) { - addCriterion("platform <=", value, "platform"); - return (Criteria) this; - } - - public Criteria andPlatformLike(String value) { - addCriterion("platform like", value, "platform"); - return (Criteria) this; - } - - public Criteria andPlatformNotLike(String value) { - addCriterion("platform not like", value, "platform"); - return (Criteria) this; - } - - public Criteria andPlatformIn(List values) { - addCriterion("platform in", values, "platform"); - return (Criteria) this; - } - - public Criteria andPlatformNotIn(List values) { - addCriterion("platform not in", values, "platform"); - return (Criteria) this; - } - - public Criteria andPlatformBetween(String value1, String value2) { - addCriterion("platform between", value1, value2, "platform"); - return (Criteria) this; - } - - public Criteria andPlatformNotBetween(String value1, String value2) { - addCriterion("platform not between", value1, value2, "platform"); - return (Criteria) this; - } - public Criteria andProjectIdIsNull() { addCriterion("project_id is null"); return (Criteria) this; @@ -564,283 +634,343 @@ public class BugExample { return (Criteria) this; } - public Criteria andCreateUserIsNull() { - addCriterion("create_user is null"); + public Criteria andTemplateIdIsNull() { + addCriterion("template_id is null"); return (Criteria) this; } - public Criteria andCreateUserIsNotNull() { - addCriterion("create_user is not null"); + public Criteria andTemplateIdIsNotNull() { + addCriterion("template_id is not null"); return (Criteria) this; } - public Criteria andCreateUserEqualTo(String value) { - addCriterion("create_user =", value, "createUser"); + public Criteria andTemplateIdEqualTo(String value) { + addCriterion("template_id =", value, "templateId"); return (Criteria) this; } - public Criteria andCreateUserNotEqualTo(String value) { - addCriterion("create_user <>", value, "createUser"); + public Criteria andTemplateIdNotEqualTo(String value) { + addCriterion("template_id <>", value, "templateId"); return (Criteria) this; } - public Criteria andCreateUserGreaterThan(String value) { - addCriterion("create_user >", value, "createUser"); + public Criteria andTemplateIdGreaterThan(String value) { + addCriterion("template_id >", value, "templateId"); return (Criteria) this; } - public Criteria andCreateUserGreaterThanOrEqualTo(String value) { - addCriterion("create_user >=", value, "createUser"); + public Criteria andTemplateIdGreaterThanOrEqualTo(String value) { + addCriterion("template_id >=", value, "templateId"); return (Criteria) this; } - public Criteria andCreateUserLessThan(String value) { - addCriterion("create_user <", value, "createUser"); + public Criteria andTemplateIdLessThan(String value) { + addCriterion("template_id <", value, "templateId"); return (Criteria) this; } - public Criteria andCreateUserLessThanOrEqualTo(String value) { - addCriterion("create_user <=", value, "createUser"); + public Criteria andTemplateIdLessThanOrEqualTo(String value) { + addCriterion("template_id <=", value, "templateId"); return (Criteria) this; } - public Criteria andCreateUserLike(String value) { - addCriterion("create_user like", value, "createUser"); + public Criteria andTemplateIdLike(String value) { + addCriterion("template_id like", value, "templateId"); return (Criteria) this; } - public Criteria andCreateUserNotLike(String value) { - addCriterion("create_user not like", value, "createUser"); + public Criteria andTemplateIdNotLike(String value) { + addCriterion("template_id not like", value, "templateId"); return (Criteria) this; } - public Criteria andCreateUserIn(List values) { - addCriterion("create_user in", values, "createUser"); + public Criteria andTemplateIdIn(List values) { + addCriterion("template_id in", values, "templateId"); return (Criteria) this; } - public Criteria andCreateUserNotIn(List values) { - addCriterion("create_user not in", values, "createUser"); + public Criteria andTemplateIdNotIn(List values) { + addCriterion("template_id not in", values, "templateId"); return (Criteria) this; } - public Criteria andCreateUserBetween(String value1, String value2) { - addCriterion("create_user between", value1, value2, "createUser"); + public Criteria andTemplateIdBetween(String value1, String value2) { + addCriterion("template_id between", value1, value2, "templateId"); return (Criteria) this; } - public Criteria andCreateUserNotBetween(String value1, String value2) { - addCriterion("create_user not between", value1, value2, "createUser"); + public Criteria andTemplateIdNotBetween(String value1, String value2) { + addCriterion("template_id not between", value1, value2, "templateId"); return (Criteria) this; } - public Criteria andSourceIdIsNull() { - addCriterion("source_id is null"); + public Criteria andPlatformIsNull() { + addCriterion("platform is null"); return (Criteria) this; } - public Criteria andSourceIdIsNotNull() { - addCriterion("source_id is not null"); + public Criteria andPlatformIsNotNull() { + addCriterion("platform is not null"); return (Criteria) this; } - public Criteria andSourceIdEqualTo(String value) { - addCriterion("source_id =", value, "sourceId"); + public Criteria andPlatformEqualTo(String value) { + addCriterion("platform =", value, "platform"); return (Criteria) this; } - public Criteria andSourceIdNotEqualTo(String value) { - addCriterion("source_id <>", value, "sourceId"); + public Criteria andPlatformNotEqualTo(String value) { + addCriterion("platform <>", value, "platform"); return (Criteria) this; } - public Criteria andSourceIdGreaterThan(String value) { - addCriterion("source_id >", value, "sourceId"); + public Criteria andPlatformGreaterThan(String value) { + addCriterion("platform >", value, "platform"); return (Criteria) this; } - public Criteria andSourceIdGreaterThanOrEqualTo(String value) { - addCriterion("source_id >=", value, "sourceId"); + public Criteria andPlatformGreaterThanOrEqualTo(String value) { + addCriterion("platform >=", value, "platform"); return (Criteria) this; } - public Criteria andSourceIdLessThan(String value) { - addCriterion("source_id <", value, "sourceId"); + public Criteria andPlatformLessThan(String value) { + addCriterion("platform <", value, "platform"); return (Criteria) this; } - public Criteria andSourceIdLessThanOrEqualTo(String value) { - addCriterion("source_id <=", value, "sourceId"); + public Criteria andPlatformLessThanOrEqualTo(String value) { + addCriterion("platform <=", value, "platform"); return (Criteria) this; } - public Criteria andSourceIdLike(String value) { - addCriterion("source_id like", value, "sourceId"); + public Criteria andPlatformLike(String value) { + addCriterion("platform like", value, "platform"); return (Criteria) this; } - public Criteria andSourceIdNotLike(String value) { - addCriterion("source_id not like", value, "sourceId"); + public Criteria andPlatformNotLike(String value) { + addCriterion("platform not like", value, "platform"); return (Criteria) this; } - public Criteria andSourceIdIn(List values) { - addCriterion("source_id in", values, "sourceId"); + public Criteria andPlatformIn(List values) { + addCriterion("platform in", values, "platform"); return (Criteria) this; } - public Criteria andSourceIdNotIn(List values) { - addCriterion("source_id not in", values, "sourceId"); + public Criteria andPlatformNotIn(List values) { + addCriterion("platform not in", values, "platform"); return (Criteria) this; } - public Criteria andSourceIdBetween(String value1, String value2) { - addCriterion("source_id between", value1, value2, "sourceId"); + public Criteria andPlatformBetween(String value1, String value2) { + addCriterion("platform between", value1, value2, "platform"); return (Criteria) this; } - public Criteria andSourceIdNotBetween(String value1, String value2) { - addCriterion("source_id not between", value1, value2, "sourceId"); + public Criteria andPlatformNotBetween(String value1, String value2) { + addCriterion("platform not between", value1, value2, "platform"); return (Criteria) this; } - public Criteria andPlatformStatusIsNull() { - addCriterion("platform_status is null"); + public Criteria andStatusIsNull() { + addCriterion("`status` is null"); return (Criteria) this; } - public Criteria andPlatformStatusIsNotNull() { - addCriterion("platform_status is not null"); + public Criteria andStatusIsNotNull() { + addCriterion("`status` is not null"); return (Criteria) this; } - public Criteria andPlatformStatusEqualTo(String value) { - addCriterion("platform_status =", value, "platformStatus"); + public Criteria andStatusEqualTo(String value) { + addCriterion("`status` =", value, "status"); return (Criteria) this; } - public Criteria andPlatformStatusNotEqualTo(String value) { - addCriterion("platform_status <>", value, "platformStatus"); + public Criteria andStatusNotEqualTo(String value) { + addCriterion("`status` <>", value, "status"); return (Criteria) this; } - public Criteria andPlatformStatusGreaterThan(String value) { - addCriterion("platform_status >", value, "platformStatus"); + public Criteria andStatusGreaterThan(String value) { + addCriterion("`status` >", value, "status"); return (Criteria) this; } - public Criteria andPlatformStatusGreaterThanOrEqualTo(String value) { - addCriterion("platform_status >=", value, "platformStatus"); + public Criteria andStatusGreaterThanOrEqualTo(String value) { + addCriterion("`status` >=", value, "status"); return (Criteria) this; } - public Criteria andPlatformStatusLessThan(String value) { - addCriterion("platform_status <", value, "platformStatus"); + public Criteria andStatusLessThan(String value) { + addCriterion("`status` <", value, "status"); return (Criteria) this; } - public Criteria andPlatformStatusLessThanOrEqualTo(String value) { - addCriterion("platform_status <=", value, "platformStatus"); + public Criteria andStatusLessThanOrEqualTo(String value) { + addCriterion("`status` <=", value, "status"); return (Criteria) this; } - public Criteria andPlatformStatusLike(String value) { - addCriterion("platform_status like", value, "platformStatus"); + public Criteria andStatusLike(String value) { + addCriterion("`status` like", value, "status"); return (Criteria) this; } - public Criteria andPlatformStatusNotLike(String value) { - addCriterion("platform_status not like", value, "platformStatus"); + public Criteria andStatusNotLike(String value) { + addCriterion("`status` not like", value, "status"); return (Criteria) this; } - public Criteria andPlatformStatusIn(List values) { - addCriterion("platform_status in", values, "platformStatus"); + public Criteria andStatusIn(List values) { + addCriterion("`status` in", values, "status"); return (Criteria) this; } - public Criteria andPlatformStatusNotIn(List values) { - addCriterion("platform_status not in", values, "platformStatus"); + public Criteria andStatusNotIn(List values) { + addCriterion("`status` not in", values, "status"); return (Criteria) this; } - public Criteria andPlatformStatusBetween(String value1, String value2) { - addCriterion("platform_status between", value1, value2, "platformStatus"); + public Criteria andStatusBetween(String value1, String value2) { + addCriterion("`status` between", value1, value2, "status"); return (Criteria) this; } - public Criteria andPlatformStatusNotBetween(String value1, String value2) { - addCriterion("platform_status not between", value1, value2, "platformStatus"); + public Criteria andStatusNotBetween(String value1, String value2) { + addCriterion("`status` not between", value1, value2, "status"); return (Criteria) this; } - public Criteria andPlatformIdIsNull() { - addCriterion("platform_id is null"); + public Criteria andPlatformBugIdIsNull() { + addCriterion("platform_bug_id is null"); return (Criteria) this; } - public Criteria andPlatformIdIsNotNull() { - addCriterion("platform_id is not null"); + public Criteria andPlatformBugIdIsNotNull() { + addCriterion("platform_bug_id is not null"); return (Criteria) this; } - public Criteria andPlatformIdEqualTo(String value) { - addCriterion("platform_id =", value, "platformId"); + public Criteria andPlatformBugIdEqualTo(String value) { + addCriterion("platform_bug_id =", value, "platformBugId"); return (Criteria) this; } - public Criteria andPlatformIdNotEqualTo(String value) { - addCriterion("platform_id <>", value, "platformId"); + public Criteria andPlatformBugIdNotEqualTo(String value) { + addCriterion("platform_bug_id <>", value, "platformBugId"); return (Criteria) this; } - public Criteria andPlatformIdGreaterThan(String value) { - addCriterion("platform_id >", value, "platformId"); + public Criteria andPlatformBugIdGreaterThan(String value) { + addCriterion("platform_bug_id >", value, "platformBugId"); return (Criteria) this; } - public Criteria andPlatformIdGreaterThanOrEqualTo(String value) { - addCriterion("platform_id >=", value, "platformId"); + public Criteria andPlatformBugIdGreaterThanOrEqualTo(String value) { + addCriterion("platform_bug_id >=", value, "platformBugId"); return (Criteria) this; } - public Criteria andPlatformIdLessThan(String value) { - addCriterion("platform_id <", value, "platformId"); + public Criteria andPlatformBugIdLessThan(String value) { + addCriterion("platform_bug_id <", value, "platformBugId"); return (Criteria) this; } - public Criteria andPlatformIdLessThanOrEqualTo(String value) { - addCriterion("platform_id <=", value, "platformId"); + public Criteria andPlatformBugIdLessThanOrEqualTo(String value) { + addCriterion("platform_bug_id <=", value, "platformBugId"); return (Criteria) this; } - public Criteria andPlatformIdLike(String value) { - addCriterion("platform_id like", value, "platformId"); + public Criteria andPlatformBugIdLike(String value) { + addCriterion("platform_bug_id like", value, "platformBugId"); return (Criteria) this; } - public Criteria andPlatformIdNotLike(String value) { - addCriterion("platform_id not like", value, "platformId"); + public Criteria andPlatformBugIdNotLike(String value) { + addCriterion("platform_bug_id not like", value, "platformBugId"); return (Criteria) this; } - public Criteria andPlatformIdIn(List values) { - addCriterion("platform_id in", values, "platformId"); + public Criteria andPlatformBugIdIn(List values) { + addCriterion("platform_bug_id in", values, "platformBugId"); return (Criteria) this; } - public Criteria andPlatformIdNotIn(List values) { - addCriterion("platform_id not in", values, "platformId"); + public Criteria andPlatformBugIdNotIn(List values) { + addCriterion("platform_bug_id not in", values, "platformBugId"); return (Criteria) this; } - public Criteria andPlatformIdBetween(String value1, String value2) { - addCriterion("platform_id between", value1, value2, "platformId"); + public Criteria andPlatformBugIdBetween(String value1, String value2) { + addCriterion("platform_bug_id between", value1, value2, "platformBugId"); return (Criteria) this; } - public Criteria andPlatformIdNotBetween(String value1, String value2) { - addCriterion("platform_id not between", value1, value2, "platformId"); + public Criteria andPlatformBugIdNotBetween(String value1, String value2) { + addCriterion("platform_bug_id not between", value1, value2, "platformBugId"); + return (Criteria) this; + } + + public Criteria andTrashIsNull() { + addCriterion("trash is null"); + return (Criteria) this; + } + + public Criteria andTrashIsNotNull() { + addCriterion("trash is not null"); + return (Criteria) this; + } + + public Criteria andTrashEqualTo(Boolean value) { + addCriterion("trash =", value, "trash"); + return (Criteria) this; + } + + public Criteria andTrashNotEqualTo(Boolean value) { + addCriterion("trash <>", value, "trash"); + return (Criteria) this; + } + + public Criteria andTrashGreaterThan(Boolean value) { + addCriterion("trash >", value, "trash"); + return (Criteria) this; + } + + public Criteria andTrashGreaterThanOrEqualTo(Boolean value) { + addCriterion("trash >=", value, "trash"); + return (Criteria) this; + } + + public Criteria andTrashLessThan(Boolean value) { + addCriterion("trash <", value, "trash"); + return (Criteria) this; + } + + public Criteria andTrashLessThanOrEqualTo(Boolean value) { + addCriterion("trash <=", value, "trash"); + return (Criteria) this; + } + + public Criteria andTrashIn(List values) { + addCriterion("trash in", values, "trash"); + return (Criteria) this; + } + + public Criteria andTrashNotIn(List values) { + addCriterion("trash not in", values, "trash"); + return (Criteria) this; + } + + public Criteria andTrashBetween(Boolean value1, Boolean value2) { + addCriterion("trash between", value1, value2, "trash"); + return (Criteria) this; + } + + public Criteria andTrashNotBetween(Boolean value1, Boolean value2) { + addCriterion("trash not between", value1, value2, "trash"); return (Criteria) this; } } diff --git a/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugFollower.java b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugFollower.java index 1bff933796..0592c35fa9 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugFollower.java +++ b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugFollower.java @@ -1,22 +1,99 @@ package io.metersphere.bug.domain; -import io.metersphere.validation.groups.*; +import io.metersphere.validation.groups.Created; +import io.metersphere.validation.groups.Updated; import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.*; -import java.io.Serializable; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Size; import lombok.Data; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; + @Data public class BugFollower implements Serializable { - @Schema(description = "缺陷ID", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "缺陷ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{bug_follower.bug_id.not_blank}", groups = {Created.class}) @Size(min = 1, max = 50, message = "{bug_follower.bug_id.length_range}", groups = {Created.class, Updated.class}) private String bugId; - @Schema(description = "关注人ID", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(description = "关注人ID", requiredMode = Schema.RequiredMode.REQUIRED) @NotBlank(message = "{bug_follower.user_id.not_blank}", groups = {Created.class}) @Size(min = 1, max = 50, message = "{bug_follower.user_id.length_range}", groups = {Created.class, Updated.class}) private String userId; private static final long serialVersionUID = 1L; + + public enum Column { + bugId("bug_id", "bugId", "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/bug/domain/BugFunctionalCase.java b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugFunctionalCase.java deleted file mode 100644 index ca9c38e76d..0000000000 --- a/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugFunctionalCase.java +++ /dev/null @@ -1,43 +0,0 @@ -package io.metersphere.bug.domain; - -import io.metersphere.validation.groups.*; -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.validation.constraints.*; -import java.io.Serializable; -import lombok.Data; - -@Data -public class BugFunctionalCase implements Serializable { - @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{bug_functional_case.id.not_blank}", groups = {Updated.class}) - @Size(min = 1, max = 50, message = "{bug_functional_case.id.length_range}", groups = {Created.class, Updated.class}) - private String id; - - @Schema(description = "功能用例或测试计划功能用例ID", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{bug_functional_case.resource_id.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 50, message = "{bug_functional_case.resource_id.length_range}", groups = {Created.class, Updated.class}) - private String resourceId; - - @Schema(description = "缺陷ID", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{bug_functional_case.bug_id.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 50, message = "{bug_functional_case.bug_id.length_range}", groups = {Created.class, Updated.class}) - private String bugId; - - @Schema(description = "关联的类型:关联功能用例/关联测试计划功能用例", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{bug_functional_case.ref_type.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 64, message = "{bug_functional_case.ref_type.length_range}", groups = {Created.class, Updated.class}) - private String refType; - - @Schema(description = "测试计划的用例所指向的用例的id", requiredMode = Schema.RequiredMode.REQUIRED) - @NotBlank(message = "{bug_functional_case.ref_id.not_blank}", groups = {Created.class}) - @Size(min = 1, max = 50, message = "{bug_functional_case.ref_id.length_range}", groups = {Created.class, Updated.class}) - private String refId; - - @Schema(description = "创建时间") - private Long createTime; - - @Schema(description = "更新时间") - private Long updateTime; - - private static final long serialVersionUID = 1L; -} \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugHistory.java b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugHistory.java new file mode 100644 index 0000000000..f24cad2d00 --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugHistory.java @@ -0,0 +1,117 @@ +package io.metersphere.bug.domain; + +import io.metersphere.validation.groups.Created; +import io.metersphere.validation.groups.Updated; +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 java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; + +@Data +public class BugHistory implements Serializable { + @Schema(description = "变更记录ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{bug_history.id.not_blank}", groups = {Updated.class}) + @Size(min = 1, max = 50, message = "{bug_history.id.length_range}", groups = {Created.class, Updated.class}) + private String id; + + @Schema(description = "所属缺陷ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{bug_history.bug_id.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{bug_history.bug_id.length_range}", groups = {Created.class, Updated.class}) + private String bugId; + + @Schema(description = "变更记录批次号") + private Integer num; + + @Schema(description = "操作人") + private String createUser; + + @Schema(description = "操作时间") + private Long createTime; + + @Schema(description = "修改内容", requiredMode = Schema.RequiredMode.REQUIRED) + @NotNull(message = "{bug_history.content.not_blank}", groups = {Created.class}) + private byte[] content; + + private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + bugId("bug_id", "bugId", "VARCHAR", false), + num("num", "num", "INTEGER", false), + createUser("create_user", "createUser", "VARCHAR", false), + createTime("create_time", "createTime", "BIGINT", false), + content("content", "content", "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/bug/domain/BugFunctionalCaseExample.java b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugHistoryExample.java similarity index 61% rename from backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugFunctionalCaseExample.java rename to backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugHistoryExample.java index 1b45a38185..577e10072f 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugFunctionalCaseExample.java +++ b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugHistoryExample.java @@ -3,14 +3,14 @@ package io.metersphere.bug.domain; import java.util.ArrayList; import java.util.List; -public class BugFunctionalCaseExample { +public class BugHistoryExample { protected String orderByClause; protected boolean distinct; protected List oredCriteria; - public BugFunctionalCaseExample() { + public BugHistoryExample() { oredCriteria = new ArrayList(); } @@ -174,76 +174,6 @@ public class BugFunctionalCaseExample { return (Criteria) this; } - public Criteria andResourceIdIsNull() { - addCriterion("resource_id is null"); - return (Criteria) this; - } - - public Criteria andResourceIdIsNotNull() { - addCriterion("resource_id is not null"); - return (Criteria) this; - } - - public Criteria andResourceIdEqualTo(String value) { - addCriterion("resource_id =", value, "resourceId"); - return (Criteria) this; - } - - public Criteria andResourceIdNotEqualTo(String value) { - addCriterion("resource_id <>", value, "resourceId"); - return (Criteria) this; - } - - public Criteria andResourceIdGreaterThan(String value) { - addCriterion("resource_id >", value, "resourceId"); - return (Criteria) this; - } - - public Criteria andResourceIdGreaterThanOrEqualTo(String value) { - addCriterion("resource_id >=", value, "resourceId"); - return (Criteria) this; - } - - public Criteria andResourceIdLessThan(String value) { - addCriterion("resource_id <", value, "resourceId"); - return (Criteria) this; - } - - public Criteria andResourceIdLessThanOrEqualTo(String value) { - addCriterion("resource_id <=", value, "resourceId"); - return (Criteria) this; - } - - public Criteria andResourceIdLike(String value) { - addCriterion("resource_id like", value, "resourceId"); - return (Criteria) this; - } - - public Criteria andResourceIdNotLike(String value) { - addCriterion("resource_id not like", value, "resourceId"); - return (Criteria) this; - } - - public Criteria andResourceIdIn(List values) { - addCriterion("resource_id in", values, "resourceId"); - return (Criteria) this; - } - - public Criteria andResourceIdNotIn(List values) { - addCriterion("resource_id not in", values, "resourceId"); - return (Criteria) this; - } - - public Criteria andResourceIdBetween(String value1, String value2) { - addCriterion("resource_id between", value1, value2, "resourceId"); - return (Criteria) this; - } - - public Criteria andResourceIdNotBetween(String value1, String value2) { - addCriterion("resource_id not between", value1, value2, "resourceId"); - return (Criteria) this; - } - public Criteria andBugIdIsNull() { addCriterion("bug_id is null"); return (Criteria) this; @@ -314,143 +244,133 @@ public class BugFunctionalCaseExample { return (Criteria) this; } - public Criteria andRefTypeIsNull() { - addCriterion("ref_type is null"); + public Criteria andNumIsNull() { + addCriterion("num is null"); return (Criteria) this; } - public Criteria andRefTypeIsNotNull() { - addCriterion("ref_type is not null"); + public Criteria andNumIsNotNull() { + addCriterion("num is not null"); return (Criteria) this; } - public Criteria andRefTypeEqualTo(String value) { - addCriterion("ref_type =", value, "refType"); + public Criteria andNumEqualTo(Integer value) { + addCriterion("num =", value, "num"); return (Criteria) this; } - public Criteria andRefTypeNotEqualTo(String value) { - addCriterion("ref_type <>", value, "refType"); + public Criteria andNumNotEqualTo(Integer value) { + addCriterion("num <>", value, "num"); return (Criteria) this; } - public Criteria andRefTypeGreaterThan(String value) { - addCriterion("ref_type >", value, "refType"); + public Criteria andNumGreaterThan(Integer value) { + addCriterion("num >", value, "num"); return (Criteria) this; } - public Criteria andRefTypeGreaterThanOrEqualTo(String value) { - addCriterion("ref_type >=", value, "refType"); + public Criteria andNumGreaterThanOrEqualTo(Integer value) { + addCriterion("num >=", value, "num"); return (Criteria) this; } - public Criteria andRefTypeLessThan(String value) { - addCriterion("ref_type <", value, "refType"); + public Criteria andNumLessThan(Integer value) { + addCriterion("num <", value, "num"); return (Criteria) this; } - public Criteria andRefTypeLessThanOrEqualTo(String value) { - addCriterion("ref_type <=", value, "refType"); + public Criteria andNumLessThanOrEqualTo(Integer value) { + addCriterion("num <=", value, "num"); return (Criteria) this; } - public Criteria andRefTypeLike(String value) { - addCriterion("ref_type like", value, "refType"); + public Criteria andNumIn(List values) { + addCriterion("num in", values, "num"); return (Criteria) this; } - public Criteria andRefTypeNotLike(String value) { - addCriterion("ref_type not like", value, "refType"); + public Criteria andNumNotIn(List values) { + addCriterion("num not in", values, "num"); return (Criteria) this; } - public Criteria andRefTypeIn(List values) { - addCriterion("ref_type in", values, "refType"); + public Criteria andNumBetween(Integer value1, Integer value2) { + addCriterion("num between", value1, value2, "num"); return (Criteria) this; } - public Criteria andRefTypeNotIn(List values) { - addCriterion("ref_type not in", values, "refType"); + public Criteria andNumNotBetween(Integer value1, Integer value2) { + addCriterion("num not between", value1, value2, "num"); return (Criteria) this; } - public Criteria andRefTypeBetween(String value1, String value2) { - addCriterion("ref_type between", value1, value2, "refType"); + public Criteria andCreateUserIsNull() { + addCriterion("create_user is null"); return (Criteria) this; } - public Criteria andRefTypeNotBetween(String value1, String value2) { - addCriterion("ref_type not between", value1, value2, "refType"); + public Criteria andCreateUserIsNotNull() { + addCriterion("create_user is not null"); return (Criteria) this; } - public Criteria andRefIdIsNull() { - addCriterion("ref_id is null"); + public Criteria andCreateUserEqualTo(String value) { + addCriterion("create_user =", value, "createUser"); return (Criteria) this; } - public Criteria andRefIdIsNotNull() { - addCriterion("ref_id is not null"); + public Criteria andCreateUserNotEqualTo(String value) { + addCriterion("create_user <>", value, "createUser"); return (Criteria) this; } - public Criteria andRefIdEqualTo(String value) { - addCriterion("ref_id =", value, "refId"); + public Criteria andCreateUserGreaterThan(String value) { + addCriterion("create_user >", value, "createUser"); return (Criteria) this; } - public Criteria andRefIdNotEqualTo(String value) { - addCriterion("ref_id <>", value, "refId"); + public Criteria andCreateUserGreaterThanOrEqualTo(String value) { + addCriterion("create_user >=", value, "createUser"); return (Criteria) this; } - public Criteria andRefIdGreaterThan(String value) { - addCriterion("ref_id >", value, "refId"); + public Criteria andCreateUserLessThan(String value) { + addCriterion("create_user <", value, "createUser"); return (Criteria) this; } - public Criteria andRefIdGreaterThanOrEqualTo(String value) { - addCriterion("ref_id >=", value, "refId"); + public Criteria andCreateUserLessThanOrEqualTo(String value) { + addCriterion("create_user <=", value, "createUser"); return (Criteria) this; } - public Criteria andRefIdLessThan(String value) { - addCriterion("ref_id <", value, "refId"); + public Criteria andCreateUserLike(String value) { + addCriterion("create_user like", value, "createUser"); return (Criteria) this; } - public Criteria andRefIdLessThanOrEqualTo(String value) { - addCriterion("ref_id <=", value, "refId"); + public Criteria andCreateUserNotLike(String value) { + addCriterion("create_user not like", value, "createUser"); return (Criteria) this; } - public Criteria andRefIdLike(String value) { - addCriterion("ref_id like", value, "refId"); + public Criteria andCreateUserIn(List values) { + addCriterion("create_user in", values, "createUser"); return (Criteria) this; } - public Criteria andRefIdNotLike(String value) { - addCriterion("ref_id not like", value, "refId"); + public Criteria andCreateUserNotIn(List values) { + addCriterion("create_user not in", values, "createUser"); return (Criteria) this; } - public Criteria andRefIdIn(List values) { - addCriterion("ref_id in", values, "refId"); + public Criteria andCreateUserBetween(String value1, String value2) { + addCriterion("create_user between", value1, value2, "createUser"); return (Criteria) this; } - public Criteria andRefIdNotIn(List values) { - addCriterion("ref_id not in", values, "refId"); - return (Criteria) this; - } - - public Criteria andRefIdBetween(String value1, String value2) { - addCriterion("ref_id between", value1, value2, "refId"); - return (Criteria) this; - } - - public Criteria andRefIdNotBetween(String value1, String value2) { - addCriterion("ref_id not between", value1, value2, "refId"); + public Criteria andCreateUserNotBetween(String value1, String value2) { + addCriterion("create_user not between", value1, value2, "createUser"); return (Criteria) this; } @@ -513,66 +433,6 @@ public class BugFunctionalCaseExample { addCriterion("create_time not between", value1, value2, "createTime"); return (Criteria) this; } - - public Criteria andUpdateTimeIsNull() { - addCriterion("update_time is null"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIsNotNull() { - addCriterion("update_time is not null"); - return (Criteria) this; - } - - public Criteria andUpdateTimeEqualTo(Long value) { - addCriterion("update_time =", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotEqualTo(Long value) { - addCriterion("update_time <>", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeGreaterThan(Long value) { - addCriterion("update_time >", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeGreaterThanOrEqualTo(Long value) { - addCriterion("update_time >=", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeLessThan(Long value) { - addCriterion("update_time <", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeLessThanOrEqualTo(Long value) { - addCriterion("update_time <=", value, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeIn(List values) { - addCriterion("update_time in", values, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotIn(List values) { - addCriterion("update_time not in", values, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeBetween(Long value1, Long value2) { - addCriterion("update_time between", value1, value2, "updateTime"); - return (Criteria) this; - } - - public Criteria andUpdateTimeNotBetween(Long value1, Long value2) { - addCriterion("update_time not between", value1, value2, "updateTime"); - return (Criteria) this; - } } public static class Criteria extends GeneratedCriteria { diff --git a/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugRelationCase.java b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugRelationCase.java new file mode 100644 index 0000000000..59b5cae9de --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugRelationCase.java @@ -0,0 +1,131 @@ +package io.metersphere.bug.domain; + +import io.metersphere.validation.groups.Created; +import io.metersphere.validation.groups.Updated; +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Size; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; + +@Data +public class BugRelationCase implements Serializable { + @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{bug_relation_case.id.not_blank}", groups = {Updated.class}) + @Size(min = 1, max = 50, message = "{bug_relation_case.id.length_range}", groups = {Created.class, Updated.class}) + private String id; + + @Schema(description = "关联功能用例ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{bug_relation_case.case_id.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{bug_relation_case.case_id.length_range}", groups = {Created.class, Updated.class}) + private String caseId; + + @Schema(description = "缺陷ID", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{bug_relation_case.bug_id.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 50, message = "{bug_relation_case.bug_id.length_range}", groups = {Created.class, Updated.class}) + private String bugId; + + @Schema(description = "关联的用例类型;functional/api/ui/performance", requiredMode = Schema.RequiredMode.REQUIRED) + @NotBlank(message = "{bug_relation_case.case_type.not_blank}", groups = {Created.class}) + @Size(min = 1, max = 64, message = "{bug_relation_case.case_type.length_range}", groups = {Created.class, Updated.class}) + private String caseType; + + @Schema(description = "关联测试计划ID") + private String testPlanId; + + @Schema(description = "关联测试计划用例ID") + private String testPlanCaseId; + + @Schema(description = "创建人") + private String createUser; + + @Schema(description = "创建时间") + private Long createTime; + + @Schema(description = "更新时间") + private Long updateTime; + + private static final long serialVersionUID = 1L; + + public enum Column { + id("id", "id", "VARCHAR", false), + caseId("case_id", "caseId", "VARCHAR", false), + bugId("bug_id", "bugId", "VARCHAR", false), + caseType("case_type", "caseType", "VARCHAR", false), + testPlanId("test_plan_id", "testPlanId", "VARCHAR", false), + testPlanCaseId("test_plan_case_id", "testPlanCaseId", "VARCHAR", false), + createUser("create_user", "createUser", "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/bug/domain/BugRelationCaseExample.java b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugRelationCaseExample.java new file mode 100644 index 0000000000..d0b5b83cb4 --- /dev/null +++ b/backend/framework/domain/src/main/java/io/metersphere/bug/domain/BugRelationCaseExample.java @@ -0,0 +1,810 @@ +package io.metersphere.bug.domain; + +import java.util.ArrayList; +import java.util.List; + +public class BugRelationCaseExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public BugRelationCaseExample() { + oredCriteria = new ArrayList(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(String value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(String value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(String value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(String value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(String value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(String value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLike(String value) { + addCriterion("id like", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotLike(String value) { + addCriterion("id not like", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(String value1, String value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(String value1, String value2) { + addCriterion("id not between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andCaseIdIsNull() { + addCriterion("case_id is null"); + return (Criteria) this; + } + + public Criteria andCaseIdIsNotNull() { + addCriterion("case_id is not null"); + return (Criteria) this; + } + + public Criteria andCaseIdEqualTo(String value) { + addCriterion("case_id =", value, "caseId"); + return (Criteria) this; + } + + public Criteria andCaseIdNotEqualTo(String value) { + addCriterion("case_id <>", value, "caseId"); + return (Criteria) this; + } + + public Criteria andCaseIdGreaterThan(String value) { + addCriterion("case_id >", value, "caseId"); + return (Criteria) this; + } + + public Criteria andCaseIdGreaterThanOrEqualTo(String value) { + addCriterion("case_id >=", value, "caseId"); + return (Criteria) this; + } + + public Criteria andCaseIdLessThan(String value) { + addCriterion("case_id <", value, "caseId"); + return (Criteria) this; + } + + public Criteria andCaseIdLessThanOrEqualTo(String value) { + addCriterion("case_id <=", value, "caseId"); + return (Criteria) this; + } + + public Criteria andCaseIdLike(String value) { + addCriterion("case_id like", value, "caseId"); + return (Criteria) this; + } + + public Criteria andCaseIdNotLike(String value) { + addCriterion("case_id not like", value, "caseId"); + return (Criteria) this; + } + + public Criteria andCaseIdIn(List values) { + addCriterion("case_id in", values, "caseId"); + return (Criteria) this; + } + + public Criteria andCaseIdNotIn(List values) { + addCriterion("case_id not in", values, "caseId"); + return (Criteria) this; + } + + public Criteria andCaseIdBetween(String value1, String value2) { + addCriterion("case_id between", value1, value2, "caseId"); + return (Criteria) this; + } + + public Criteria andCaseIdNotBetween(String value1, String value2) { + addCriterion("case_id not between", value1, value2, "caseId"); + return (Criteria) this; + } + + public Criteria andBugIdIsNull() { + addCriterion("bug_id is null"); + return (Criteria) this; + } + + public Criteria andBugIdIsNotNull() { + addCriterion("bug_id is not null"); + return (Criteria) this; + } + + public Criteria andBugIdEqualTo(String value) { + addCriterion("bug_id =", value, "bugId"); + return (Criteria) this; + } + + public Criteria andBugIdNotEqualTo(String value) { + addCriterion("bug_id <>", value, "bugId"); + return (Criteria) this; + } + + public Criteria andBugIdGreaterThan(String value) { + addCriterion("bug_id >", value, "bugId"); + return (Criteria) this; + } + + public Criteria andBugIdGreaterThanOrEqualTo(String value) { + addCriterion("bug_id >=", value, "bugId"); + return (Criteria) this; + } + + public Criteria andBugIdLessThan(String value) { + addCriterion("bug_id <", value, "bugId"); + return (Criteria) this; + } + + public Criteria andBugIdLessThanOrEqualTo(String value) { + addCriterion("bug_id <=", value, "bugId"); + return (Criteria) this; + } + + public Criteria andBugIdLike(String value) { + addCriterion("bug_id like", value, "bugId"); + return (Criteria) this; + } + + public Criteria andBugIdNotLike(String value) { + addCriterion("bug_id not like", value, "bugId"); + return (Criteria) this; + } + + public Criteria andBugIdIn(List values) { + addCriterion("bug_id in", values, "bugId"); + return (Criteria) this; + } + + public Criteria andBugIdNotIn(List values) { + addCriterion("bug_id not in", values, "bugId"); + return (Criteria) this; + } + + public Criteria andBugIdBetween(String value1, String value2) { + addCriterion("bug_id between", value1, value2, "bugId"); + return (Criteria) this; + } + + public Criteria andBugIdNotBetween(String value1, String value2) { + addCriterion("bug_id not between", value1, value2, "bugId"); + return (Criteria) this; + } + + public Criteria andCaseTypeIsNull() { + addCriterion("case_type is null"); + return (Criteria) this; + } + + public Criteria andCaseTypeIsNotNull() { + addCriterion("case_type is not null"); + return (Criteria) this; + } + + public Criteria andCaseTypeEqualTo(String value) { + addCriterion("case_type =", value, "caseType"); + return (Criteria) this; + } + + public Criteria andCaseTypeNotEqualTo(String value) { + addCriterion("case_type <>", value, "caseType"); + return (Criteria) this; + } + + public Criteria andCaseTypeGreaterThan(String value) { + addCriterion("case_type >", value, "caseType"); + return (Criteria) this; + } + + public Criteria andCaseTypeGreaterThanOrEqualTo(String value) { + addCriterion("case_type >=", value, "caseType"); + return (Criteria) this; + } + + public Criteria andCaseTypeLessThan(String value) { + addCriterion("case_type <", value, "caseType"); + return (Criteria) this; + } + + public Criteria andCaseTypeLessThanOrEqualTo(String value) { + addCriterion("case_type <=", value, "caseType"); + return (Criteria) this; + } + + public Criteria andCaseTypeLike(String value) { + addCriterion("case_type like", value, "caseType"); + return (Criteria) this; + } + + public Criteria andCaseTypeNotLike(String value) { + addCriterion("case_type not like", value, "caseType"); + return (Criteria) this; + } + + public Criteria andCaseTypeIn(List values) { + addCriterion("case_type in", values, "caseType"); + return (Criteria) this; + } + + public Criteria andCaseTypeNotIn(List values) { + addCriterion("case_type not in", values, "caseType"); + return (Criteria) this; + } + + public Criteria andCaseTypeBetween(String value1, String value2) { + addCriterion("case_type between", value1, value2, "caseType"); + return (Criteria) this; + } + + public Criteria andCaseTypeNotBetween(String value1, String value2) { + addCriterion("case_type not between", value1, value2, "caseType"); + return (Criteria) this; + } + + public Criteria andTestPlanIdIsNull() { + addCriterion("test_plan_id is null"); + return (Criteria) this; + } + + public Criteria andTestPlanIdIsNotNull() { + addCriterion("test_plan_id is not null"); + return (Criteria) this; + } + + public Criteria andTestPlanIdEqualTo(String value) { + addCriterion("test_plan_id =", value, "testPlanId"); + return (Criteria) this; + } + + public Criteria andTestPlanIdNotEqualTo(String value) { + addCriterion("test_plan_id <>", value, "testPlanId"); + return (Criteria) this; + } + + public Criteria andTestPlanIdGreaterThan(String value) { + addCriterion("test_plan_id >", value, "testPlanId"); + return (Criteria) this; + } + + public Criteria andTestPlanIdGreaterThanOrEqualTo(String value) { + addCriterion("test_plan_id >=", value, "testPlanId"); + return (Criteria) this; + } + + public Criteria andTestPlanIdLessThan(String value) { + addCriterion("test_plan_id <", value, "testPlanId"); + return (Criteria) this; + } + + public Criteria andTestPlanIdLessThanOrEqualTo(String value) { + addCriterion("test_plan_id <=", value, "testPlanId"); + return (Criteria) this; + } + + public Criteria andTestPlanIdLike(String value) { + addCriterion("test_plan_id like", value, "testPlanId"); + return (Criteria) this; + } + + public Criteria andTestPlanIdNotLike(String value) { + addCriterion("test_plan_id not like", value, "testPlanId"); + return (Criteria) this; + } + + public Criteria andTestPlanIdIn(List values) { + addCriterion("test_plan_id in", values, "testPlanId"); + return (Criteria) this; + } + + public Criteria andTestPlanIdNotIn(List values) { + addCriterion("test_plan_id not in", values, "testPlanId"); + return (Criteria) this; + } + + public Criteria andTestPlanIdBetween(String value1, String value2) { + addCriterion("test_plan_id between", value1, value2, "testPlanId"); + return (Criteria) this; + } + + public Criteria andTestPlanIdNotBetween(String value1, String value2) { + addCriterion("test_plan_id not between", value1, value2, "testPlanId"); + return (Criteria) this; + } + + public Criteria andTestPlanCaseIdIsNull() { + addCriterion("test_plan_case_id is null"); + return (Criteria) this; + } + + public Criteria andTestPlanCaseIdIsNotNull() { + addCriterion("test_plan_case_id is not null"); + return (Criteria) this; + } + + public Criteria andTestPlanCaseIdEqualTo(String value) { + addCriterion("test_plan_case_id =", value, "testPlanCaseId"); + return (Criteria) this; + } + + public Criteria andTestPlanCaseIdNotEqualTo(String value) { + addCriterion("test_plan_case_id <>", value, "testPlanCaseId"); + return (Criteria) this; + } + + public Criteria andTestPlanCaseIdGreaterThan(String value) { + addCriterion("test_plan_case_id >", value, "testPlanCaseId"); + return (Criteria) this; + } + + public Criteria andTestPlanCaseIdGreaterThanOrEqualTo(String value) { + addCriterion("test_plan_case_id >=", value, "testPlanCaseId"); + return (Criteria) this; + } + + public Criteria andTestPlanCaseIdLessThan(String value) { + addCriterion("test_plan_case_id <", value, "testPlanCaseId"); + return (Criteria) this; + } + + public Criteria andTestPlanCaseIdLessThanOrEqualTo(String value) { + addCriterion("test_plan_case_id <=", value, "testPlanCaseId"); + return (Criteria) this; + } + + public Criteria andTestPlanCaseIdLike(String value) { + addCriterion("test_plan_case_id like", value, "testPlanCaseId"); + return (Criteria) this; + } + + public Criteria andTestPlanCaseIdNotLike(String value) { + addCriterion("test_plan_case_id not like", value, "testPlanCaseId"); + return (Criteria) this; + } + + public Criteria andTestPlanCaseIdIn(List values) { + addCriterion("test_plan_case_id in", values, "testPlanCaseId"); + return (Criteria) this; + } + + public Criteria andTestPlanCaseIdNotIn(List values) { + addCriterion("test_plan_case_id not in", values, "testPlanCaseId"); + return (Criteria) this; + } + + public Criteria andTestPlanCaseIdBetween(String value1, String value2) { + addCriterion("test_plan_case_id between", value1, value2, "testPlanCaseId"); + return (Criteria) this; + } + + public Criteria andTestPlanCaseIdNotBetween(String value1, String value2) { + addCriterion("test_plan_case_id not between", value1, value2, "testPlanCaseId"); + return (Criteria) this; + } + + public Criteria andCreateUserIsNull() { + addCriterion("create_user is null"); + return (Criteria) this; + } + + public Criteria andCreateUserIsNotNull() { + addCriterion("create_user is not null"); + return (Criteria) this; + } + + public Criteria andCreateUserEqualTo(String value) { + addCriterion("create_user =", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserNotEqualTo(String value) { + addCriterion("create_user <>", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserGreaterThan(String value) { + addCriterion("create_user >", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserGreaterThanOrEqualTo(String value) { + addCriterion("create_user >=", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserLessThan(String value) { + addCriterion("create_user <", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserLessThanOrEqualTo(String value) { + addCriterion("create_user <=", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserLike(String value) { + addCriterion("create_user like", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserNotLike(String value) { + addCriterion("create_user not like", value, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserIn(List values) { + addCriterion("create_user in", values, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserNotIn(List values) { + addCriterion("create_user not in", values, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserBetween(String value1, String value2) { + addCriterion("create_user between", value1, value2, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateUserNotBetween(String value1, String value2) { + addCriterion("create_user not between", value1, value2, "createUser"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNull() { + addCriterion("create_time is null"); + return (Criteria) this; + } + + public Criteria andCreateTimeIsNotNull() { + addCriterion("create_time is not null"); + return (Criteria) this; + } + + public Criteria andCreateTimeEqualTo(Long value) { + addCriterion("create_time =", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotEqualTo(Long value) { + addCriterion("create_time <>", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThan(Long value) { + addCriterion("create_time >", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) { + addCriterion("create_time >=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThan(Long value) { + addCriterion("create_time <", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeLessThanOrEqualTo(Long value) { + addCriterion("create_time <=", value, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeIn(List values) { + addCriterion("create_time in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotIn(List values) { + addCriterion("create_time not in", values, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeBetween(Long value1, Long value2) { + addCriterion("create_time between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andCreateTimeNotBetween(Long value1, Long value2) { + addCriterion("create_time not between", value1, value2, "createTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNull() { + addCriterion("update_time is null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIsNotNull() { + addCriterion("update_time is not null"); + return (Criteria) this; + } + + public Criteria andUpdateTimeEqualTo(Long value) { + addCriterion("update_time =", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotEqualTo(Long value) { + addCriterion("update_time <>", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThan(Long value) { + addCriterion("update_time >", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeGreaterThanOrEqualTo(Long value) { + addCriterion("update_time >=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThan(Long value) { + addCriterion("update_time <", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeLessThanOrEqualTo(Long value) { + addCriterion("update_time <=", value, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeIn(List values) { + addCriterion("update_time in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotIn(List values) { + addCriterion("update_time not in", values, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeBetween(Long value1, Long value2) { + addCriterion("update_time between", value1, value2, "updateTime"); + return (Criteria) this; + } + + public Criteria andUpdateTimeNotBetween(Long value1, Long value2) { + addCriterion("update_time not between", value1, value2, "updateTime"); + return (Criteria) this; + } + } + + public static class Criteria extends GeneratedCriteria { + + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/bug/mapper/BugAttachmentMapper.java b/backend/framework/domain/src/main/java/io/metersphere/bug/mapper/BugAttachmentMapper.java index 1bc5a90680..ece0a4ebb0 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/bug/mapper/BugAttachmentMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/bug/mapper/BugAttachmentMapper.java @@ -2,15 +2,16 @@ package io.metersphere.bug.mapper; import io.metersphere.bug.domain.BugAttachment; import io.metersphere.bug.domain.BugAttachmentExample; -import java.util.List; import org.apache.ibatis.annotations.Param; +import java.util.List; + public interface BugAttachmentMapper { long countByExample(BugAttachmentExample example); int deleteByExample(BugAttachmentExample example); - int deleteByPrimaryKey(@Param("bugId") String bugId, @Param("fileId") String fileId); + int deleteByPrimaryKey(String id); int insert(BugAttachment record); @@ -18,7 +19,17 @@ public interface BugAttachmentMapper { List selectByExample(BugAttachmentExample example); + BugAttachment selectByPrimaryKey(String id); + int updateByExampleSelective(@Param("record") BugAttachment record, @Param("example") BugAttachmentExample example); int updateByExample(@Param("record") BugAttachment record, @Param("example") BugAttachmentExample example); + + int updateByPrimaryKeySelective(BugAttachment record); + + int updateByPrimaryKey(BugAttachment record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") BugAttachment.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/bug/mapper/BugAttachmentMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/bug/mapper/BugAttachmentMapper.xml index 153ede1098..4c6ca52ec8 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/bug/mapper/BugAttachmentMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/bug/mapper/BugAttachmentMapper.xml @@ -2,8 +2,14 @@ - - + + + + + + + + @@ -64,7 +70,7 @@ - bug_id, file_id + id, bug_id, file_id, file_name, `size`, association, create_user, create_time - + + delete from bug_attachment - where bug_id = #{bugId,jdbcType=VARCHAR} - and file_id = #{fileId,jdbcType=VARCHAR} + where id = #{id,jdbcType=VARCHAR} delete from bug_attachment @@ -92,26 +103,66 @@ - insert into bug_attachment (bug_id, file_id) - values (#{bugId,jdbcType=VARCHAR}, #{fileId,jdbcType=VARCHAR}) + insert into bug_attachment (id, bug_id, file_id, + file_name, `size`, association, + create_user, create_time) + values (#{id,jdbcType=VARCHAR}, #{bugId,jdbcType=VARCHAR}, #{fileId,jdbcType=VARCHAR}, + #{fileName,jdbcType=VARCHAR}, #{size,jdbcType=BIGINT}, #{association,jdbcType=BIT}, + #{createUser,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}) insert into bug_attachment + + id, + bug_id, file_id, + + file_name, + + + `size`, + + + association, + + + create_user, + + + create_time, + + + #{id,jdbcType=VARCHAR}, + #{bugId,jdbcType=VARCHAR}, #{fileId,jdbcType=VARCHAR}, + + #{fileName,jdbcType=VARCHAR}, + + + #{size,jdbcType=BIGINT}, + + + #{association,jdbcType=BIT}, + + + #{createUser,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=BIGINT}, + + - select distinct - from bug_blob + from bug_content @@ -106,53 +106,53 @@ , - from bug_blob - where id = #{id,jdbcType=VARCHAR} + from bug_content + where bug_id = #{bugId,jdbcType=VARCHAR} - delete from bug_blob - where id = #{id,jdbcType=VARCHAR} + delete from bug_content + where bug_id = #{bugId,jdbcType=VARCHAR} - - delete from bug_blob + + delete from bug_content - - insert into bug_blob (id, description) - values (#{id,jdbcType=VARCHAR}, #{description,jdbcType=LONGVARCHAR}) + + insert into bug_content (bug_id, description) + values (#{bugId,jdbcType=VARCHAR}, #{description,jdbcType=LONGVARCHAR}) - - insert into bug_blob + + insert into bug_content - - id, + + bug_id, description, - - #{id,jdbcType=VARCHAR}, + + #{bugId,jdbcType=VARCHAR}, #{description,jdbcType=LONGVARCHAR}, - + select count(*) from bug_content - update bug_blob + update bug_content - - id = #{record.id,jdbcType=VARCHAR}, + + bug_id = #{record.bugId,jdbcType=VARCHAR}, description = #{record.description,jdbcType=LONGVARCHAR}, @@ -163,32 +163,60 @@ - update bug_blob - set id = #{record.id,jdbcType=VARCHAR}, + update bug_content + set bug_id = #{record.bugId,jdbcType=VARCHAR}, description = #{record.description,jdbcType=LONGVARCHAR} - update bug_blob - set id = #{record.id,jdbcType=VARCHAR} + update bug_content + set bug_id = #{record.bugId,jdbcType=VARCHAR} - - update bug_blob + + update bug_content description = #{description,jdbcType=LONGVARCHAR}, - where id = #{id,jdbcType=VARCHAR} + where bug_id = #{bugId,jdbcType=VARCHAR} - - update bug_blob + + update bug_content set description = #{description,jdbcType=LONGVARCHAR} - where id = #{id,jdbcType=VARCHAR} + where bug_id = #{bugId,jdbcType=VARCHAR} + + insert into bug_content + (bug_id, description) + values + + (#{item.bugId,jdbcType=VARCHAR}, #{item.description,jdbcType=LONGVARCHAR}) + + + + insert into bug_content ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.bugId,jdbcType=VARCHAR} + + + #{item.description,jdbcType=LONGVARCHAR} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/bug/mapper/BugCustomFieldMapper.java b/backend/framework/domain/src/main/java/io/metersphere/bug/mapper/BugCustomFieldMapper.java index 9c862ee0f2..20f2758296 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/bug/mapper/BugCustomFieldMapper.java +++ b/backend/framework/domain/src/main/java/io/metersphere/bug/mapper/BugCustomFieldMapper.java @@ -2,35 +2,34 @@ package io.metersphere.bug.mapper; import io.metersphere.bug.domain.BugCustomField; import io.metersphere.bug.domain.BugCustomFieldExample; -import java.util.List; import org.apache.ibatis.annotations.Param; +import java.util.List; + public interface BugCustomFieldMapper { long countByExample(BugCustomFieldExample example); int deleteByExample(BugCustomFieldExample example); - int deleteByPrimaryKey(@Param("bugId") String bugId, @Param("fieldId") String fieldId); + int deleteByPrimaryKey(String bugId); int insert(BugCustomField record); int insertSelective(BugCustomField record); - List selectByExampleWithBLOBs(BugCustomFieldExample example); - List selectByExample(BugCustomFieldExample example); - BugCustomField selectByPrimaryKey(@Param("bugId") String bugId, @Param("fieldId") String fieldId); + BugCustomField selectByPrimaryKey(String bugId); int updateByExampleSelective(@Param("record") BugCustomField record, @Param("example") BugCustomFieldExample example); - int updateByExampleWithBLOBs(@Param("record") BugCustomField record, @Param("example") BugCustomFieldExample example); - int updateByExample(@Param("record") BugCustomField record, @Param("example") BugCustomFieldExample example); int updateByPrimaryKeySelective(BugCustomField record); - int updateByPrimaryKeyWithBLOBs(BugCustomField record); - int updateByPrimaryKey(BugCustomField record); + + int batchInsert(@Param("list") List list); + + int batchInsertSelective(@Param("list") List list, @Param("selective") BugCustomField.Column ... selective); } \ No newline at end of file diff --git a/backend/framework/domain/src/main/java/io/metersphere/bug/mapper/BugCustomFieldMapper.xml b/backend/framework/domain/src/main/java/io/metersphere/bug/mapper/BugCustomFieldMapper.xml index 3bd899ffa9..b59acfe154 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/bug/mapper/BugCustomFieldMapper.xml +++ b/backend/framework/domain/src/main/java/io/metersphere/bug/mapper/BugCustomFieldMapper.xml @@ -3,12 +3,9 @@ - + - - - @@ -70,25 +67,6 @@ bug_id, field_id, `value` - - text_value - - - select - , - from bug_custom_field where bug_id = #{bugId,jdbcType=VARCHAR} - and field_id = #{fieldId,jdbcType=VARCHAR} - + delete from bug_custom_field where bug_id = #{bugId,jdbcType=VARCHAR} - and field_id = #{fieldId,jdbcType=VARCHAR} delete from bug_custom_field @@ -124,10 +98,10 @@ - insert into bug_custom_field (bug_id, field_id, `value`, - text_value) - values (#{bugId,jdbcType=VARCHAR}, #{fieldId,jdbcType=VARCHAR}, #{value,jdbcType=VARCHAR}, - #{textValue,jdbcType=LONGVARBINARY}) + insert into bug_custom_field (bug_id, field_id, `value` + ) + values (#{bugId,jdbcType=VARCHAR}, #{fieldId,jdbcType=VARCHAR}, #{value,jdbcType=VARCHAR} + ) insert into bug_custom_field @@ -141,9 +115,6 @@ `value`, - - text_value, - @@ -155,9 +126,6 @@ #{value,jdbcType=VARCHAR}, - - #{textValue,jdbcType=LONGVARBINARY}, - + select + + distinct + + + , + + from bug_history + + + + + order by ${orderByClause} + + + + + + delete from bug_history + where id = #{id,jdbcType=VARCHAR} + + + delete from bug_history + + + + + + insert into bug_history (id, bug_id, num, + create_user, create_time, content + ) + values (#{id,jdbcType=VARCHAR}, #{bugId,jdbcType=VARCHAR}, #{num,jdbcType=INTEGER}, + #{createUser,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{content,jdbcType=LONGVARBINARY} + ) + + + insert into bug_history + + + id, + + + bug_id, + + + num, + + + create_user, + + + create_time, + + + content, + + + + + #{id,jdbcType=VARCHAR}, + + + #{bugId,jdbcType=VARCHAR}, + + + #{num,jdbcType=INTEGER}, + + + #{createUser,jdbcType=VARCHAR}, + + + #{createTime,jdbcType=BIGINT}, + + + #{content,jdbcType=LONGVARBINARY}, + + + + + + update bug_history + + + id = #{record.id,jdbcType=VARCHAR}, + + + bug_id = #{record.bugId,jdbcType=VARCHAR}, + + + num = #{record.num,jdbcType=INTEGER}, + + + create_user = #{record.createUser,jdbcType=VARCHAR}, + + + create_time = #{record.createTime,jdbcType=BIGINT}, + + + content = #{record.content,jdbcType=LONGVARBINARY}, + + + + + + + + update bug_history + set id = #{record.id,jdbcType=VARCHAR}, + bug_id = #{record.bugId,jdbcType=VARCHAR}, + num = #{record.num,jdbcType=INTEGER}, + create_user = #{record.createUser,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=BIGINT}, + content = #{record.content,jdbcType=LONGVARBINARY} + + + + + + update bug_history + set id = #{record.id,jdbcType=VARCHAR}, + bug_id = #{record.bugId,jdbcType=VARCHAR}, + num = #{record.num,jdbcType=INTEGER}, + create_user = #{record.createUser,jdbcType=VARCHAR}, + create_time = #{record.createTime,jdbcType=BIGINT} + + + + + + update bug_history + + + bug_id = #{bugId,jdbcType=VARCHAR}, + + + num = #{num,jdbcType=INTEGER}, + + + create_user = #{createUser,jdbcType=VARCHAR}, + + + create_time = #{createTime,jdbcType=BIGINT}, + + + content = #{content,jdbcType=LONGVARBINARY}, + + + where id = #{id,jdbcType=VARCHAR} + + + update bug_history + set bug_id = #{bugId,jdbcType=VARCHAR}, + num = #{num,jdbcType=INTEGER}, + create_user = #{createUser,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=BIGINT}, + content = #{content,jdbcType=LONGVARBINARY} + where id = #{id,jdbcType=VARCHAR} + + + update bug_history + set bug_id = #{bugId,jdbcType=VARCHAR}, + num = #{num,jdbcType=INTEGER}, + create_user = #{createUser,jdbcType=VARCHAR}, + create_time = #{createTime,jdbcType=BIGINT} + where id = #{id,jdbcType=VARCHAR} + + + insert into bug_history + (id, bug_id, num, create_user, create_time, content) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.bugId,jdbcType=VARCHAR}, #{item.num,jdbcType=INTEGER}, + #{item.createUser,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, #{item.content,jdbcType=LONGVARBINARY} + ) + + + + insert into bug_history ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.bugId,jdbcType=VARCHAR} + + + #{item.num,jdbcType=INTEGER} + + + #{item.createUser,jdbcType=VARCHAR} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.content,jdbcType=LONGVARBINARY} + + + ) + + + \ 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 ebd1bf3c90..1cc9ed7f0f 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 @@ -2,9 +2,10 @@ package io.metersphere.bug.mapper; import io.metersphere.bug.domain.Bug; import io.metersphere.bug.domain.BugExample; -import java.util.List; import org.apache.ibatis.annotations.Param; +import java.util.List; + public interface BugMapper { long countByExample(BugExample example); 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 3ff00c74b4..e087d0abd9 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 @@ -5,14 +5,16 @@ + + - - - - - + + + + + @@ -73,8 +75,8 @@ - id, num, title, create_time, update_time, platform, project_id, create_user, source_id, - platform_status, platform_id + id, num, title, assign_user, create_user, create_time, update_time, project_id, template_id, + platform, `status`, platform_bug_id, trash + select - from bug_functional_case + from bug_relation_case where id = #{id,jdbcType=VARCHAR} - delete from bug_functional_case + delete from bug_relation_case where id = #{id,jdbcType=VARCHAR} - - delete from bug_functional_case + + delete from bug_relation_case - - insert into bug_functional_case (id, resource_id, bug_id, - ref_type, ref_id, create_time, - update_time) - values (#{id,jdbcType=VARCHAR}, #{resourceId,jdbcType=VARCHAR}, #{bugId,jdbcType=VARCHAR}, - #{refType,jdbcType=VARCHAR}, #{refId,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, - #{updateTime,jdbcType=BIGINT}) + + insert into bug_relation_case (id, case_id, bug_id, + case_type, test_plan_id, test_plan_case_id, + create_user, create_time, update_time + ) + values (#{id,jdbcType=VARCHAR}, #{caseId,jdbcType=VARCHAR}, #{bugId,jdbcType=VARCHAR}, + #{caseType,jdbcType=VARCHAR}, #{testPlanId,jdbcType=VARCHAR}, #{testPlanCaseId,jdbcType=VARCHAR}, + #{createUser,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT} + ) - - insert into bug_functional_case + + insert into bug_relation_case id, - - resource_id, + + case_id, bug_id, - - ref_type, + + case_type, - - ref_id, + + test_plan_id, + + + test_plan_case_id, + + + create_user, create_time, @@ -138,17 +149,23 @@ #{id,jdbcType=VARCHAR}, - - #{resourceId,jdbcType=VARCHAR}, + + #{caseId,jdbcType=VARCHAR}, #{bugId,jdbcType=VARCHAR}, - - #{refType,jdbcType=VARCHAR}, + + #{caseType,jdbcType=VARCHAR}, - - #{refId,jdbcType=VARCHAR}, + + #{testPlanId,jdbcType=VARCHAR}, + + + #{testPlanCaseId,jdbcType=VARCHAR}, + + + #{createUser,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, @@ -158,29 +175,35 @@ - + select count(*) from bug_relation_case - update bug_functional_case + update bug_relation_case id = #{record.id,jdbcType=VARCHAR}, - - resource_id = #{record.resourceId,jdbcType=VARCHAR}, + + case_id = #{record.caseId,jdbcType=VARCHAR}, bug_id = #{record.bugId,jdbcType=VARCHAR}, - - ref_type = #{record.refType,jdbcType=VARCHAR}, + + case_type = #{record.caseType,jdbcType=VARCHAR}, - - ref_id = #{record.refId,jdbcType=VARCHAR}, + + test_plan_id = #{record.testPlanId,jdbcType=VARCHAR}, + + + test_plan_case_id = #{record.testPlanCaseId,jdbcType=VARCHAR}, + + + create_user = #{record.createUser,jdbcType=VARCHAR}, create_time = #{record.createTime,jdbcType=BIGINT}, @@ -194,32 +217,40 @@ - update bug_functional_case + update bug_relation_case set id = #{record.id,jdbcType=VARCHAR}, - resource_id = #{record.resourceId,jdbcType=VARCHAR}, + case_id = #{record.caseId,jdbcType=VARCHAR}, bug_id = #{record.bugId,jdbcType=VARCHAR}, - ref_type = #{record.refType,jdbcType=VARCHAR}, - ref_id = #{record.refId,jdbcType=VARCHAR}, + case_type = #{record.caseType,jdbcType=VARCHAR}, + test_plan_id = #{record.testPlanId,jdbcType=VARCHAR}, + test_plan_case_id = #{record.testPlanCaseId,jdbcType=VARCHAR}, + create_user = #{record.createUser,jdbcType=VARCHAR}, create_time = #{record.createTime,jdbcType=BIGINT}, update_time = #{record.updateTime,jdbcType=BIGINT} - - update bug_functional_case + + update bug_relation_case - - resource_id = #{resourceId,jdbcType=VARCHAR}, + + case_id = #{caseId,jdbcType=VARCHAR}, bug_id = #{bugId,jdbcType=VARCHAR}, - - ref_type = #{refType,jdbcType=VARCHAR}, + + case_type = #{caseType,jdbcType=VARCHAR}, - - ref_id = #{refId,jdbcType=VARCHAR}, + + test_plan_id = #{testPlanId,jdbcType=VARCHAR}, + + + test_plan_case_id = #{testPlanCaseId,jdbcType=VARCHAR}, + + + create_user = #{createUser,jdbcType=VARCHAR}, create_time = #{createTime,jdbcType=BIGINT}, @@ -230,14 +261,69 @@ where id = #{id,jdbcType=VARCHAR} - - update bug_functional_case - set resource_id = #{resourceId,jdbcType=VARCHAR}, + + update bug_relation_case + set case_id = #{caseId,jdbcType=VARCHAR}, bug_id = #{bugId,jdbcType=VARCHAR}, - ref_type = #{refType,jdbcType=VARCHAR}, - ref_id = #{refId,jdbcType=VARCHAR}, + case_type = #{caseType,jdbcType=VARCHAR}, + test_plan_id = #{testPlanId,jdbcType=VARCHAR}, + test_plan_case_id = #{testPlanCaseId,jdbcType=VARCHAR}, + create_user = #{createUser,jdbcType=VARCHAR}, create_time = #{createTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT} where id = #{id,jdbcType=VARCHAR} + + insert into bug_relation_case + (id, case_id, bug_id, case_type, test_plan_id, test_plan_case_id, create_user, create_time, + update_time) + values + + (#{item.id,jdbcType=VARCHAR}, #{item.caseId,jdbcType=VARCHAR}, #{item.bugId,jdbcType=VARCHAR}, + #{item.caseType,jdbcType=VARCHAR}, #{item.testPlanId,jdbcType=VARCHAR}, #{item.testPlanCaseId,jdbcType=VARCHAR}, + #{item.createUser,jdbcType=VARCHAR}, #{item.createTime,jdbcType=BIGINT}, #{item.updateTime,jdbcType=BIGINT} + ) + + + + insert into bug_relation_case ( + + ${column.escapedColumnName} + + ) + values + + ( + + + #{item.id,jdbcType=VARCHAR} + + + #{item.caseId,jdbcType=VARCHAR} + + + #{item.bugId,jdbcType=VARCHAR} + + + #{item.caseType,jdbcType=VARCHAR} + + + #{item.testPlanId,jdbcType=VARCHAR} + + + #{item.testPlanCaseId,jdbcType=VARCHAR} + + + #{item.createUser,jdbcType=VARCHAR} + + + #{item.createTime,jdbcType=BIGINT} + + + #{item.updateTime,jdbcType=BIGINT} + + + ) + + \ No newline at end of file diff --git a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_7__bug_management.sql b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_7__bug_management.sql index 3510863ee7..3ec6a63b1a 100644 --- a/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_7__bug_management.sql +++ b/backend/framework/domain/src/main/resources/migration/3.0.0/ddl/V3.0.0_7__bug_management.sql @@ -1,23 +1,125 @@ -- set innodb lock wait timeout SET SESSION innodb_lock_wait_timeout = 7200; +DROP TABLE IF EXISTS bug; CREATE TABLE IF NOT EXISTS bug( `id` VARCHAR(50) NOT NULL COMMENT 'ID' , `num` INT NOT NULL COMMENT '业务ID' , `title` VARCHAR(300) NOT NULL COMMENT '缺陷标题' , + `assign_user` VARCHAR(50) NOT NULL COMMENT '指派人' , + `create_user` VARCHAR(50) NOT NULL COMMENT '创建人' , `create_time` BIGINT NOT NULL COMMENT '创建时间' , `update_time` BIGINT NOT NULL COMMENT '更新时间' , - `platform` VARCHAR(50) NOT NULL COMMENT '缺陷平台' , `project_id` VARCHAR(50) NOT NULL COMMENT '项目ID' , - `create_user` VARCHAR(50) NOT NULL COMMENT '创建人' , - `source_id` VARCHAR(50) COMMENT '缺陷来源,记录创建该缺陷的测试计划的ID' , - `platform_status` VARCHAR(50) NOT NULL DEFAULT '' COMMENT '第三方平台状态' , - `platform_id` VARCHAR(50) COMMENT '第三方平台缺陷ID' , + `template_id` VARCHAR(50) COMMENT '模板ID' , + `platform` VARCHAR(50) NOT NULL COMMENT '缺陷平台' , + `status` VARCHAR(50) NOT NULL DEFAULT '' COMMENT '平台状态' , + `platform_bug_id` VARCHAR(50) COMMENT '第三方平台缺陷ID' , + `trash` BIT(1) NOT NULL COMMENT '是否回收站' , PRIMARY KEY (id) -) ENGINE = InnoDB - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_general_ci COMMENT = '缺陷'; +) COMMENT = '缺陷'; +CREATE INDEX idx_num ON bug(num); +CREATE INDEX idx_title ON bug(title); +CREATE INDEX idx_assign_user ON bug(assign_user); +CREATE INDEX idx_create_user ON bug(create_user); +CREATE INDEX idx_create_time ON bug(create_time); +CREATE INDEX idx_update_time ON bug(update_time); +CREATE INDEX idx_project_id ON bug(project_id); +CREATE INDEX idx_platform ON bug(platform); +CREATE INDEX idx_status ON bug(status); +CREATE INDEX idx_trash ON bug(trash); + +DROP TABLE IF EXISTS bug_content; +CREATE TABLE IF NOT EXISTS bug_content( + `bug_id` VARCHAR(50) NOT NULL COMMENT '缺陷ID' , + `description` LONGTEXT COMMENT '缺陷描述' , + PRIMARY KEY (bug_id) +) COMMENT = '缺陷内容'; + +DROP TABLE IF EXISTS bug_follower; +CREATE TABLE IF NOT EXISTS bug_follower( + `bug_id` VARCHAR(50) NOT NULL COMMENT '缺陷ID' , + `user_id` VARCHAR(50) NOT NULL COMMENT '关注人ID' , + PRIMARY KEY (bug_id,user_id) +) COMMENT = '缺陷关注人'; + + +CREATE INDEX idx_follow_id ON bug_follower(user_id); + +DROP TABLE IF EXISTS bug_comment; +CREATE TABLE IF NOT EXISTS bug_comment( + `id` VARCHAR(50) NOT NULL COMMENT 'ID' , + `bug_id` VARCHAR(50) NOT NULL COMMENT '缺陷ID' , + `reply_user` VARCHAR(50) COMMENT '回复人' , + `parent_id` VARCHAR(50) COMMENT '父评论ID' , + `description` TEXT NOT NULL COMMENT '内容' , + `create_user` VARCHAR(50) NOT NULL COMMENT '评论人' , + `create_time` BIGINT NOT NULL COMMENT '创建时间' , + `update_user` VARCHAR(50) NOT NULL COMMENT '更新人' , + `update_time` BIGINT NOT NULL COMMENT '更新时间' , + PRIMARY KEY (id) +) COMMENT = '缺陷评论'; + + +CREATE INDEX idx_bug_id ON bug_comment(bug_id); +CREATE INDEX idx_parent_id ON bug_comment(parent_id); + +DROP TABLE IF EXISTS bug_attachment; +CREATE TABLE IF NOT EXISTS bug_attachment( + `id` VARCHAR(255) NOT NULL COMMENT 'ID' , + `bug_id` VARCHAR(50) NOT NULL COMMENT '缺陷ID' , + `file_id` VARCHAR(50) NOT NULL COMMENT '文件ID' , + `file_name` VARCHAR(255) NOT NULL COMMENT '文件名称' , + `size` BIGINT NOT NULL COMMENT '文件大小' , + `association` BIT(1) NOT NULL COMMENT '是否关联' , + `create_user` VARCHAR(50) NOT NULL COMMENT '创建人' , + `create_time` BIGINT NOT NULL COMMENT '创建时间' , + PRIMARY KEY (id) +) COMMENT = '缺陷附件'; + +DROP TABLE IF EXISTS bug_custom_field; +CREATE TABLE IF NOT EXISTS bug_custom_field( + `bug_id` VARCHAR(50) NOT NULL COMMENT '缺陷ID' , + `field_id` VARCHAR(50) NOT NULL COMMENT '字段ID' , + `value` VARCHAR(1000) COMMENT '字段值' , + PRIMARY KEY (bug_id) +) COMMENT = '缺陷自定义字段'; + +DROP TABLE IF EXISTS bug_relation_case; +CREATE TABLE IF NOT EXISTS bug_relation_case( + `id` VARCHAR(50) NOT NULL COMMENT 'ID' , + `case_id` VARCHAR(50) NOT NULL COMMENT '关联功能用例ID' , + `bug_id` VARCHAR(50) NOT NULL COMMENT '缺陷ID' , + `case_type` VARCHAR(64) NOT NULL DEFAULT 'functional' COMMENT '关联的用例类型;functional/api/ui/performance' , + `test_plan_id` VARCHAR(50) COMMENT '关联测试计划ID' , + `test_plan_case_id` VARCHAR(50) COMMENT '关联测试计划用例ID' , + `create_user` VARCHAR(50) NOT NULL COMMENT '创建人' , + `create_time` BIGINT NOT NULL COMMENT '创建时间' , + `update_time` BIGINT NOT NULL COMMENT '更新时间' , + PRIMARY KEY (id) +) COMMENT = '用例和缺陷的关联表'; + + +CREATE INDEX idx_bug_id ON bug_relation_case(bug_id); +CREATE INDEX idx_plan_case_id ON bug_relation_case(test_plan_id,test_plan_case_id); +CREATE INDEX idx_case_id ON bug_relation_case(case_id); +CREATE INDEX idx_case_type ON bug_relation_case(case_type); + +DROP TABLE IF EXISTS bug_history; +CREATE TABLE IF NOT EXISTS bug_history( + `id` VARCHAR(50) NOT NULL COMMENT '变更记录ID' , + `bug_id` VARCHAR(50) NOT NULL COMMENT '所属缺陷ID' , + `num` INT NOT NULL COMMENT '变更记录批次号' , + `content` BLOB NOT NULL COMMENT '修改内容' , + `create_user` VARCHAR(50) NOT NULL COMMENT '操作人' , + `create_time` BIGINT NOT NULL COMMENT '操作时间' , + PRIMARY KEY (id) +) COMMENT = '缺陷变更记录'; + + +CREATE INDEX idx_bug_id ON bug_history(bug_id); + -- set innodb lock wait timeout to default SET SESSION innodb_lock_wait_timeout = DEFAULT; diff --git a/backend/framework/sdk/src/main/resources/i18n/bug.properties b/backend/framework/sdk/src/main/resources/i18n/bug.properties index db491a3f1c..bc63e67a9d 100644 --- a/backend/framework/sdk/src/main/resources/i18n/bug.properties +++ b/backend/framework/sdk/src/main/resources/i18n/bug.properties @@ -1,38 +1,30 @@ -bug_exists=The bug already exists under this project - # bug bug.id.not_blank=ID不能为空 bug.id.length_range=ID长度必须在1-50之间 bug.title.not_blank=缺陷标题不能为空 bug.title.length_range=缺陷标题长度必须在1-50之间 -bug.platform.not_blank=缺陷平台不能为空 -bug.platform.length_range=缺陷平台长度必须在1-50之间 -bug.project_id.not_blank=项目ID不能为空 -bug.project_id.length_range=项目ID长度必须在1-50之间 +bug.assign_user.not_blank=指派人不能为空 +bug.assign_user.length_range=指派人长度必须在1-50之间 bug.create_user.not_blank=创建人不能为空 bug.create_user.length_range=创建人长度必须在1-50之间 -bug.platform_status.not_blank=第三方平台状态不能为空 -bug.platform_status.length_range=第三方平台状态长度必须在1-50之间 -bug_blob.id.not_blank=缺陷ID不能为空 -bug_blob.id.length_range=缺陷ID长度必须在1-50之间 +bug.project_id.not_blank=项目ID不能为空 +bug.project_id.length_range=项目ID长度必须在1-50之间 +bug.platform.not_blank=缺陷平台不能为空 +bug.platform.length_range=缺陷平台长度必须在1-50之间 +bug.status.not_blank=平台状态不能为空 +bug.status.length_range=平台状态长度必须在1-50之间 +bug.trash.not_blank=是否回收站不能为空 +bug.trash.length_range=是否回收站长度必须在1-50之间 -# bugsFunctionalCase -bugs_functional_case.id.not_blank=ID不能为空 -bugs_functional_case.id.length_range=ID长度必须在1-50之间 -bugs_functional_case.resource_id.not_blank=功能用例或测试计划功能用例ID不能为空 -bugs_functional_case.resource_id.length_range=功能用例或测试计划功能用例ID长度必须在1-50之间 -bugs_functional_case.bugs_id.not_blank=缺陷ID不能为空 -bugs_functional_case.bugs_id.length_range=缺陷ID长度必须在1-50之间 -bugs_functional_case.ref_type.not_blank=关联的类型:关联功能用例/关联测试计划功能用例不能为空 -bugs_functional_case.ref_type.length_range=关联的类型:关联功能用例/关联测试计划功能用例长度必须在1-50之间 -bugs_functional_case.ref_id.not_blank=测试计划的用例所指向的用例的id不能为空 -bugs_functional_case.ref_id.length_range=测试计划的用例所指向的用例的id长度必须在1-50之间 +# bugContent +bug_content.bug_id.not_blank=缺陷ID不能为空 +bug_content.bug_id.length_range=缺陷ID长度必须在1-50之间 -# bugAttachment -bug_attachment.bug_id.not_blank=缺陷ID不能为空 -bug_attachment.bug_id.length_range=缺陷ID长度必须在1-50之间 -bug_attachment.file_id.not_blank=文件的ID不能为空 -bug_attachment.file_id.length_range=文件的ID长度必须在1-50之间 +# bugFollower +bug_follower.bug_id.not_blank=缺陷ID不能为空 +bug_follower.bug_id.length_range=缺陷ID长度必须在1-50之间 +bug_follower.user_id.not_blank=关注人ID不能为空 +bug_follower.user_id.length_range=关注人ID长度必须在1-50之间 # bugComment bug_comment.id.not_blank=ID不能为空 @@ -41,9 +33,45 @@ bug_comment.bug_id.not_blank=缺陷ID不能为空 bug_comment.bug_id.length_range=缺陷ID长度必须在1-50之间 bug_comment.create_user.not_blank=评论人不能为空 bug_comment.create_user.length_range=评论人长度必须在1-50之间 +bug_comment.update_user.not_blank=更新人不能为空 +bug_comment.update_user.length_range=更新人长度必须在1-50之间 -# bugFollow -bug_follow.bug_id.not_blank=缺陷ID不能为空 -bug_follow.bug_id.length_range=缺陷ID长度必须在1-50之间 -bug_follow.follow_id.not_blank=关注人ID不能为空 -bug_follow.follow_id.length_range=关注人ID长度必须在1-50之间 +# bugAttachment +bug_attachment.id.not_blank=ID不能为空 +bug_attachment.id.length_range=ID长度必须在1-50之间 +bug_attachment.bug_id.not_blank=缺陷ID不能为空 +bug_attachment.bug_id.length_range=缺陷ID长度必须在1-50之间 +bug_attachment.file_id.not_blank=文件ID不能为空 +bug_attachment.file_id.length_range=文件ID长度必须在1-50之间 +bug_attachment.file_name.not_blank=文件名称不能为空 +bug_attachment.file_name.length_range=文件名称长度必须在1-50之间 +bug_attachment.association.not_blank=是否关联不能为空 +bug_attachment.association.length_range=是否关联长度必须在1-50之间 +bug_attachment.create_user.not_blank=创建人不能为空 +bug_attachment.create_user.length_range=创建人长度必须在1-50之间 + +# bugCustomField +bug_custom_field.bug_id.not_blank=缺陷ID不能为空 +bug_custom_field.bug_id.length_range=缺陷ID长度必须在1-50之间 +bug_custom_field.field_id.not_blank=字段ID不能为空 +bug_custom_field.field_id.length_range=字段ID长度必须在1-50之间 + +# bugRelationCase +bug_relation_case.id.not_blank=ID不能为空 +bug_relation_case.id.length_range=ID长度必须在1-50之间 +bug_relation_case.case_id.not_blank=关联功能用例ID不能为空 +bug_relation_case.case_id.length_range=关联功能用例ID长度必须在1-50之间 +bug_relation_case.bug_id.not_blank=缺陷ID不能为空 +bug_relation_case.bug_id.length_range=缺陷ID长度必须在1-50之间 +bug_relation_case.case_type.not_blank=关联的用例类型不能为空 +bug_relation_case.case_type.length_range=关联的用例类型长度必须在1-50之间 +bug_relation_case.create_user.not_blank=创建人不能为空 +bug_relation_case.create_user.length_range=创建人长度必须在1-50之间 + +# bugHistory +bug_history.id.not_blank=变更记录ID不能为空 +bug_history.id.length_range=变更记录ID长度必须在1-50之间 +bug_history.bug_id.not_blank=所属缺陷ID不能为空 +bug_history.bug_id.length_range=所属缺陷ID长度必须在1-50之间 +bug_history.create_user.not_blank=操作人不能为空 +bug_history.create_user.length_range=操作人长度必须在1-50之间 \ No newline at end of file diff --git a/backend/framework/sdk/src/main/resources/i18n/bug_en_US.properties b/backend/framework/sdk/src/main/resources/i18n/bug_en_US.properties index f2c81733d6..d5ac1586c4 100644 --- a/backend/framework/sdk/src/main/resources/i18n/bug_en_US.properties +++ b/backend/framework/sdk/src/main/resources/i18n/bug_en_US.properties @@ -1,38 +1,30 @@ -bug_exists=The bug already exists under this project - # bug bug.id.not_blank=id cannot be empty bug.id.length_range=id length must be between 1-50 bug.title.not_blank=title cannot be empty bug.title.length_range=title length must be between 1-50 -bug.platform.not_blank=platform cannot be empty -bug.platform.length_range=platform length must be between 1-50 -bug.project_id.not_blank=projectId cannot be empty -bug.project_id.length_range=projectId length must be between 1-50 +bug.assign_user.not_blank=assignUser cannot be empty +bug.assign_user.length_range=assignUser length must be between 1-50 bug.create_user.not_blank=createUser cannot be empty bug.create_user.length_range=createUser length must be between 1-50 -bug.platform_status.not_blank=platformStatus cannot be empty -bug.platform_status.length_range=platformStatus length must be between 1-50 -bug_blob.id.not_blank=id cannot be empty -bug_blob.id.length_range=id length must be between 1-50 +bug.project_id.not_blank=projectId cannot be empty +bug.project_id.length_range=projectId length must be between 1-50 +bug.platform.not_blank=platform cannot be empty +bug.platform.length_range=platform length must be between 1-50 +bug.status.not_blank=status cannot be empty +bug.status.length_range=status length must be between 1-50 +bug.trash.not_blank=trash cannot be empty +bug.trash.length_range=trash length must be between 1-50 -# bugsFunctionalCase -bugs_functional_case.id.not_blank=id cannot be empty -bugs_functional_case.id.length_range=id length must be between 1-50 -bugs_functional_case.resource_id.not_blank=resourceId cannot be empty -bugs_functional_case.resource_id.length_range=resourceId length must be between 1-50 -bugs_functional_case.bugs_id.not_blank=bugsId cannot be empty -bugs_functional_case.bugs_id.length_range=bugsId length must be between 1-50 -bugs_functional_case.ref_type.not_blank=refType cannot be empty -bugs_functional_case.ref_type.length_range=refType length must be between 1-50 -bugs_functional_case.ref_id.not_blank=refId cannot be empty -bugs_functional_case.ref_id.length_range=refId length must be between 1-50 +# bugContent +bug_content.bug_id.not_blank=bugId cannot be empty +bug_content.bug_id.length_range=bugId length must be between 1-50 -# bugAttachment -bug_attachment.bug_id.not_blank=bugId cannot be empty -bug_attachment.bug_id.length_range=bugId length must be between 1-50 -bug_attachment.file_id.not_blank=fileId cannot be empty -bug_attachment.file_id.length_range=fileId length must be between 1-50 +# bugFollower +bug_follower.bug_id.not_blank=bugId cannot be empty +bug_follower.bug_id.length_range=bugId length must be between 1-50 +bug_follower.user_id.not_blank=userId cannot be empty +bug_follower.user_id.length_range=userId length must be between 1-50 # bugComment bug_comment.id.not_blank=id cannot be empty @@ -41,8 +33,45 @@ bug_comment.bug_id.not_blank=bugId cannot be empty bug_comment.bug_id.length_range=bugId length must be between 1-50 bug_comment.create_user.not_blank=createUser cannot be empty bug_comment.create_user.length_range=createUser length must be between 1-50 +bug_comment.update_user.not_blank=updateUser cannot be empty +bug_comment.update_user.length_range=updateUser length must be between 1-50 -# bugFollow -bug_follow.bug_id.not_blank=bugId cannot be empty -bug_follow.bug_id.length_range=bugId length must be between 1-50 -bug_follow.follow_id.not_blank=followId cannot be empty +# bugAttachment +bug_attachment.id.not_blank=id cannot be empty +bug_attachment.id.length_range=id length must be between 1-50 +bug_attachment.bug_id.not_blank=bugId cannot be empty +bug_attachment.bug_id.length_range=bugId length must be between 1-50 +bug_attachment.file_id.not_blank=fileId cannot be empty +bug_attachment.file_id.length_range=fileId length must be between 1-50 +bug_attachment.file_name.not_blank=fileName cannot be empty +bug_attachment.file_name.length_range=fileName length must be between 1-50 +bug_attachment.association.not_blank=association cannot be empty +bug_attachment.association.length_range=association length must be between 1-50 +bug_attachment.create_user.not_blank=createUser cannot be empty +bug_attachment.create_user.length_range=createUser length must be between 1-50 + +# bugCustomField +bug_custom_field.bug_id.not_blank=bugId cannot be empty +bug_custom_field.bug_id.length_range=bugId length must be between 1-50 +bug_custom_field.field_id.not_blank=fieldId cannot be empty +bug_custom_field.field_id.length_range=fieldId length must be between 1-50 + +# bugRelationCase +bug_relation_case.id.not_blank=id cannot be empty +bug_relation_case.id.length_range=id length must be between 1-50 +bug_relation_case.case_id.not_blank=caseId cannot be empty +bug_relation_case.case_id.length_range=caseId length must be between 1-50 +bug_relation_case.bug_id.not_blank=bugId cannot be empty +bug_relation_case.bug_id.length_range=bugId length must be between 1-50 +bug_relation_case.case_type.not_blank=caseType cannot be empty +bug_relation_case.case_type.length_range=caseType length must be between 1-50 +bug_relation_case.create_user.not_blank=createUser cannot be empty +bug_relation_case.create_user.length_range=createUser length must be between 1-50 + +# bugHistory +bug_history.id.not_blank=id cannot be empty +bug_history.id.length_range=id length must be between 1-50 +bug_history.bug_id.not_blank=bugId cannot be empty +bug_history.bug_id.length_range=bugId length must be between 1-50 +bug_history.create_user.not_blank=createUser cannot be empty +bug_history.create_user.length_range=createUser length must be between 1-50 \ No newline at end of file diff --git a/backend/framework/sdk/src/main/resources/i18n/bug_zh_CN.properties b/backend/framework/sdk/src/main/resources/i18n/bug_zh_CN.properties index db491a3f1c..bc63e67a9d 100644 --- a/backend/framework/sdk/src/main/resources/i18n/bug_zh_CN.properties +++ b/backend/framework/sdk/src/main/resources/i18n/bug_zh_CN.properties @@ -1,38 +1,30 @@ -bug_exists=The bug already exists under this project - # bug bug.id.not_blank=ID不能为空 bug.id.length_range=ID长度必须在1-50之间 bug.title.not_blank=缺陷标题不能为空 bug.title.length_range=缺陷标题长度必须在1-50之间 -bug.platform.not_blank=缺陷平台不能为空 -bug.platform.length_range=缺陷平台长度必须在1-50之间 -bug.project_id.not_blank=项目ID不能为空 -bug.project_id.length_range=项目ID长度必须在1-50之间 +bug.assign_user.not_blank=指派人不能为空 +bug.assign_user.length_range=指派人长度必须在1-50之间 bug.create_user.not_blank=创建人不能为空 bug.create_user.length_range=创建人长度必须在1-50之间 -bug.platform_status.not_blank=第三方平台状态不能为空 -bug.platform_status.length_range=第三方平台状态长度必须在1-50之间 -bug_blob.id.not_blank=缺陷ID不能为空 -bug_blob.id.length_range=缺陷ID长度必须在1-50之间 +bug.project_id.not_blank=项目ID不能为空 +bug.project_id.length_range=项目ID长度必须在1-50之间 +bug.platform.not_blank=缺陷平台不能为空 +bug.platform.length_range=缺陷平台长度必须在1-50之间 +bug.status.not_blank=平台状态不能为空 +bug.status.length_range=平台状态长度必须在1-50之间 +bug.trash.not_blank=是否回收站不能为空 +bug.trash.length_range=是否回收站长度必须在1-50之间 -# bugsFunctionalCase -bugs_functional_case.id.not_blank=ID不能为空 -bugs_functional_case.id.length_range=ID长度必须在1-50之间 -bugs_functional_case.resource_id.not_blank=功能用例或测试计划功能用例ID不能为空 -bugs_functional_case.resource_id.length_range=功能用例或测试计划功能用例ID长度必须在1-50之间 -bugs_functional_case.bugs_id.not_blank=缺陷ID不能为空 -bugs_functional_case.bugs_id.length_range=缺陷ID长度必须在1-50之间 -bugs_functional_case.ref_type.not_blank=关联的类型:关联功能用例/关联测试计划功能用例不能为空 -bugs_functional_case.ref_type.length_range=关联的类型:关联功能用例/关联测试计划功能用例长度必须在1-50之间 -bugs_functional_case.ref_id.not_blank=测试计划的用例所指向的用例的id不能为空 -bugs_functional_case.ref_id.length_range=测试计划的用例所指向的用例的id长度必须在1-50之间 +# bugContent +bug_content.bug_id.not_blank=缺陷ID不能为空 +bug_content.bug_id.length_range=缺陷ID长度必须在1-50之间 -# bugAttachment -bug_attachment.bug_id.not_blank=缺陷ID不能为空 -bug_attachment.bug_id.length_range=缺陷ID长度必须在1-50之间 -bug_attachment.file_id.not_blank=文件的ID不能为空 -bug_attachment.file_id.length_range=文件的ID长度必须在1-50之间 +# bugFollower +bug_follower.bug_id.not_blank=缺陷ID不能为空 +bug_follower.bug_id.length_range=缺陷ID长度必须在1-50之间 +bug_follower.user_id.not_blank=关注人ID不能为空 +bug_follower.user_id.length_range=关注人ID长度必须在1-50之间 # bugComment bug_comment.id.not_blank=ID不能为空 @@ -41,9 +33,45 @@ bug_comment.bug_id.not_blank=缺陷ID不能为空 bug_comment.bug_id.length_range=缺陷ID长度必须在1-50之间 bug_comment.create_user.not_blank=评论人不能为空 bug_comment.create_user.length_range=评论人长度必须在1-50之间 +bug_comment.update_user.not_blank=更新人不能为空 +bug_comment.update_user.length_range=更新人长度必须在1-50之间 -# bugFollow -bug_follow.bug_id.not_blank=缺陷ID不能为空 -bug_follow.bug_id.length_range=缺陷ID长度必须在1-50之间 -bug_follow.follow_id.not_blank=关注人ID不能为空 -bug_follow.follow_id.length_range=关注人ID长度必须在1-50之间 +# bugAttachment +bug_attachment.id.not_blank=ID不能为空 +bug_attachment.id.length_range=ID长度必须在1-50之间 +bug_attachment.bug_id.not_blank=缺陷ID不能为空 +bug_attachment.bug_id.length_range=缺陷ID长度必须在1-50之间 +bug_attachment.file_id.not_blank=文件ID不能为空 +bug_attachment.file_id.length_range=文件ID长度必须在1-50之间 +bug_attachment.file_name.not_blank=文件名称不能为空 +bug_attachment.file_name.length_range=文件名称长度必须在1-50之间 +bug_attachment.association.not_blank=是否关联不能为空 +bug_attachment.association.length_range=是否关联长度必须在1-50之间 +bug_attachment.create_user.not_blank=创建人不能为空 +bug_attachment.create_user.length_range=创建人长度必须在1-50之间 + +# bugCustomField +bug_custom_field.bug_id.not_blank=缺陷ID不能为空 +bug_custom_field.bug_id.length_range=缺陷ID长度必须在1-50之间 +bug_custom_field.field_id.not_blank=字段ID不能为空 +bug_custom_field.field_id.length_range=字段ID长度必须在1-50之间 + +# bugRelationCase +bug_relation_case.id.not_blank=ID不能为空 +bug_relation_case.id.length_range=ID长度必须在1-50之间 +bug_relation_case.case_id.not_blank=关联功能用例ID不能为空 +bug_relation_case.case_id.length_range=关联功能用例ID长度必须在1-50之间 +bug_relation_case.bug_id.not_blank=缺陷ID不能为空 +bug_relation_case.bug_id.length_range=缺陷ID长度必须在1-50之间 +bug_relation_case.case_type.not_blank=关联的用例类型不能为空 +bug_relation_case.case_type.length_range=关联的用例类型长度必须在1-50之间 +bug_relation_case.create_user.not_blank=创建人不能为空 +bug_relation_case.create_user.length_range=创建人长度必须在1-50之间 + +# bugHistory +bug_history.id.not_blank=变更记录ID不能为空 +bug_history.id.length_range=变更记录ID长度必须在1-50之间 +bug_history.bug_id.not_blank=所属缺陷ID不能为空 +bug_history.bug_id.length_range=所属缺陷ID长度必须在1-50之间 +bug_history.create_user.not_blank=操作人不能为空 +bug_history.create_user.length_range=操作人长度必须在1-50之间 \ No newline at end of file diff --git a/backend/framework/sdk/src/main/resources/i18n/bug_zh_TW.properties b/backend/framework/sdk/src/main/resources/i18n/bug_zh_TW.properties index d34c9fcae5..aa697c5238 100644 --- a/backend/framework/sdk/src/main/resources/i18n/bug_zh_TW.properties +++ b/backend/framework/sdk/src/main/resources/i18n/bug_zh_TW.properties @@ -1,38 +1,30 @@ -bug_exists=該項目下已存在該缺陷 - # bug bug.id.not_blank=ID不能為空 bug.id.length_range=ID長度必須在1-50之間 bug.title.not_blank=缺陷标题不能為空 bug.title.length_range=缺陷标题長度必須在1-50之間 -bug.platform.not_blank=缺陷平台不能為空 -bug.platform.length_range=缺陷平台長度必須在1-50之間 -bug.project_id.not_blank=项目ID不能為空 -bug.project_id.length_range=项目ID長度必須在1-50之間 +bug.assign_user.not_blank=指派人不能為空 +bug.assign_user.length_range=指派人長度必須在1-50之間 bug.create_user.not_blank=创建人不能為空 bug.create_user.length_range=创建人長度必須在1-50之間 -bug.platform_status.not_blank=第三方平台状态不能為空 -bug.platform_status.length_range=第三方平台状态長度必須在1-50之間 -bug_blob.id.not_blank=缺陷ID不能為空 -bug_blob.id.length_range=缺陷ID長度必須在1-50之間 +bug.project_id.not_blank=项目ID不能為空 +bug.project_id.length_range=项目ID長度必須在1-50之間 +bug.platform.not_blank=缺陷平台不能為空 +bug.platform.length_range=缺陷平台長度必須在1-50之間 +bug.status.not_blank=平台状态不能為空 +bug.status.length_range=平台状态長度必須在1-50之間 +bug.trash.not_blank=是否回收站不能為空 +bug.trash.length_range=是否回收站長度必須在1-50之間 -# bugsFunctionalCase -bugs_functional_case.id.not_blank=ID不能為空 -bugs_functional_case.id.length_range=ID長度必須在1-50之間 -bugs_functional_case.resource_id.not_blank=功能用例或测试计划功能用例ID不能為空 -bugs_functional_case.resource_id.length_range=功能用例或测试计划功能用例ID長度必須在1-50之間 -bugs_functional_case.bugs_id.not_blank=缺陷ID不能為空 -bugs_functional_case.bugs_id.length_range=缺陷ID長度必須在1-50之間 -bugs_functional_case.ref_type.not_blank=关联的类型:关联功能用例/关联测试计划功能用例不能為空 -bugs_functional_case.ref_type.length_range=关联的类型:关联功能用例/关联测试计划功能用例長度必須在1-50之間 -bugs_functional_case.ref_id.not_blank=测试计划的用例所指向的用例的id不能為空 -bugs_functional_case.ref_id.length_range=测试计划的用例所指向的用例的id長度必須在1-50之間 +# bugContent +bug_content.bug_id.not_blank=缺陷ID不能為空 +bug_content.bug_id.length_range=缺陷ID長度必須在1-50之間 -# bugAttachment -bug_attachment.bug_id.not_blank=缺陷ID不能為空 -bug_attachment.bug_id.length_range=缺陷ID長度必須在1-50之間 -bug_attachment.file_id.not_blank=文件的ID不能為空 -bug_attachment.file_id.length_range=文件的ID長度必須在1-50之間 +# bugFollower +bug_follower.bug_id.not_blank=缺陷ID不能為空 +bug_follower.bug_id.length_range=缺陷ID長度必須在1-50之間 +bug_follower.user_id.not_blank=关注人ID不能為空 +bug_follower.user_id.length_range=关注人ID長度必須在1-50之間 # bugComment bug_comment.id.not_blank=ID不能為空 @@ -41,9 +33,47 @@ bug_comment.bug_id.not_blank=缺陷ID不能為空 bug_comment.bug_id.length_range=缺陷ID長度必須在1-50之間 bug_comment.create_user.not_blank=评论人不能為空 bug_comment.create_user.length_range=评论人長度必須在1-50之間 +bug_comment.update_user.not_blank=更新人不能為空 +bug_comment.update_user.length_range=更新人長度必須在1-50之間 + +# bugAttachment +bug_attachment.id.not_blank=ID不能為空 +bug_attachment.id.length_range=ID長度必須在1-50之間 +bug_attachment.bug_id.not_blank=缺陷ID不能為空 +bug_attachment.bug_id.length_range=缺陷ID長度必須在1-50之間 +bug_attachment.file_id.not_blank=文件ID不能為空 +bug_attachment.file_id.length_range=文件ID長度必須在1-50之間 +bug_attachment.file_name.not_blank=文件名称不能為空 +bug_attachment.file_name.length_range=文件名称長度必須在1-50之間 +bug_attachment.association.not_blank=是否关联不能為空 +bug_attachment.association.length_range=是否关联長度必須在1-50之間 +bug_attachment.create_user.not_blank=创建人不能為空 +bug_attachment.create_user.length_range=创建人長度必須在1-50之間 + +# bugCustomField +bug_custom_field.bug_id.not_blank=缺陷ID不能為空 +bug_custom_field.bug_id.length_range=缺陷ID長度必須在1-50之間 +bug_custom_field.field_id.not_blank=字段ID不能為空 +bug_custom_field.field_id.length_range=字段ID長度必須在1-50之間 + +# bugRelationCase +bug_relation_case.id.not_blank=ID不能為空 +bug_relation_case.id.length_range=ID長度必須在1-50之間 +bug_relation_case.case_id.not_blank=关联功能用例ID不能為空 +bug_relation_case.case_id.length_range=关联功能用例ID長度必須在1-50之間 +bug_relation_case.bug_id.not_blank=缺陷ID不能為空 +bug_relation_case.bug_id.length_range=缺陷ID長度必須在1-50之間 +bug_relation_case.case_type.not_blank=关联的用例类型不能為空 +bug_relation_case.case_type.length_range=关联的用例类型長度必須在1-50之間 +bug_relation_case.create_user.not_blank=创建人不能為空 +bug_relation_case.create_user.length_range=创建人長度必須在1-50之間 + +# bugHistory +bug_history.id.not_blank=变更记录ID不能為空 +bug_history.id.length_range=变更记录ID長度必須在1-50之間 +bug_history.bug_id.not_blank=所属缺陷ID不能為空 +bug_history.bug_id.length_range=所属缺陷ID長度必須在1-50之間 +bug_history.create_user.not_blank=操作人不能為空 +bug_history.create_user.length_range=操作人長度必須在1-50之間 + -# bugFollow -bug_follow.bug_id.not_blank=缺陷ID不能為空 -bug_follow.bug_id.length_range=缺陷ID長度必須在1-50之間 -bug_follow.follow_id.not_blank=关注人ID不能為空 -bug_follow.follow_id.length_range=关注人ID長度必須在1-50之間 diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/controller/BugController.java b/backend/services/bug-management/src/main/java/io/metersphere/bug/controller/BugController.java deleted file mode 100644 index 21a36d49cc..0000000000 --- a/backend/services/bug-management/src/main/java/io/metersphere/bug/controller/BugController.java +++ /dev/null @@ -1,49 +0,0 @@ -package io.metersphere.bug.controller; - -import io.metersphere.bug.domain.Bug; -import io.metersphere.bug.service.BugService; -import io.metersphere.validation.groups.Created; -import io.swagger.v3.oas.annotations.media.Schema; -import jakarta.annotation.Resource; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; - -import java.util.List; - - -/** - * @author : jianxing - * @date : 2023-5-17 - */ -@Schema(description = "缺陷") -@RestController -@RequestMapping("/bug") -public class BugController { - @Resource - private BugService bugService; - - @GetMapping("/list-all") - public List listAll() { - return bugService.list(); - } - - @GetMapping("/get/{id}") - public Bug get(@PathVariable String id) { - return bugService.get(id); - } - - @PostMapping("/add") - public Bug add(@Validated({Created.class}) @RequestBody Bug bug) { - return bugService.add(bug); - } - - @PostMapping("/update") - public Bug update(@Validated({Created.class}) @RequestBody Bug bug) { - return bugService.update(bug); - } - - @GetMapping("/delete/{id}") - public int delete(@PathVariable String id) { - return bugService.delete(id); - } -} diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/controller/result/BugMgtResultCode.java b/backend/services/bug-management/src/main/java/io/metersphere/bug/controller/result/BugMgtResultCode.java deleted file mode 100644 index 44759a4d77..0000000000 --- a/backend/services/bug-management/src/main/java/io/metersphere/bug/controller/result/BugMgtResultCode.java +++ /dev/null @@ -1,27 +0,0 @@ -package io.metersphere.bug.controller.result; - - -import io.metersphere.sdk.exception.IResultCode; - -public enum BugMgtResultCode implements IResultCode { - - BUG_EXIST_EXCEPTION(108001, "bug_exists"); - - private int code; - private String message; - - BugMgtResultCode(int code, String message) { - this.code = code; - this.message = message; - } - - @Override - public int getCode() { - return code; - } - - @Override - public String getMessage() { - return getTranslationMessage(this.message); - } -} diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java deleted file mode 100644 index 713cec1e03..0000000000 --- a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/BugService.java +++ /dev/null @@ -1,58 +0,0 @@ -package io.metersphere.bug.service; - -import io.metersphere.bug.controller.result.BugMgtResultCode; -import io.metersphere.bug.domain.Bug; -import io.metersphere.bug.domain.BugExample; -import io.metersphere.bug.mapper.BugMapper; -import io.metersphere.sdk.exception.MSException; -import jakarta.annotation.Resource; -import org.apache.commons.collections.CollectionUtils; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author jianxing - * @date : 2023-5-17 - */ -@Service -@Transactional -public class BugService { - - @Resource - private BugMapper bugMapper; - - - public List list() { - return new ArrayList<>(); - } - - public Bug get(String id) { - return bugMapper.selectByPrimaryKey(id); - } - - public Bug add(Bug bug) { - BugExample example = new BugExample(); - example.createCriteria().andTitleEqualTo(bug.getTitle()); - example.createCriteria().andProjectIdEqualTo(bug.getProjectId()); - List bugs = bugMapper.selectByExample(example); - if (CollectionUtils.isNotEmpty(bugs)) { - throw new MSException(BugMgtResultCode.BUG_EXIST_EXCEPTION); - } - bug.setCreateTime(System.currentTimeMillis()); - bug.setUpdateTime(System.currentTimeMillis()); - bugMapper.insert(bug); - return bug; - } - - public Bug update(Bug bug) { - bugMapper.updateByPrimaryKeySelective(bug); - return bug; - } - - public int delete(String id) { - return bugMapper.deleteByPrimaryKey(id); - } -} diff --git a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/CleanupBugResourceService.java b/backend/services/bug-management/src/main/java/io/metersphere/bug/service/CleanupBugResourceService.java deleted file mode 100644 index dac11d87c8..0000000000 --- a/backend/services/bug-management/src/main/java/io/metersphere/bug/service/CleanupBugResourceService.java +++ /dev/null @@ -1,19 +0,0 @@ -package io.metersphere.bug.service; - -import io.metersphere.system.service.CleanupProjectResourceService; -import io.metersphere.sdk.util.LogUtils; -import org.springframework.stereotype.Component; - -@Component -public class CleanupBugResourceService implements CleanupProjectResourceService { - - @Override - public void deleteResources(String projectId) { - LogUtils.info("删除当前项目[" + projectId + "]相关缺陷资源"); - } - - @Override - public void cleanReportResources(String projectId) { - LogUtils.info("清理当前项目[" + projectId + "]相关缺陷报告资源"); - } -} diff --git a/backend/services/bug-management/src/main/resources/bugGeneratorConfig.xml b/backend/services/bug-management/src/main/resources/bugGeneratorConfig.xml index 2157086a5f..62507f6eda 100644 --- a/backend/services/bug-management/src/main/resources/bugGeneratorConfig.xml +++ b/backend/services/bug-management/src/main/resources/bugGeneratorConfig.xml @@ -71,12 +71,15 @@ -
-
-
-
+
+
+
+
+
+ +