From 9f474841c7e47c8a904a9c7790cd0b9c045fda22 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Fri, 5 Nov 2021 16:07:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9Eissue-follow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metersphere/base/domain/IssueFollow.java | 13 + .../base/domain/IssueFollowExample.java | 340 ++++++++++++++++++ .../base/mapper/IssueFollowMapper.java | 22 ++ .../base/mapper/IssueFollowMapper.xml | 140 ++++++++ .../src/main/resources/generatorConfig.xml | 6 +- .../track/case/components/TestCaseEdit.vue | 2 +- .../track/issue/IssueEditDetail.vue | 17 +- 7 files changed, 534 insertions(+), 6 deletions(-) create mode 100644 backend/src/main/java/io/metersphere/base/domain/IssueFollow.java create mode 100644 backend/src/main/java/io/metersphere/base/domain/IssueFollowExample.java create mode 100644 backend/src/main/java/io/metersphere/base/mapper/IssueFollowMapper.java create mode 100644 backend/src/main/java/io/metersphere/base/mapper/IssueFollowMapper.xml diff --git a/backend/src/main/java/io/metersphere/base/domain/IssueFollow.java b/backend/src/main/java/io/metersphere/base/domain/IssueFollow.java new file mode 100644 index 0000000000..17b6a2a11f --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/domain/IssueFollow.java @@ -0,0 +1,13 @@ +package io.metersphere.base.domain; + +import java.io.Serializable; +import lombok.Data; + +@Data +public class IssueFollow implements Serializable { + private String issueId; + + private String followId; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/IssueFollowExample.java b/backend/src/main/java/io/metersphere/base/domain/IssueFollowExample.java new file mode 100644 index 0000000000..975385d4f0 --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/domain/IssueFollowExample.java @@ -0,0 +1,340 @@ +package io.metersphere.base.domain; + +import java.util.ArrayList; +import java.util.List; + +public class IssueFollowExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public IssueFollowExample() { + 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 andIssueIdIsNull() { + addCriterion("issue_id is null"); + return (Criteria) this; + } + + public Criteria andIssueIdIsNotNull() { + addCriterion("issue_id is not null"); + return (Criteria) this; + } + + public Criteria andIssueIdEqualTo(String value) { + addCriterion("issue_id =", value, "issueId"); + return (Criteria) this; + } + + public Criteria andIssueIdNotEqualTo(String value) { + addCriterion("issue_id <>", value, "issueId"); + return (Criteria) this; + } + + public Criteria andIssueIdGreaterThan(String value) { + addCriterion("issue_id >", value, "issueId"); + return (Criteria) this; + } + + public Criteria andIssueIdGreaterThanOrEqualTo(String value) { + addCriterion("issue_id >=", value, "issueId"); + return (Criteria) this; + } + + public Criteria andIssueIdLessThan(String value) { + addCriterion("issue_id <", value, "issueId"); + return (Criteria) this; + } + + public Criteria andIssueIdLessThanOrEqualTo(String value) { + addCriterion("issue_id <=", value, "issueId"); + return (Criteria) this; + } + + public Criteria andIssueIdLike(String value) { + addCriterion("issue_id like", value, "issueId"); + return (Criteria) this; + } + + public Criteria andIssueIdNotLike(String value) { + addCriterion("issue_id not like", value, "issueId"); + return (Criteria) this; + } + + public Criteria andIssueIdIn(List values) { + addCriterion("issue_id in", values, "issueId"); + return (Criteria) this; + } + + public Criteria andIssueIdNotIn(List values) { + addCriterion("issue_id not in", values, "issueId"); + return (Criteria) this; + } + + public Criteria andIssueIdBetween(String value1, String value2) { + addCriterion("issue_id between", value1, value2, "issueId"); + return (Criteria) this; + } + + public Criteria andIssueIdNotBetween(String value1, String value2) { + addCriterion("issue_id not between", value1, value2, "issueId"); + return (Criteria) this; + } + + public Criteria andFollowIdIsNull() { + addCriterion("follow_id is null"); + return (Criteria) this; + } + + public Criteria andFollowIdIsNotNull() { + addCriterion("follow_id is not null"); + return (Criteria) this; + } + + public Criteria andFollowIdEqualTo(String value) { + addCriterion("follow_id =", value, "followId"); + return (Criteria) this; + } + + public Criteria andFollowIdNotEqualTo(String value) { + addCriterion("follow_id <>", value, "followId"); + return (Criteria) this; + } + + public Criteria andFollowIdGreaterThan(String value) { + addCriterion("follow_id >", value, "followId"); + return (Criteria) this; + } + + public Criteria andFollowIdGreaterThanOrEqualTo(String value) { + addCriterion("follow_id >=", value, "followId"); + return (Criteria) this; + } + + public Criteria andFollowIdLessThan(String value) { + addCriterion("follow_id <", value, "followId"); + return (Criteria) this; + } + + public Criteria andFollowIdLessThanOrEqualTo(String value) { + addCriterion("follow_id <=", value, "followId"); + return (Criteria) this; + } + + public Criteria andFollowIdLike(String value) { + addCriterion("follow_id like", value, "followId"); + return (Criteria) this; + } + + public Criteria andFollowIdNotLike(String value) { + addCriterion("follow_id not like", value, "followId"); + return (Criteria) this; + } + + public Criteria andFollowIdIn(List values) { + addCriterion("follow_id in", values, "followId"); + return (Criteria) this; + } + + public Criteria andFollowIdNotIn(List values) { + addCriterion("follow_id not in", values, "followId"); + return (Criteria) this; + } + + public Criteria andFollowIdBetween(String value1, String value2) { + addCriterion("follow_id between", value1, value2, "followId"); + return (Criteria) this; + } + + public Criteria andFollowIdNotBetween(String value1, String value2) { + addCriterion("follow_id not between", value1, value2, "followId"); + 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/src/main/java/io/metersphere/base/mapper/IssueFollowMapper.java b/backend/src/main/java/io/metersphere/base/mapper/IssueFollowMapper.java new file mode 100644 index 0000000000..975a09b152 --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/IssueFollowMapper.java @@ -0,0 +1,22 @@ +package io.metersphere.base.mapper; + +import io.metersphere.base.domain.IssueFollow; +import io.metersphere.base.domain.IssueFollowExample; +import java.util.List; +import org.apache.ibatis.annotations.Param; + +public interface IssueFollowMapper { + long countByExample(IssueFollowExample example); + + int deleteByExample(IssueFollowExample example); + + int insert(IssueFollow record); + + int insertSelective(IssueFollow record); + + List selectByExample(IssueFollowExample example); + + int updateByExampleSelective(@Param("record") IssueFollow record, @Param("example") IssueFollowExample example); + + int updateByExample(@Param("record") IssueFollow record, @Param("example") IssueFollowExample example); +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/IssueFollowMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/IssueFollowMapper.xml new file mode 100644 index 0000000000..0f5a920131 --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/IssueFollowMapper.xml @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + issue_id, follow_id + + + + delete from issue_follow + + + + + + insert into issue_follow (issue_id, follow_id) + values (#{issueId,jdbcType=VARCHAR}, #{followId,jdbcType=VARCHAR}) + + + insert into issue_follow + + + issue_id, + + + follow_id, + + + + + #{issueId,jdbcType=VARCHAR}, + + + #{followId,jdbcType=VARCHAR}, + + + + + + update issue_follow + + + issue_id = #{record.issueId,jdbcType=VARCHAR}, + + + follow_id = #{record.followId,jdbcType=VARCHAR}, + + + + + + + + update issue_follow + set issue_id = #{record.issueId,jdbcType=VARCHAR}, + follow_id = #{record.followId,jdbcType=VARCHAR} + + + + + \ No newline at end of file diff --git a/backend/src/main/resources/generatorConfig.xml b/backend/src/main/resources/generatorConfig.xml index f667c6ab03..274d499d97 100644 --- a/backend/src/main/resources/generatorConfig.xml +++ b/backend/src/main/resources/generatorConfig.xml @@ -71,16 +71,16 @@ - +
-
+ diff --git a/frontend/src/business/components/track/case/components/TestCaseEdit.vue b/frontend/src/business/components/track/case/components/TestCaseEdit.vue index 690d5a5771..fd57fb638f 100644 --- a/frontend/src/business/components/track/case/components/TestCaseEdit.vue +++ b/frontend/src/business/components/track/case/components/TestCaseEdit.vue @@ -7,7 +7,7 @@
- + {{$t('operating_log.change_history')}} - + + + @@ -99,6 +101,7 @@ export default { result: {}, relateFields: [], isFormAlive: true, + showFollow:false, formLabelWidth: "150px", issueTemplate: {}, customFieldForm: {}, @@ -278,12 +281,22 @@ export default { }); } }, + saveFollow(){ + if(this.showFollow){ + this.showFollow = false; + }else { + this.showFollow = true; + + } + } } };