From 51aa7e88b423a6c3109446536ba3890760eb82da Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Wed, 6 May 2020 14:40:51 +0800 Subject: [PATCH 01/23] =?UTF-8?q?=E4=BD=BF=E7=94=A8lombok?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/pom.xml | 6 + .../io/metersphere/base/domain/ApiTest.java | 59 +-------- .../metersphere/base/domain/ApiTestFile.java | 19 +-- .../base/domain/ApiTestReport.java | 67 +--------- .../base/domain/ApiTestWithBLOBs.java | 23 +--- .../metersphere/base/domain/FileContent.java | 19 +-- .../metersphere/base/domain/FileMetadata.java | 51 +------- .../io/metersphere/base/domain/LoadTest.java | 67 +--------- .../metersphere/base/domain/LoadTestFile.java | 19 +-- .../base/domain/LoadTestReport.java | 51 +------- .../base/domain/LoadTestReportDetail.java | 19 +-- .../base/domain/LoadTestReportLog.java | 35 +---- .../base/domain/LoadTestReportResult.java | 35 +---- .../base/domain/LoadTestReportWithBLOBs.java | 23 +--- .../base/domain/LoadTestWithBLOBs.java | 31 +---- .../metersphere/base/domain/Organization.java | 43 +------ .../io/metersphere/base/domain/Project.java | 51 +------- .../java/io/metersphere/base/domain/Role.java | 51 +------- .../base/domain/SystemParameter.java | 35 +---- .../io/metersphere/base/domain/TestCase.java | 99 +-------------- .../metersphere/base/domain/TestCaseNode.java | 59 +-------- .../base/domain/TestCaseReport.java | 39 +----- .../base/domain/TestCaseReportExample.java | 120 ++++++++++++++++++ .../base/domain/TestCaseReportTemplate.java | 39 +----- .../domain/TestCaseReportTemplateExample.java | 120 ++++++++++++++++++ .../base/domain/TestCaseWithBLOBs.java | 23 +--- .../io/metersphere/base/domain/TestPlan.java | 107 +--------------- .../base/domain/TestPlanTestCase.java | 75 +---------- .../metersphere/base/domain/TestResource.java | 51 +------- .../base/domain/TestResourcePool.java | 59 +-------- .../java/io/metersphere/base/domain/User.java | 91 +------------ .../io/metersphere/base/domain/UserRole.java | 51 +------- .../io/metersphere/base/domain/Workspace.java | 51 +------- .../base/mapper/TestCaseNodeMapper.xml | 24 ++-- .../base/mapper/TestCaseReportMapper.xml | 58 +++++++-- .../mapper/TestCaseReportTemplateMapper.xml | 58 +++++++-- .../src/main/resources/generatorConfig.xml | 38 +++++- 37 files changed, 503 insertions(+), 1363 deletions(-) diff --git a/backend/pom.xml b/backend/pom.xml index 10ee9e77ab..75b67f5b2b 100644 --- a/backend/pom.xml +++ b/backend/pom.xml @@ -66,6 +66,7 @@ org.projectlombok lombok + provided @@ -255,6 +256,11 @@ mysql-connector-java 5.1.41 + + com.itfsw + mybatis-generator-plugin + 1.3.8 + diff --git a/backend/src/main/java/io/metersphere/base/domain/ApiTest.java b/backend/src/main/java/io/metersphere/base/domain/ApiTest.java index 0e38a14f54..181e99a348 100644 --- a/backend/src/main/java/io/metersphere/base/domain/ApiTest.java +++ b/backend/src/main/java/io/metersphere/base/domain/ApiTest.java @@ -1,7 +1,10 @@ package io.metersphere.base.domain; +import lombok.Data; + import java.io.Serializable; +@Data public class ApiTest implements Serializable { private String id; @@ -18,60 +21,4 @@ public class ApiTest implements Serializable { private Long updateTime; private static final long serialVersionUID = 1L; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getProjectId() { - return projectId; - } - - public void setProjectId(String projectId) { - this.projectId = projectId == null ? null : projectId.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description == null ? null : description.trim(); - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status == null ? null : status.trim(); - } - - public Long getCreateTime() { - return createTime; - } - - public void setCreateTime(Long createTime) { - this.createTime = createTime; - } - - public Long getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Long updateTime) { - this.updateTime = updateTime; - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/ApiTestFile.java b/backend/src/main/java/io/metersphere/base/domain/ApiTestFile.java index 2172236176..f465702ba5 100644 --- a/backend/src/main/java/io/metersphere/base/domain/ApiTestFile.java +++ b/backend/src/main/java/io/metersphere/base/domain/ApiTestFile.java @@ -1,27 +1,14 @@ package io.metersphere.base.domain; +import lombok.Data; + import java.io.Serializable; +@Data public class ApiTestFile implements Serializable { private String testId; private String fileId; private static final long serialVersionUID = 1L; - - public String getTestId() { - return testId; - } - - public void setTestId(String testId) { - this.testId = testId == null ? null : testId.trim(); - } - - public String getFileId() { - return fileId; - } - - public void setFileId(String fileId) { - this.fileId = fileId == null ? null : fileId.trim(); - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/ApiTestReport.java b/backend/src/main/java/io/metersphere/base/domain/ApiTestReport.java index 4f58138870..87b1e7aebe 100644 --- a/backend/src/main/java/io/metersphere/base/domain/ApiTestReport.java +++ b/backend/src/main/java/io/metersphere/base/domain/ApiTestReport.java @@ -1,7 +1,10 @@ package io.metersphere.base.domain; +import lombok.Data; + import java.io.Serializable; +@Data public class ApiTestReport implements Serializable { private String id; @@ -20,68 +23,4 @@ public class ApiTestReport implements Serializable { private String content; private static final long serialVersionUID = 1L; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getTestId() { - return testId; - } - - public void setTestId(String testId) { - this.testId = testId == null ? null : testId.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description == null ? null : description.trim(); - } - - public Long getCreateTime() { - return createTime; - } - - public void setCreateTime(Long createTime) { - this.createTime = createTime; - } - - public Long getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Long updateTime) { - this.updateTime = updateTime; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status == null ? null : status.trim(); - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content == null ? null : content.trim(); - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/ApiTestWithBLOBs.java b/backend/src/main/java/io/metersphere/base/domain/ApiTestWithBLOBs.java index 8e9bb95b4a..04d3109a69 100644 --- a/backend/src/main/java/io/metersphere/base/domain/ApiTestWithBLOBs.java +++ b/backend/src/main/java/io/metersphere/base/domain/ApiTestWithBLOBs.java @@ -1,27 +1,18 @@ package io.metersphere.base.domain; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + import java.io.Serializable; +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) public class ApiTestWithBLOBs extends ApiTest implements Serializable { private String scenarioDefinition; private String schedule; private static final long serialVersionUID = 1L; - - public String getScenarioDefinition() { - return scenarioDefinition; - } - - public void setScenarioDefinition(String scenarioDefinition) { - this.scenarioDefinition = scenarioDefinition == null ? null : scenarioDefinition.trim(); - } - - public String getSchedule() { - return schedule; - } - - public void setSchedule(String schedule) { - this.schedule = schedule == null ? null : schedule.trim(); - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/FileContent.java b/backend/src/main/java/io/metersphere/base/domain/FileContent.java index 3efd113734..a693730050 100644 --- a/backend/src/main/java/io/metersphere/base/domain/FileContent.java +++ b/backend/src/main/java/io/metersphere/base/domain/FileContent.java @@ -1,27 +1,14 @@ package io.metersphere.base.domain; +import lombok.Data; + import java.io.Serializable; +@Data public class FileContent implements Serializable { private String fileId; private byte[] file; private static final long serialVersionUID = 1L; - - public String getFileId() { - return fileId; - } - - public void setFileId(String fileId) { - this.fileId = fileId == null ? null : fileId.trim(); - } - - public byte[] getFile() { - return file; - } - - public void setFile(byte[] file) { - this.file = file; - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/FileMetadata.java b/backend/src/main/java/io/metersphere/base/domain/FileMetadata.java index 29792982fd..ee799a3fc4 100644 --- a/backend/src/main/java/io/metersphere/base/domain/FileMetadata.java +++ b/backend/src/main/java/io/metersphere/base/domain/FileMetadata.java @@ -1,7 +1,10 @@ package io.metersphere.base.domain; +import lombok.Data; + import java.io.Serializable; +@Data public class FileMetadata implements Serializable { private String id; @@ -16,52 +19,4 @@ public class FileMetadata implements Serializable { private Long size; private static final long serialVersionUID = 1L; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public Long getCreateTime() { - return createTime; - } - - public void setCreateTime(Long createTime) { - this.createTime = createTime; - } - - public Long getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Long updateTime) { - this.updateTime = updateTime; - } - - public Long getSize() { - return size; - } - - public void setSize(Long size) { - this.size = size; - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/LoadTest.java b/backend/src/main/java/io/metersphere/base/domain/LoadTest.java index 0bf8f56015..8c8c89a1a6 100644 --- a/backend/src/main/java/io/metersphere/base/domain/LoadTest.java +++ b/backend/src/main/java/io/metersphere/base/domain/LoadTest.java @@ -1,7 +1,10 @@ package io.metersphere.base.domain; +import lombok.Data; + import java.io.Serializable; +@Data public class LoadTest implements Serializable { private String id; @@ -20,68 +23,4 @@ public class LoadTest implements Serializable { private String testResourcePoolId; private static final long serialVersionUID = 1L; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getProjectId() { - return projectId; - } - - public void setProjectId(String projectId) { - this.projectId = projectId == null ? null : projectId.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description == null ? null : description.trim(); - } - - public Long getCreateTime() { - return createTime; - } - - public void setCreateTime(Long createTime) { - this.createTime = createTime; - } - - public Long getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Long updateTime) { - this.updateTime = updateTime; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status == null ? null : status.trim(); - } - - public String getTestResourcePoolId() { - return testResourcePoolId; - } - - public void setTestResourcePoolId(String testResourcePoolId) { - this.testResourcePoolId = testResourcePoolId == null ? null : testResourcePoolId.trim(); - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/LoadTestFile.java b/backend/src/main/java/io/metersphere/base/domain/LoadTestFile.java index cc243ec086..0fc212656e 100644 --- a/backend/src/main/java/io/metersphere/base/domain/LoadTestFile.java +++ b/backend/src/main/java/io/metersphere/base/domain/LoadTestFile.java @@ -1,27 +1,14 @@ package io.metersphere.base.domain; +import lombok.Data; + import java.io.Serializable; +@Data public class LoadTestFile implements Serializable { private String testId; private String fileId; private static final long serialVersionUID = 1L; - - public String getTestId() { - return testId; - } - - public void setTestId(String testId) { - this.testId = testId == null ? null : testId.trim(); - } - - public String getFileId() { - return fileId; - } - - public void setFileId(String fileId) { - this.fileId = fileId == null ? null : fileId.trim(); - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/LoadTestReport.java b/backend/src/main/java/io/metersphere/base/domain/LoadTestReport.java index 4b5a36376f..c0d76f67ce 100644 --- a/backend/src/main/java/io/metersphere/base/domain/LoadTestReport.java +++ b/backend/src/main/java/io/metersphere/base/domain/LoadTestReport.java @@ -1,7 +1,10 @@ package io.metersphere.base.domain; +import lombok.Data; + import java.io.Serializable; +@Data public class LoadTestReport implements Serializable { private String id; @@ -16,52 +19,4 @@ public class LoadTestReport implements Serializable { private String status; private static final long serialVersionUID = 1L; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getTestId() { - return testId; - } - - public void setTestId(String testId) { - this.testId = testId == null ? null : testId.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public Long getCreateTime() { - return createTime; - } - - public void setCreateTime(Long createTime) { - this.createTime = createTime; - } - - public Long getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Long updateTime) { - this.updateTime = updateTime; - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status == null ? null : status.trim(); - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/LoadTestReportDetail.java b/backend/src/main/java/io/metersphere/base/domain/LoadTestReportDetail.java index 80425ac525..442ce74b06 100644 --- a/backend/src/main/java/io/metersphere/base/domain/LoadTestReportDetail.java +++ b/backend/src/main/java/io/metersphere/base/domain/LoadTestReportDetail.java @@ -1,27 +1,14 @@ package io.metersphere.base.domain; +import lombok.Data; + import java.io.Serializable; +@Data public class LoadTestReportDetail implements Serializable { private String reportId; private String content; private static final long serialVersionUID = 1L; - - public String getReportId() { - return reportId; - } - - public void setReportId(String reportId) { - this.reportId = reportId == null ? null : reportId.trim(); - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content == null ? null : content.trim(); - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/LoadTestReportLog.java b/backend/src/main/java/io/metersphere/base/domain/LoadTestReportLog.java index 5f49329f18..6221094d72 100644 --- a/backend/src/main/java/io/metersphere/base/domain/LoadTestReportLog.java +++ b/backend/src/main/java/io/metersphere/base/domain/LoadTestReportLog.java @@ -1,7 +1,10 @@ package io.metersphere.base.domain; +import lombok.Data; + import java.io.Serializable; +@Data public class LoadTestReportLog implements Serializable { private Long id; @@ -12,36 +15,4 @@ public class LoadTestReportLog implements Serializable { private String content; private static final long serialVersionUID = 1L; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getReportId() { - return reportId; - } - - public void setReportId(String reportId) { - this.reportId = reportId == null ? null : reportId.trim(); - } - - public String getResourceId() { - return resourceId; - } - - public void setResourceId(String resourceId) { - this.resourceId = resourceId == null ? null : resourceId.trim(); - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content == null ? null : content.trim(); - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/LoadTestReportResult.java b/backend/src/main/java/io/metersphere/base/domain/LoadTestReportResult.java index 65c62c6e6b..f22100b725 100644 --- a/backend/src/main/java/io/metersphere/base/domain/LoadTestReportResult.java +++ b/backend/src/main/java/io/metersphere/base/domain/LoadTestReportResult.java @@ -1,7 +1,10 @@ package io.metersphere.base.domain; +import lombok.Data; + import java.io.Serializable; +@Data public class LoadTestReportResult implements Serializable { private Long id; @@ -12,36 +15,4 @@ public class LoadTestReportResult implements Serializable { private String reportValue; private static final long serialVersionUID = 1L; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getReportId() { - return reportId; - } - - public void setReportId(String reportId) { - this.reportId = reportId == null ? null : reportId.trim(); - } - - public String getReportKey() { - return reportKey; - } - - public void setReportKey(String reportKey) { - this.reportKey = reportKey == null ? null : reportKey.trim(); - } - - public String getReportValue() { - return reportValue; - } - - public void setReportValue(String reportValue) { - this.reportValue = reportValue == null ? null : reportValue.trim(); - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/LoadTestReportWithBLOBs.java b/backend/src/main/java/io/metersphere/base/domain/LoadTestReportWithBLOBs.java index bb63601231..3e8d33d570 100644 --- a/backend/src/main/java/io/metersphere/base/domain/LoadTestReportWithBLOBs.java +++ b/backend/src/main/java/io/metersphere/base/domain/LoadTestReportWithBLOBs.java @@ -1,27 +1,18 @@ package io.metersphere.base.domain; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + import java.io.Serializable; +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) public class LoadTestReportWithBLOBs extends LoadTestReport implements Serializable { private String description; private String content; private static final long serialVersionUID = 1L; - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description == null ? null : description.trim(); - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content == null ? null : content.trim(); - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/LoadTestWithBLOBs.java b/backend/src/main/java/io/metersphere/base/domain/LoadTestWithBLOBs.java index 70b0a75b92..7af18545e1 100644 --- a/backend/src/main/java/io/metersphere/base/domain/LoadTestWithBLOBs.java +++ b/backend/src/main/java/io/metersphere/base/domain/LoadTestWithBLOBs.java @@ -1,7 +1,14 @@ package io.metersphere.base.domain; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + import java.io.Serializable; +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) public class LoadTestWithBLOBs extends LoadTest implements Serializable { private String loadConfiguration; @@ -10,28 +17,4 @@ public class LoadTestWithBLOBs extends LoadTest implements Serializable { private String schedule; private static final long serialVersionUID = 1L; - - public String getLoadConfiguration() { - return loadConfiguration; - } - - public void setLoadConfiguration(String loadConfiguration) { - this.loadConfiguration = loadConfiguration == null ? null : loadConfiguration.trim(); - } - - public String getAdvancedConfiguration() { - return advancedConfiguration; - } - - public void setAdvancedConfiguration(String advancedConfiguration) { - this.advancedConfiguration = advancedConfiguration == null ? null : advancedConfiguration.trim(); - } - - public String getSchedule() { - return schedule; - } - - public void setSchedule(String schedule) { - this.schedule = schedule == null ? null : schedule.trim(); - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/Organization.java b/backend/src/main/java/io/metersphere/base/domain/Organization.java index e792ed3c89..cfc5ae3a73 100644 --- a/backend/src/main/java/io/metersphere/base/domain/Organization.java +++ b/backend/src/main/java/io/metersphere/base/domain/Organization.java @@ -1,7 +1,10 @@ package io.metersphere.base.domain; +import lombok.Data; + import java.io.Serializable; +@Data public class Organization implements Serializable { private String id; @@ -14,44 +17,4 @@ public class Organization implements Serializable { private Long updateTime; private static final long serialVersionUID = 1L; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description == null ? null : description.trim(); - } - - public Long getCreateTime() { - return createTime; - } - - public void setCreateTime(Long createTime) { - this.createTime = createTime; - } - - public Long getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Long updateTime) { - this.updateTime = updateTime; - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/Project.java b/backend/src/main/java/io/metersphere/base/domain/Project.java index 4d6a8f8ad4..f1af671f4e 100644 --- a/backend/src/main/java/io/metersphere/base/domain/Project.java +++ b/backend/src/main/java/io/metersphere/base/domain/Project.java @@ -1,7 +1,10 @@ package io.metersphere.base.domain; +import lombok.Data; + import java.io.Serializable; +@Data public class Project implements Serializable { private String id; @@ -16,52 +19,4 @@ public class Project implements Serializable { private Long updateTime; private static final long serialVersionUID = 1L; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getWorkspaceId() { - return workspaceId; - } - - public void setWorkspaceId(String workspaceId) { - this.workspaceId = workspaceId == null ? null : workspaceId.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description == null ? null : description.trim(); - } - - public Long getCreateTime() { - return createTime; - } - - public void setCreateTime(Long createTime) { - this.createTime = createTime; - } - - public Long getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Long updateTime) { - this.updateTime = updateTime; - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/Role.java b/backend/src/main/java/io/metersphere/base/domain/Role.java index 3a44d8b1d2..b2ecae0b96 100644 --- a/backend/src/main/java/io/metersphere/base/domain/Role.java +++ b/backend/src/main/java/io/metersphere/base/domain/Role.java @@ -1,7 +1,10 @@ package io.metersphere.base.domain; +import lombok.Data; + import java.io.Serializable; +@Data public class Role implements Serializable { private String id; @@ -16,52 +19,4 @@ public class Role implements Serializable { private Long updateTime; private static final long serialVersionUID = 1L; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description == null ? null : description.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public Long getCreateTime() { - return createTime; - } - - public void setCreateTime(Long createTime) { - this.createTime = createTime; - } - - public Long getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Long updateTime) { - this.updateTime = updateTime; - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/SystemParameter.java b/backend/src/main/java/io/metersphere/base/domain/SystemParameter.java index 6c71ccead2..719d7c1a73 100644 --- a/backend/src/main/java/io/metersphere/base/domain/SystemParameter.java +++ b/backend/src/main/java/io/metersphere/base/domain/SystemParameter.java @@ -1,7 +1,10 @@ package io.metersphere.base.domain; +import lombok.Data; + import java.io.Serializable; +@Data public class SystemParameter implements Serializable { private String paramKey; @@ -12,36 +15,4 @@ public class SystemParameter implements Serializable { private Integer sort; private static final long serialVersionUID = 1L; - - public String getParamKey() { - return paramKey; - } - - public void setParamKey(String paramKey) { - this.paramKey = paramKey == null ? null : paramKey.trim(); - } - - public String getParamValue() { - return paramValue; - } - - public void setParamValue(String paramValue) { - this.paramValue = paramValue == null ? null : paramValue.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public Integer getSort() { - return sort; - } - - public void setSort(Integer sort) { - this.sort = sort; - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/TestCase.java b/backend/src/main/java/io/metersphere/base/domain/TestCase.java index f78dbe1335..121b99d8ca 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestCase.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestCase.java @@ -1,7 +1,10 @@ package io.metersphere.base.domain; +import lombok.Data; + import java.io.Serializable; +@Data public class TestCase implements Serializable { private String id; @@ -28,100 +31,4 @@ public class TestCase implements Serializable { private Long updateTime; private static final long serialVersionUID = 1L; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public Integer getNodeId() { - return nodeId; - } - - public void setNodeId(Integer nodeId) { - this.nodeId = nodeId; - } - - public String getNodePath() { - return nodePath; - } - - public void setNodePath(String nodePath) { - this.nodePath = nodePath == null ? null : nodePath.trim(); - } - - public String getProjectId() { - return projectId; - } - - public void setProjectId(String projectId) { - this.projectId = projectId == null ? null : projectId.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public String getMaintainer() { - return maintainer; - } - - public void setMaintainer(String maintainer) { - this.maintainer = maintainer == null ? null : maintainer.trim(); - } - - public String getPriority() { - return priority; - } - - public void setPriority(String priority) { - this.priority = priority == null ? null : priority.trim(); - } - - public String getMethod() { - return method; - } - - public void setMethod(String method) { - this.method = method == null ? null : method.trim(); - } - - public String getPrerequisite() { - return prerequisite; - } - - public void setPrerequisite(String prerequisite) { - this.prerequisite = prerequisite == null ? null : prerequisite.trim(); - } - - public Long getCreateTime() { - return createTime; - } - - public void setCreateTime(Long createTime) { - this.createTime = createTime; - } - - public Long getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Long updateTime) { - this.updateTime = updateTime; - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/TestCaseNode.java b/backend/src/main/java/io/metersphere/base/domain/TestCaseNode.java index 1c4b370325..6237c938e4 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestCaseNode.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestCaseNode.java @@ -1,7 +1,10 @@ package io.metersphere.base.domain; +import lombok.Data; + import java.io.Serializable; +@Data public class TestCaseNode implements Serializable { private Integer id; @@ -18,60 +21,4 @@ public class TestCaseNode implements Serializable { private Long updateTime; private static final long serialVersionUID = 1L; - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getProjectId() { - return projectId; - } - - public void setProjectId(String projectId) { - this.projectId = projectId == null ? null : projectId.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public Integer getpId() { - return pId; - } - - public void setpId(Integer pId) { - this.pId = pId; - } - - public Integer getLevel() { - return level; - } - - public void setLevel(Integer level) { - this.level = level; - } - - public Long getCreateTime() { - return createTime; - } - - public void setCreateTime(Long createTime) { - this.createTime = createTime; - } - - public Long getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Long updateTime) { - this.updateTime = updateTime; - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/TestCaseReport.java b/backend/src/main/java/io/metersphere/base/domain/TestCaseReport.java index b70e93cbf2..4f20d531c7 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestCaseReport.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestCaseReport.java @@ -1,7 +1,10 @@ package io.metersphere.base.domain; +import lombok.Data; + import java.io.Serializable; +@Data public class TestCaseReport implements Serializable { private Long id; @@ -9,39 +12,11 @@ public class TestCaseReport implements Serializable { private String planId; + private Long startTime; + + private Long endTime; + private String content; private static final long serialVersionUID = 1L; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getPlanId() { - return planId; - } - - public void setPlanId(String planId) { - this.planId = planId == null ? null : planId.trim(); - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content == null ? null : content.trim(); - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/TestCaseReportExample.java b/backend/src/main/java/io/metersphere/base/domain/TestCaseReportExample.java index f43ff0744f..840e65ac12 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestCaseReportExample.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestCaseReportExample.java @@ -303,6 +303,126 @@ public class TestCaseReportExample { addCriterion("plan_id not between", value1, value2, "planId"); return (Criteria) this; } + + public Criteria andStartTimeIsNull() { + addCriterion("start_time is null"); + return (Criteria) this; + } + + public Criteria andStartTimeIsNotNull() { + addCriterion("start_time is not null"); + return (Criteria) this; + } + + public Criteria andStartTimeEqualTo(Long value) { + addCriterion("start_time =", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotEqualTo(Long value) { + addCriterion("start_time <>", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeGreaterThan(Long value) { + addCriterion("start_time >", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeGreaterThanOrEqualTo(Long value) { + addCriterion("start_time >=", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeLessThan(Long value) { + addCriterion("start_time <", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeLessThanOrEqualTo(Long value) { + addCriterion("start_time <=", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeIn(List values) { + addCriterion("start_time in", values, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotIn(List values) { + addCriterion("start_time not in", values, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeBetween(Long value1, Long value2) { + addCriterion("start_time between", value1, value2, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotBetween(Long value1, Long value2) { + addCriterion("start_time not between", value1, value2, "startTime"); + return (Criteria) this; + } + + public Criteria andEndTimeIsNull() { + addCriterion("end_time is null"); + return (Criteria) this; + } + + public Criteria andEndTimeIsNotNull() { + addCriterion("end_time is not null"); + return (Criteria) this; + } + + public Criteria andEndTimeEqualTo(Long value) { + addCriterion("end_time =", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotEqualTo(Long value) { + addCriterion("end_time <>", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeGreaterThan(Long value) { + addCriterion("end_time >", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeGreaterThanOrEqualTo(Long value) { + addCriterion("end_time >=", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeLessThan(Long value) { + addCriterion("end_time <", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeLessThanOrEqualTo(Long value) { + addCriterion("end_time <=", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeIn(List values) { + addCriterion("end_time in", values, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotIn(List values) { + addCriterion("end_time not in", values, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeBetween(Long value1, Long value2) { + addCriterion("end_time between", value1, value2, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotBetween(Long value1, Long value2) { + addCriterion("end_time not between", value1, value2, "endTime"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/backend/src/main/java/io/metersphere/base/domain/TestCaseReportTemplate.java b/backend/src/main/java/io/metersphere/base/domain/TestCaseReportTemplate.java index 05220801fd..29b66e90f5 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestCaseReportTemplate.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestCaseReportTemplate.java @@ -1,7 +1,10 @@ package io.metersphere.base.domain; +import lombok.Data; + import java.io.Serializable; +@Data public class TestCaseReportTemplate implements Serializable { private Long id; @@ -9,39 +12,11 @@ public class TestCaseReportTemplate implements Serializable { private String workspaceId; + private Long startTime; + + private Long endTime; + private String content; private static final long serialVersionUID = 1L; - - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getWorkspaceId() { - return workspaceId; - } - - public void setWorkspaceId(String workspaceId) { - this.workspaceId = workspaceId == null ? null : workspaceId.trim(); - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content == null ? null : content.trim(); - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/TestCaseReportTemplateExample.java b/backend/src/main/java/io/metersphere/base/domain/TestCaseReportTemplateExample.java index a0c5b96a60..03b3616d6f 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestCaseReportTemplateExample.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestCaseReportTemplateExample.java @@ -303,6 +303,126 @@ public class TestCaseReportTemplateExample { addCriterion("workspace_id not between", value1, value2, "workspaceId"); return (Criteria) this; } + + public Criteria andStartTimeIsNull() { + addCriterion("start_time is null"); + return (Criteria) this; + } + + public Criteria andStartTimeIsNotNull() { + addCriterion("start_time is not null"); + return (Criteria) this; + } + + public Criteria andStartTimeEqualTo(Long value) { + addCriterion("start_time =", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotEqualTo(Long value) { + addCriterion("start_time <>", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeGreaterThan(Long value) { + addCriterion("start_time >", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeGreaterThanOrEqualTo(Long value) { + addCriterion("start_time >=", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeLessThan(Long value) { + addCriterion("start_time <", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeLessThanOrEqualTo(Long value) { + addCriterion("start_time <=", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeIn(List values) { + addCriterion("start_time in", values, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotIn(List values) { + addCriterion("start_time not in", values, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeBetween(Long value1, Long value2) { + addCriterion("start_time between", value1, value2, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotBetween(Long value1, Long value2) { + addCriterion("start_time not between", value1, value2, "startTime"); + return (Criteria) this; + } + + public Criteria andEndTimeIsNull() { + addCriterion("end_time is null"); + return (Criteria) this; + } + + public Criteria andEndTimeIsNotNull() { + addCriterion("end_time is not null"); + return (Criteria) this; + } + + public Criteria andEndTimeEqualTo(Long value) { + addCriterion("end_time =", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotEqualTo(Long value) { + addCriterion("end_time <>", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeGreaterThan(Long value) { + addCriterion("end_time >", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeGreaterThanOrEqualTo(Long value) { + addCriterion("end_time >=", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeLessThan(Long value) { + addCriterion("end_time <", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeLessThanOrEqualTo(Long value) { + addCriterion("end_time <=", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeIn(List values) { + addCriterion("end_time in", values, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotIn(List values) { + addCriterion("end_time not in", values, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeBetween(Long value1, Long value2) { + addCriterion("end_time between", value1, value2, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotBetween(Long value1, Long value2) { + addCriterion("end_time not between", value1, value2, "endTime"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/backend/src/main/java/io/metersphere/base/domain/TestCaseWithBLOBs.java b/backend/src/main/java/io/metersphere/base/domain/TestCaseWithBLOBs.java index df325d67b2..a07a2e6285 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestCaseWithBLOBs.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestCaseWithBLOBs.java @@ -1,27 +1,18 @@ package io.metersphere.base.domain; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; + import java.io.Serializable; +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) public class TestCaseWithBLOBs extends TestCase implements Serializable { private String remark; private String steps; private static final long serialVersionUID = 1L; - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark == null ? null : remark.trim(); - } - - public String getSteps() { - return steps; - } - - public void setSteps(String steps) { - this.steps = steps == null ? null : steps.trim(); - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/TestPlan.java b/backend/src/main/java/io/metersphere/base/domain/TestPlan.java index e19aeba2b9..c968eff1cf 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestPlan.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestPlan.java @@ -1,7 +1,10 @@ package io.metersphere.base.domain; +import lombok.Data; + import java.io.Serializable; +@Data public class TestPlan implements Serializable { private String id; @@ -30,108 +33,4 @@ public class TestPlan implements Serializable { private String tags; private static final long serialVersionUID = 1L; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getProjectId() { - return projectId; - } - - public void setProjectId(String projectId) { - this.projectId = projectId == null ? null : projectId.trim(); - } - - public String getWorkspaceId() { - return workspaceId; - } - - public void setWorkspaceId(String workspaceId) { - this.workspaceId = workspaceId == null ? null : workspaceId.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description == null ? null : description.trim(); - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status == null ? null : status.trim(); - } - - public String getStage() { - return stage; - } - - public void setStage(String stage) { - this.stage = stage == null ? null : stage.trim(); - } - - public String getPrincipal() { - return principal; - } - - public void setPrincipal(String principal) { - this.principal = principal == null ? null : principal.trim(); - } - - public String getTestCaseMatchRule() { - return testCaseMatchRule; - } - - public void setTestCaseMatchRule(String testCaseMatchRule) { - this.testCaseMatchRule = testCaseMatchRule == null ? null : testCaseMatchRule.trim(); - } - - public String getExecutorMatchRule() { - return executorMatchRule; - } - - public void setExecutorMatchRule(String executorMatchRule) { - this.executorMatchRule = executorMatchRule == null ? null : executorMatchRule.trim(); - } - - public Long getCreateTime() { - return createTime; - } - - public void setCreateTime(Long createTime) { - this.createTime = createTime; - } - - public Long getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Long updateTime) { - this.updateTime = updateTime; - } - - public String getTags() { - return tags; - } - - public void setTags(String tags) { - this.tags = tags == null ? null : tags.trim(); - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/TestPlanTestCase.java b/backend/src/main/java/io/metersphere/base/domain/TestPlanTestCase.java index c1fe14991f..cc6851718f 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestPlanTestCase.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestPlanTestCase.java @@ -1,7 +1,10 @@ package io.metersphere.base.domain; +import lombok.Data; + import java.io.Serializable; +@Data public class TestPlanTestCase implements Serializable { private Integer id; @@ -22,76 +25,4 @@ public class TestPlanTestCase implements Serializable { private String results; private static final long serialVersionUID = 1L; - - public Integer getId() { - return id; - } - - public void setId(Integer id) { - this.id = id; - } - - public String getPlanId() { - return planId; - } - - public void setPlanId(String planId) { - this.planId = planId == null ? null : planId.trim(); - } - - public String getCaseId() { - return caseId; - } - - public void setCaseId(String caseId) { - this.caseId = caseId == null ? null : caseId.trim(); - } - - public String getExecutor() { - return executor; - } - - public void setExecutor(String executor) { - this.executor = executor == null ? null : executor.trim(); - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status == null ? null : status.trim(); - } - - public String getRemark() { - return remark; - } - - public void setRemark(String remark) { - this.remark = remark == null ? null : remark.trim(); - } - - public Long getCreateTime() { - return createTime; - } - - public void setCreateTime(Long createTime) { - this.createTime = createTime; - } - - public Long getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Long updateTime) { - this.updateTime = updateTime; - } - - public String getResults() { - return results; - } - - public void setResults(String results) { - this.results = results == null ? null : results.trim(); - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/TestResource.java b/backend/src/main/java/io/metersphere/base/domain/TestResource.java index b20b15820e..89925a154a 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestResource.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestResource.java @@ -1,7 +1,10 @@ package io.metersphere.base.domain; +import lombok.Data; + import java.io.Serializable; +@Data public class TestResource implements Serializable { private String id; @@ -16,52 +19,4 @@ public class TestResource implements Serializable { private String configuration; private static final long serialVersionUID = 1L; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getTestResourcePoolId() { - return testResourcePoolId; - } - - public void setTestResourcePoolId(String testResourcePoolId) { - this.testResourcePoolId = testResourcePoolId == null ? null : testResourcePoolId.trim(); - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status == null ? null : status.trim(); - } - - public Long getCreateTime() { - return createTime; - } - - public void setCreateTime(Long createTime) { - this.createTime = createTime; - } - - public Long getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Long updateTime) { - this.updateTime = updateTime; - } - - public String getConfiguration() { - return configuration; - } - - public void setConfiguration(String configuration) { - this.configuration = configuration == null ? null : configuration.trim(); - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/TestResourcePool.java b/backend/src/main/java/io/metersphere/base/domain/TestResourcePool.java index c2eb38d5da..de2a5800a1 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestResourcePool.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestResourcePool.java @@ -1,7 +1,10 @@ package io.metersphere.base.domain; +import lombok.Data; + import java.io.Serializable; +@Data public class TestResourcePool implements Serializable { private String id; @@ -18,60 +21,4 @@ public class TestResourcePool implements Serializable { private Long updateTime; private static final long serialVersionUID = 1L; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type == null ? null : type.trim(); - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description == null ? null : description.trim(); - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status == null ? null : status.trim(); - } - - public Long getCreateTime() { - return createTime; - } - - public void setCreateTime(Long createTime) { - this.createTime = createTime; - } - - public Long getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Long updateTime) { - this.updateTime = updateTime; - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/User.java b/backend/src/main/java/io/metersphere/base/domain/User.java index d72db65c02..2236965d75 100644 --- a/backend/src/main/java/io/metersphere/base/domain/User.java +++ b/backend/src/main/java/io/metersphere/base/domain/User.java @@ -1,7 +1,10 @@ package io.metersphere.base.domain; +import lombok.Data; + import java.io.Serializable; +@Data public class User implements Serializable { private String id; @@ -26,92 +29,4 @@ public class User implements Serializable { private String phone; private static final long serialVersionUID = 1L; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email == null ? null : email.trim(); - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password == null ? null : password.trim(); - } - - public String getStatus() { - return status; - } - - public void setStatus(String status) { - this.status = status == null ? null : status.trim(); - } - - public Long getCreateTime() { - return createTime; - } - - public void setCreateTime(Long createTime) { - this.createTime = createTime; - } - - public Long getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Long updateTime) { - this.updateTime = updateTime; - } - - public String getLanguage() { - return language; - } - - public void setLanguage(String language) { - this.language = language == null ? null : language.trim(); - } - - public String getLastWorkspaceId() { - return lastWorkspaceId; - } - - public void setLastWorkspaceId(String lastWorkspaceId) { - this.lastWorkspaceId = lastWorkspaceId == null ? null : lastWorkspaceId.trim(); - } - - public String getLastOrganizationId() { - return lastOrganizationId; - } - - public void setLastOrganizationId(String lastOrganizationId) { - this.lastOrganizationId = lastOrganizationId == null ? null : lastOrganizationId.trim(); - } - - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone == null ? null : phone.trim(); - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/UserRole.java b/backend/src/main/java/io/metersphere/base/domain/UserRole.java index 7fad770293..9b13531750 100644 --- a/backend/src/main/java/io/metersphere/base/domain/UserRole.java +++ b/backend/src/main/java/io/metersphere/base/domain/UserRole.java @@ -1,7 +1,10 @@ package io.metersphere.base.domain; +import lombok.Data; + import java.io.Serializable; +@Data public class UserRole implements Serializable { private String id; @@ -16,52 +19,4 @@ public class UserRole implements Serializable { private Long updateTime; private static final long serialVersionUID = 1L; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getUserId() { - return userId; - } - - public void setUserId(String userId) { - this.userId = userId == null ? null : userId.trim(); - } - - public String getRoleId() { - return roleId; - } - - public void setRoleId(String roleId) { - this.roleId = roleId == null ? null : roleId.trim(); - } - - public String getSourceId() { - return sourceId; - } - - public void setSourceId(String sourceId) { - this.sourceId = sourceId == null ? null : sourceId.trim(); - } - - public Long getCreateTime() { - return createTime; - } - - public void setCreateTime(Long createTime) { - this.createTime = createTime; - } - - public Long getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Long updateTime) { - this.updateTime = updateTime; - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/Workspace.java b/backend/src/main/java/io/metersphere/base/domain/Workspace.java index f2d9b56ce5..f7a8817923 100644 --- a/backend/src/main/java/io/metersphere/base/domain/Workspace.java +++ b/backend/src/main/java/io/metersphere/base/domain/Workspace.java @@ -1,7 +1,10 @@ package io.metersphere.base.domain; +import lombok.Data; + import java.io.Serializable; +@Data public class Workspace implements Serializable { private String id; @@ -16,52 +19,4 @@ public class Workspace implements Serializable { private Long updateTime; private static final long serialVersionUID = 1L; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id == null ? null : id.trim(); - } - - public String getOrganizationId() { - return organizationId; - } - - public void setOrganizationId(String organizationId) { - this.organizationId = organizationId == null ? null : organizationId.trim(); - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name == null ? null : name.trim(); - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description == null ? null : description.trim(); - } - - public Long getCreateTime() { - return createTime; - } - - public void setCreateTime(Long createTime) { - this.createTime = createTime; - } - - public Long getUpdateTime() { - return updateTime; - } - - public void setUpdateTime(Long updateTime) { - this.updateTime = updateTime; - } } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/TestCaseNodeMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/TestCaseNodeMapper.xml index 23b4d55cab..e6b29932c6 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/TestCaseNodeMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/TestCaseNodeMapper.xml @@ -102,22 +102,19 @@ - - SELECT LAST_INSERT_ID() - - insert into test_case_node (project_id, name, p_id, - level, create_time, update_time - ) - values (#{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pId,jdbcType=INTEGER}, - #{level,jdbcType=INTEGER}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT} - ) + insert into test_case_node (id, project_id, name, + p_id, level, create_time, + update_time) + values (#{id,jdbcType=INTEGER}, #{projectId,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, + #{pId,jdbcType=INTEGER}, #{level,jdbcType=INTEGER}, #{createTime,jdbcType=BIGINT}, + #{updateTime,jdbcType=BIGINT}) - - SELECT LAST_INSERT_ID() - insert into test_case_node + + id, + project_id, @@ -138,6 +135,9 @@ + + #{id,jdbcType=INTEGER}, + #{projectId,jdbcType=VARCHAR}, diff --git a/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportMapper.xml index 83b9a98434..af3fc3e539 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportMapper.xml @@ -5,6 +5,8 @@ + + @@ -68,7 +70,7 @@ - id, name, plan_id + id, name, plan_id, start_time, end_time content @@ -122,37 +124,51 @@ - - SELECT LAST_INSERT_ID() - - insert into test_case_report (name, plan_id, content + insert into test_case_report (id, name, plan_id, + start_time, end_time, content ) - values (#{name,jdbcType=VARCHAR}, #{planId,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR} + values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{planId,jdbcType=VARCHAR}, + #{startTime,jdbcType=BIGINT}, #{endTime,jdbcType=BIGINT}, #{content,jdbcType=LONGVARCHAR} ) - - SELECT LAST_INSERT_ID() - insert into test_case_report + + id, + name, plan_id, + + start_time, + + + end_time, + content, + + #{id,jdbcType=BIGINT}, + #{name,jdbcType=VARCHAR}, #{planId,jdbcType=VARCHAR}, + + #{startTime,jdbcType=BIGINT}, + + + #{endTime,jdbcType=BIGINT}, + #{content,jdbcType=LONGVARCHAR}, @@ -176,6 +192,12 @@ plan_id = #{record.planId,jdbcType=VARCHAR}, + + start_time = #{record.startTime,jdbcType=BIGINT}, + + + end_time = #{record.endTime,jdbcType=BIGINT}, + content = #{record.content,jdbcType=LONGVARCHAR}, @@ -189,6 +211,8 @@ set id = #{record.id,jdbcType=BIGINT}, name = #{record.name,jdbcType=VARCHAR}, plan_id = #{record.planId,jdbcType=VARCHAR}, + start_time = #{record.startTime,jdbcType=BIGINT}, + end_time = #{record.endTime,jdbcType=BIGINT}, content = #{record.content,jdbcType=LONGVARCHAR} @@ -198,7 +222,9 @@ update test_case_report set id = #{record.id,jdbcType=BIGINT}, name = #{record.name,jdbcType=VARCHAR}, - plan_id = #{record.planId,jdbcType=VARCHAR} + plan_id = #{record.planId,jdbcType=VARCHAR}, + start_time = #{record.startTime,jdbcType=BIGINT}, + end_time = #{record.endTime,jdbcType=BIGINT} @@ -212,6 +238,12 @@ plan_id = #{planId,jdbcType=VARCHAR}, + + start_time = #{startTime,jdbcType=BIGINT}, + + + end_time = #{endTime,jdbcType=BIGINT}, + content = #{content,jdbcType=LONGVARCHAR}, @@ -222,13 +254,17 @@ update test_case_report set name = #{name,jdbcType=VARCHAR}, plan_id = #{planId,jdbcType=VARCHAR}, + start_time = #{startTime,jdbcType=BIGINT}, + end_time = #{endTime,jdbcType=BIGINT}, content = #{content,jdbcType=LONGVARCHAR} where id = #{id,jdbcType=BIGINT} update test_case_report set name = #{name,jdbcType=VARCHAR}, - plan_id = #{planId,jdbcType=VARCHAR} + plan_id = #{planId,jdbcType=VARCHAR}, + start_time = #{startTime,jdbcType=BIGINT}, + end_time = #{endTime,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportTemplateMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportTemplateMapper.xml index 69175ac67b..3aa0188d1c 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportTemplateMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportTemplateMapper.xml @@ -5,6 +5,8 @@ + + @@ -68,7 +70,7 @@ - id, name, workspace_id + id, name, workspace_id, start_time, end_time content @@ -122,37 +124,51 @@ - - SELECT LAST_INSERT_ID() - - insert into test_case_report_template (name, workspace_id, content + insert into test_case_report_template (id, name, workspace_id, + start_time, end_time, content ) - values (#{name,jdbcType=VARCHAR}, #{workspaceId,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR} + values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{workspaceId,jdbcType=VARCHAR}, + #{startTime,jdbcType=BIGINT}, #{endTime,jdbcType=BIGINT}, #{content,jdbcType=LONGVARCHAR} ) - - SELECT LAST_INSERT_ID() - insert into test_case_report_template + + id, + name, workspace_id, + + start_time, + + + end_time, + content, + + #{id,jdbcType=BIGINT}, + #{name,jdbcType=VARCHAR}, #{workspaceId,jdbcType=VARCHAR}, + + #{startTime,jdbcType=BIGINT}, + + + #{endTime,jdbcType=BIGINT}, + #{content,jdbcType=LONGVARCHAR}, @@ -176,6 +192,12 @@ workspace_id = #{record.workspaceId,jdbcType=VARCHAR}, + + start_time = #{record.startTime,jdbcType=BIGINT}, + + + end_time = #{record.endTime,jdbcType=BIGINT}, + content = #{record.content,jdbcType=LONGVARCHAR}, @@ -189,6 +211,8 @@ set id = #{record.id,jdbcType=BIGINT}, name = #{record.name,jdbcType=VARCHAR}, workspace_id = #{record.workspaceId,jdbcType=VARCHAR}, + start_time = #{record.startTime,jdbcType=BIGINT}, + end_time = #{record.endTime,jdbcType=BIGINT}, content = #{record.content,jdbcType=LONGVARCHAR} @@ -198,7 +222,9 @@ update test_case_report_template set id = #{record.id,jdbcType=BIGINT}, name = #{record.name,jdbcType=VARCHAR}, - workspace_id = #{record.workspaceId,jdbcType=VARCHAR} + workspace_id = #{record.workspaceId,jdbcType=VARCHAR}, + start_time = #{record.startTime,jdbcType=BIGINT}, + end_time = #{record.endTime,jdbcType=BIGINT} @@ -212,6 +238,12 @@ workspace_id = #{workspaceId,jdbcType=VARCHAR}, + + start_time = #{startTime,jdbcType=BIGINT}, + + + end_time = #{endTime,jdbcType=BIGINT}, + content = #{content,jdbcType=LONGVARCHAR}, @@ -222,13 +254,17 @@ update test_case_report_template set name = #{name,jdbcType=VARCHAR}, workspace_id = #{workspaceId,jdbcType=VARCHAR}, + start_time = #{startTime,jdbcType=BIGINT}, + end_time = #{endTime,jdbcType=BIGINT}, content = #{content,jdbcType=LONGVARCHAR} where id = #{id,jdbcType=BIGINT} update test_case_report_template set name = #{name,jdbcType=VARCHAR}, - workspace_id = #{workspaceId,jdbcType=VARCHAR} + workspace_id = #{workspaceId,jdbcType=VARCHAR}, + start_time = #{startTime,jdbcType=BIGINT}, + end_time = #{endTime,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT} \ No newline at end of file diff --git a/backend/src/main/resources/generatorConfig.xml b/backend/src/main/resources/generatorConfig.xml index 80aa980bcf..2ac449c9be 100644 --- a/backend/src/main/resources/generatorConfig.xml +++ b/backend/src/main/resources/generatorConfig.xml @@ -10,7 +10,20 @@ - + + + + + + + + + + + + + + @@ -49,6 +62,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 4ddf036a0929e7304f01004623177b16d41df10a Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Wed, 6 May 2020 14:45:57 +0800 Subject: [PATCH 02/23] =?UTF-8?q?=E4=BD=BF=E7=94=A8lombok?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metersphere/report/base/ChartsData.java | 19 +--- .../io/metersphere/report/base/Errors.java | 38 +------ .../metersphere/report/base/ErrorsTop5.java | 106 +----------------- .../report/base/ReportTimeInfo.java | 26 +---- .../metersphere/report/base/Statistics.java | 106 +----------------- .../metersphere/report/base/SummaryData.java | 12 ++ .../metersphere/report/base/TestOverview.java | 50 +-------- 7 files changed, 32 insertions(+), 325 deletions(-) create mode 100644 backend/src/main/java/io/metersphere/report/base/SummaryData.java diff --git a/backend/src/main/java/io/metersphere/report/base/ChartsData.java b/backend/src/main/java/io/metersphere/report/base/ChartsData.java index 617c45343c..f6450973d5 100644 --- a/backend/src/main/java/io/metersphere/report/base/ChartsData.java +++ b/backend/src/main/java/io/metersphere/report/base/ChartsData.java @@ -1,7 +1,10 @@ package io.metersphere.report.base; +import lombok.Data; + import java.math.BigDecimal; +@Data public class ChartsData { /** @@ -52,20 +55,4 @@ public class ChartsData { public void setyAxis2(BigDecimal yAxis2) { this.yAxis2 = yAxis2; } - - public String getGroupName() { - return groupName; - } - - public void setGroupName(String groupName) { - this.groupName = groupName; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } } diff --git a/backend/src/main/java/io/metersphere/report/base/Errors.java b/backend/src/main/java/io/metersphere/report/base/Errors.java index 1476036a8c..41478c1b1e 100644 --- a/backend/src/main/java/io/metersphere/report/base/Errors.java +++ b/backend/src/main/java/io/metersphere/report/base/Errors.java @@ -1,41 +1,13 @@ package io.metersphere.report.base; +import lombok.Data; + +@Data public class Errors { private String errorType; private String errorNumber; - private String precentOfErrors; - private String precentOfAllSamples; + private String percentOfErrors; + private String percentOfAllSamples; - public String getErrorType() { - return errorType; - } - - public void setErrorType(String errorType) { - this.errorType = errorType; - } - - public String getErrorNumber() { - return errorNumber; - } - - public void setErrorNumber(String errorNumber) { - this.errorNumber = errorNumber; - } - - public String getPrecentOfErrors() { - return precentOfErrors; - } - - public void setPrecentOfErrors(String precentOfErrors) { - this.precentOfErrors = precentOfErrors; - } - - public String getPrecentOfAllSamples() { - return precentOfAllSamples; - } - - public void setPrecentOfAllSamples(String precentOfAllSamples) { - this.precentOfAllSamples = precentOfAllSamples; - } } diff --git a/backend/src/main/java/io/metersphere/report/base/ErrorsTop5.java b/backend/src/main/java/io/metersphere/report/base/ErrorsTop5.java index 9e3ac456c5..129529acd6 100644 --- a/backend/src/main/java/io/metersphere/report/base/ErrorsTop5.java +++ b/backend/src/main/java/io/metersphere/report/base/ErrorsTop5.java @@ -1,5 +1,8 @@ package io.metersphere.report.base; +import lombok.Data; + +@Data public class ErrorsTop5 { private String sample; @@ -16,107 +19,4 @@ public class ErrorsTop5 { private String error5; private String error5Size; - public String getSample() { - return sample; - } - - public void setSample(String sample) { - this.sample = sample; - } - - public String getSamples() { - return samples; - } - - public void setSamples(String samples) { - this.samples = samples; - } - - public String getErrorsAllSize() { - return errorsAllSize; - } - - public void setErrorsAllSize(String errorsAllSize) { - this.errorsAllSize = errorsAllSize; - } - - public String getError1() { - return error1; - } - - public void setError1(String error1) { - this.error1 = error1; - } - - public String getError1Size() { - return error1Size; - } - - public void setError1Size(String error1Size) { - this.error1Size = error1Size; - } - - public String getError2() { - return error2; - } - - public void setError2(String error2) { - this.error2 = error2; - } - - public String getError2Size() { - return error2Size; - } - - public void setError2Size(String error2Size) { - this.error2Size = error2Size; - } - - public String getError3() { - return error3; - } - - public void setError3(String error3) { - this.error3 = error3; - } - - public String getError3Size() { - return error3Size; - } - - public void setError3Size(String error3Size) { - this.error3Size = error3Size; - } - - public String getError4() { - return error4; - } - - public void setError4(String error4) { - this.error4 = error4; - } - - public String getError4Size() { - return error4Size; - } - - public void setError4Size(String error4Size) { - this.error4Size = error4Size; - } - - public String getError5() { - return error5; - } - - public void setError5(String error5) { - this.error5 = error5; - } - - public String getError5Size() { - return error5Size; - } - - public void setError5Size(String error5Size) { - this.error5Size = error5Size; - } } diff --git a/backend/src/main/java/io/metersphere/report/base/ReportTimeInfo.java b/backend/src/main/java/io/metersphere/report/base/ReportTimeInfo.java index ecb9e587af..72e71cb6a6 100644 --- a/backend/src/main/java/io/metersphere/report/base/ReportTimeInfo.java +++ b/backend/src/main/java/io/metersphere/report/base/ReportTimeInfo.java @@ -1,32 +1,12 @@ package io.metersphere.report.base; +import lombok.Data; + +@Data public class ReportTimeInfo { private String duration; private String startTime; private String endTime; - public String getDuration() { - return duration; - } - - public void setDuration(String duration) { - this.duration = duration; - } - - public String getStartTime() { - return startTime; - } - - public void setStartTime(String startTime) { - this.startTime = startTime; - } - - public String getEndTime() { - return endTime; - } - - public void setEndTime(String endTime) { - this.endTime = endTime; - } } diff --git a/backend/src/main/java/io/metersphere/report/base/Statistics.java b/backend/src/main/java/io/metersphere/report/base/Statistics.java index 821b45d270..336a9fea14 100644 --- a/backend/src/main/java/io/metersphere/report/base/Statistics.java +++ b/backend/src/main/java/io/metersphere/report/base/Statistics.java @@ -1,5 +1,8 @@ package io.metersphere.report.base; +import lombok.Data; + +@Data public class Statistics { private String label; @@ -28,107 +31,4 @@ public class Statistics { private String sent; - public String getLabel() { - return label; - } - - public void setLabel(String label) { - this.label = label; - } - - public String getSamples() { - return samples; - } - - public void setSamples(String samples) { - this.samples = samples; - } - - public String getKo() { - return ko; - } - - public void setKo(String ko) { - this.ko = ko; - } - - public String getError() { - return error; - } - - public void setError(String error) { - this.error = error; - } - - public String getAverage() { - return average; - } - - public void setAverage(String average) { - this.average = average; - } - - public String getMin() { - return min; - } - - public void setMin(String min) { - this.min = min; - } - - public String getMax() { - return max; - } - - public void setMax(String max) { - this.max = max; - } - - public String getTp90() { - return tp90; - } - - public void setTp90(String tp90) { - this.tp90 = tp90; - } - - public String getTp95() { - return tp95; - } - - public void setTp95(String tp95) { - this.tp95 = tp95; - } - - public String getTp99() { - return tp99; - } - - public void setTp99(String tp99) { - this.tp99 = tp99; - } - - public String getTransactions() { - return transactions; - } - - public void setTransactions(String transactions) { - this.transactions = transactions; - } - - public String getSent() { - return sent; - } - - public void setSent(String sent) { - this.sent = sent; - } - - public String getReceived() { - return received; - } - - public void setReceived(String received) { - this.received = received; - } } diff --git a/backend/src/main/java/io/metersphere/report/base/SummaryData.java b/backend/src/main/java/io/metersphere/report/base/SummaryData.java new file mode 100644 index 0000000000..309f7272ab --- /dev/null +++ b/backend/src/main/java/io/metersphere/report/base/SummaryData.java @@ -0,0 +1,12 @@ +package io.metersphere.report.base; + +import lombok.Data; + +import java.util.List; + +@Data +public class SummaryData { + + private List result; + +} diff --git a/backend/src/main/java/io/metersphere/report/base/TestOverview.java b/backend/src/main/java/io/metersphere/report/base/TestOverview.java index d478761674..304ba87443 100644 --- a/backend/src/main/java/io/metersphere/report/base/TestOverview.java +++ b/backend/src/main/java/io/metersphere/report/base/TestOverview.java @@ -1,5 +1,8 @@ package io.metersphere.report.base; +import lombok.Data; + +@Data public class TestOverview { private String maxUsers; @@ -9,51 +12,4 @@ public class TestOverview { private String responseTime90; private String avgBandwidth; - public String getMaxUsers() { - return maxUsers; - } - - public void setMaxUsers(String maxUsers) { - this.maxUsers = maxUsers; - } - - public String getAvgThroughput() { - return avgThroughput; - } - - public void setAvgThroughput(String avgThroughput) { - this.avgThroughput = avgThroughput; - } - - public String getErrors() { - return errors; - } - - public void setErrors(String errors) { - this.errors = errors; - } - - public String getAvgResponseTime() { - return avgResponseTime; - } - - public void setAvgResponseTime(String avgResponseTime) { - this.avgResponseTime = avgResponseTime; - } - - public String getResponseTime90() { - return responseTime90; - } - - public void setResponseTime90(String responseTime90) { - this.responseTime90 = responseTime90; - } - - public String getAvgBandwidth() { - return avgBandwidth; - } - - public void setAvgBandwidth(String avgBandwidth) { - this.avgBandwidth = avgBandwidth; - } } From 23d759ba599691795e94a66d3392a4b066a98a4b Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Wed, 6 May 2020 14:52:48 +0800 Subject: [PATCH 03/23] pid --- .../main/java/io/metersphere/service/TestCaseNodeService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/service/TestCaseNodeService.java b/backend/src/main/java/io/metersphere/service/TestCaseNodeService.java index d790c20012..fa00695728 100644 --- a/backend/src/main/java/io/metersphere/service/TestCaseNodeService.java +++ b/backend/src/main/java/io/metersphere/service/TestCaseNodeService.java @@ -92,7 +92,7 @@ public class TestCaseNodeService { List childrens = Optional.ofNullable(nodeTree.getChildren()).orElse(new ArrayList<>()); lowerNodes.forEach(node -> { - if (node.getpId().equals(rootNode.getId())){ + if (node.getPId().equals(rootNode.getId())){ childrens.add(buildNodeTree(nodeLevelMap, node)); nodeTree.setChildren(childrens); } @@ -327,7 +327,7 @@ public class TestCaseNodeService { private Integer insertTestCaseNode(String nodeName, Integer pId, String projectId, Integer level) { TestCaseNode testCaseNode = new TestCaseNode(); testCaseNode.setName(nodeName.trim()); - testCaseNode.setpId(pId); + testCaseNode.setPId(pId); testCaseNode.setProjectId(projectId); testCaseNode.setCreateTime(System.currentTimeMillis()); testCaseNode.setUpdateTime(System.currentTimeMillis()); From 6a0c8a5c3d18a1a7a70bc5132fa44f4a17e8d443 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Wed, 6 May 2020 15:01:05 +0800 Subject: [PATCH 04/23] =?UTF-8?q?=E6=80=A7=E8=83=BD=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E5=A4=B4=E9=83=A8=E9=9D=A2=E5=8C=85=E5=B1=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../performance/report/PerformanceReportView.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/src/business/components/performance/report/PerformanceReportView.vue b/frontend/src/business/components/performance/report/PerformanceReportView.vue index 6cc11bb93d..8fa8c9e23c 100644 --- a/frontend/src/business/components/performance/report/PerformanceReportView.vue +++ b/frontend/src/business/components/performance/report/PerformanceReportView.vue @@ -6,8 +6,10 @@ - {{projectName}} - {{testName}} + {{projectName}} + + {{testName}} + {{reportName}} @@ -74,7 +76,9 @@ reportId: '', status: '', reportName: '', + testId: '', testName: '', + projectId: '', projectName: '', startTime: '0', endTime: '0', @@ -90,7 +94,9 @@ let data = res.data; if (data) { this.reportName = data.name; + this.testId = data.testId; this.testName = data.testName; + this.projectId = data.projectId; this.projectName = data.projectName; } }) From cc53d07cd436f08ab3aa7848a8fbabf043b3b3fb Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Wed, 6 May 2020 15:08:53 +0800 Subject: [PATCH 05/23] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/report/base/SummaryData.java | 12 ------------ .../performance/report/components/ErrorLog.vue | 4 ++-- 2 files changed, 2 insertions(+), 14 deletions(-) delete mode 100644 backend/src/main/java/io/metersphere/report/base/SummaryData.java diff --git a/backend/src/main/java/io/metersphere/report/base/SummaryData.java b/backend/src/main/java/io/metersphere/report/base/SummaryData.java deleted file mode 100644 index 309f7272ab..0000000000 --- a/backend/src/main/java/io/metersphere/report/base/SummaryData.java +++ /dev/null @@ -1,12 +0,0 @@ -package io.metersphere.report.base; - -import lombok.Data; - -import java.util.List; - -@Data -public class SummaryData { - - private List result; - -} diff --git a/frontend/src/business/components/performance/report/components/ErrorLog.vue b/frontend/src/business/components/performance/report/components/ErrorLog.vue index 2691b0c3e9..b9e5239be3 100644 --- a/frontend/src/business/components/performance/report/components/ErrorLog.vue +++ b/frontend/src/business/components/performance/report/components/ErrorLog.vue @@ -19,12 +19,12 @@ sortable> From 0b07295948b08d785f93ea7db949ab53d8eb4261 Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Wed, 6 May 2020 15:44:16 +0800 Subject: [PATCH 06/23] =?UTF-8?q?=E8=B5=84=E6=BA=90=E6=B1=A0=E5=8A=A0?= =?UTF-8?q?=E5=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/ext/ExtTestReourcePoolMapper.java | 13 --- .../mapper/ext/ExtTestReourcePoolMapper.xml | 33 ------- .../utils/MybatisInterceptorConfig.java | 99 +++---------------- .../io/metersphere/config/MybatisConfig.java | 6 +- .../service/TestResourcePoolService.java | 29 +++++- 5 files changed, 44 insertions(+), 136 deletions(-) delete mode 100644 backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReourcePoolMapper.java delete mode 100644 backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReourcePoolMapper.xml diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReourcePoolMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReourcePoolMapper.java deleted file mode 100644 index 17877364f2..0000000000 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReourcePoolMapper.java +++ /dev/null @@ -1,13 +0,0 @@ -package io.metersphere.base.mapper.ext; - -import io.metersphere.controller.request.resourcepool.QueryResourcePoolRequest; -import io.metersphere.dto.TestResourcePoolDTO; -import org.apache.ibatis.annotations.Param; - -import java.util.List; - -public interface ExtTestReourcePoolMapper { - List listResourcePools(@Param("request") QueryResourcePoolRequest request); - -// List listResourcesByPoolId(@Param("poolId") String poolId); -} diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReourcePoolMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReourcePoolMapper.xml deleted file mode 100644 index f6b84f52bb..0000000000 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtTestReourcePoolMapper.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/commons/utils/MybatisInterceptorConfig.java b/backend/src/main/java/io/metersphere/commons/utils/MybatisInterceptorConfig.java index 27dc394501..47979d7586 100644 --- a/backend/src/main/java/io/metersphere/commons/utils/MybatisInterceptorConfig.java +++ b/backend/src/main/java/io/metersphere/commons/utils/MybatisInterceptorConfig.java @@ -1,5 +1,10 @@ package io.metersphere.commons.utils; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter public class MybatisInterceptorConfig { private String modelName; private String attrName; @@ -9,7 +14,6 @@ public class MybatisInterceptorConfig { private String undoClass; private String undoMethod; - public MybatisInterceptorConfig() { } @@ -17,100 +21,25 @@ public class MybatisInterceptorConfig { * 用时需谨慎!!!!! * 主要配置多个的时候,参数少一点 * - * @param modelName + * @param modelClass * @param attrName */ - public MybatisInterceptorConfig(String modelName, String attrName) { - this.modelName = modelName; + public MybatisInterceptorConfig(Class modelClass, String attrName) { + this.modelName = modelClass.getName(); this.attrName = attrName; - this.interceptorClass = "io.metersphere.commons.utils.EncryptUtils"; + this.interceptorClass = EncryptUtils.class.getName(); this.interceptorMethod = "aesEncrypt"; - this.undoClass = "io.metersphere.commons.utils.EncryptUtils"; + this.undoClass = EncryptUtils.class.getName(); this.undoMethod = "aesDecrypt"; } - public MybatisInterceptorConfig(String modelName, String attrName, String attrNameForList) { - this.modelName = modelName; + public MybatisInterceptorConfig(Class modelClass, String attrName, Class interceptorClass, String interceptorMethod, String undoMethod) { + this.modelName = modelClass.getName(); this.attrName = attrName; - this.attrNameForList = attrNameForList; - this.interceptorClass = "io.metersphere.commons.utils.EncryptUtils"; - this.interceptorMethod = "aesEncrypt"; - this.undoClass = "io.metersphere.commons.utils.EncryptUtils"; - this.undoMethod = "aesDecrypt"; - } - - public MybatisInterceptorConfig(String modelName, String attrName, String interceptorClass, String interceptorMethod, String undoMethod) { - this.modelName = modelName; - this.attrName = attrName; - this.interceptorClass = interceptorClass; + this.interceptorClass = interceptorClass.getName(); this.interceptorMethod = interceptorMethod; - this.undoClass = interceptorClass; + this.undoClass = interceptorClass.getName(); this.undoMethod = undoMethod; } - public MybatisInterceptorConfig(String modelName, String attrName, String attrNameForList, String interceptorClass, String interceptorMethod, String undoMethod) { - this.modelName = modelName; - this.attrName = attrName; - this.attrNameForList = attrNameForList; - this.interceptorClass = interceptorClass; - this.interceptorMethod = interceptorMethod; - this.undoClass = interceptorClass; - this.undoMethod = undoMethod; - } - - public String getModelName() { - return modelName; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } - - public String getAttrName() { - return attrName; - } - - public void setAttrName(String attrName) { - this.attrName = attrName; - } - - public String getAttrNameForList() { - return attrNameForList; - } - - public void setAttrNameForList(String attrNameForList) { - this.attrNameForList = attrNameForList; - } - - public String getInterceptorMethod() { - return interceptorMethod; - } - - public void setInterceptorMethod(String interceptorMethod) { - this.interceptorMethod = interceptorMethod; - } - - public String getUndoMethod() { - return undoMethod; - } - - public void setUndoMethod(String undoMethod) { - this.undoMethod = undoMethod; - } - - public String getInterceptorClass() { - return interceptorClass; - } - - public void setInterceptorClass(String interceptorClass) { - this.interceptorClass = interceptorClass; - } - - public String getUndoClass() { - return undoClass; - } - - public void setUndoClass(String undoClass) { - this.undoClass = undoClass; - } } diff --git a/backend/src/main/java/io/metersphere/config/MybatisConfig.java b/backend/src/main/java/io/metersphere/config/MybatisConfig.java index dc7e90967d..0d8b6eba21 100644 --- a/backend/src/main/java/io/metersphere/config/MybatisConfig.java +++ b/backend/src/main/java/io/metersphere/config/MybatisConfig.java @@ -1,6 +1,9 @@ package io.metersphere.config; import com.github.pagehelper.PageInterceptor; +import io.metersphere.base.domain.FileContent; +import io.metersphere.base.domain.TestResource; +import io.metersphere.commons.utils.CompressUtils; import io.metersphere.commons.utils.MybatisInterceptorConfig; import io.metersphere.interceptor.MybatisInterceptor; import org.mybatis.spring.annotation.MapperScan; @@ -37,7 +40,8 @@ public class MybatisConfig { public MybatisInterceptor dbInterceptor() { MybatisInterceptor interceptor = new MybatisInterceptor(); List configList = new ArrayList<>(); - configList.add(new MybatisInterceptorConfig("io.metersphere.base.domain.FileContent", "file", "io.metersphere.commons.utils.CompressUtils", "zip", "unzip")); + configList.add(new MybatisInterceptorConfig(FileContent.class, "file", CompressUtils.class, "zip", "unzip")); + configList.add(new MybatisInterceptorConfig(TestResource.class, "configuration")); interceptor.setInterceptorConfigList(configList); return interceptor; } diff --git a/backend/src/main/java/io/metersphere/service/TestResourcePoolService.java b/backend/src/main/java/io/metersphere/service/TestResourcePoolService.java index cd454e60e8..ce74519c38 100644 --- a/backend/src/main/java/io/metersphere/service/TestResourcePoolService.java +++ b/backend/src/main/java/io/metersphere/service/TestResourcePoolService.java @@ -7,15 +7,16 @@ import io.metersphere.base.domain.TestResourcePool; import io.metersphere.base.domain.TestResourcePoolExample; import io.metersphere.base.mapper.TestResourceMapper; import io.metersphere.base.mapper.TestResourcePoolMapper; -import io.metersphere.base.mapper.ext.ExtTestReourcePoolMapper; import io.metersphere.commons.constants.ResourcePoolTypeEnum; import io.metersphere.commons.constants.ResourceStatusEnum; import io.metersphere.commons.exception.MSException; +import io.metersphere.commons.utils.LogUtil; import io.metersphere.controller.request.resourcepool.QueryResourcePoolRequest; import io.metersphere.dto.NodeDTO; import io.metersphere.dto.TestResourcePoolDTO; import io.metersphere.engine.kubernetes.provider.KubernetesProvider; import io.metersphere.i18n.Translator; +import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.http.HttpStatus; @@ -25,6 +26,8 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.web.client.RestTemplate; import javax.annotation.Resource; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; import java.util.List; import java.util.UUID; import java.util.stream.Collectors; @@ -46,8 +49,6 @@ public class TestResourcePoolService { @Resource private TestResourceMapper testResourceMapper; @Resource - private ExtTestReourcePoolMapper extTestReourcePoolMapper; - @Resource private RestTemplate restTemplate; public TestResourcePoolDTO addTestResourcePool(TestResourcePoolDTO testResourcePool) { @@ -72,7 +73,27 @@ public class TestResourcePoolService { } public List listResourcePools(QueryResourcePoolRequest request) { - return extTestReourcePoolMapper.listResourcePools(request); + TestResourcePoolExample example = new TestResourcePoolExample(); + TestResourcePoolExample.Criteria criteria = example.createCriteria(); + if (StringUtils.isNotBlank(request.getName())) { + criteria.andNameLike(StringUtils.wrapIfMissing(request.getName(), "%")); + } + List testResourcePools = testResourcePoolMapper.selectByExample(example); + List testResourcePoolDTOS = new ArrayList<>(); + testResourcePools.forEach(pool -> { + TestResourceExample example2 = new TestResourceExample(); + example2.createCriteria().andTestResourcePoolIdEqualTo(pool.getId()); + List testResources = testResourceMapper.selectByExampleWithBLOBs(example2); + TestResourcePoolDTO testResourcePoolDTO = new TestResourcePoolDTO(); + try { + BeanUtils.copyProperties(testResourcePoolDTO, pool); + testResourcePoolDTO.setResources(testResources); + testResourcePoolDTOS.add(testResourcePoolDTO); + } catch (IllegalAccessException | InvocationTargetException e) { + LogUtil.error(e); + } + }); + return testResourcePoolDTOS; } private void validateTestResourcePool(TestResourcePoolDTO testResourcePool) { From 4dc949864b5c749bf8330f846fd0ddb24ab210b9 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Wed, 6 May 2020 16:03:39 +0800 Subject: [PATCH 07/23] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=8A=A5=E5=91=8A?= =?UTF-8?q?=E6=A8=A1=E7=89=88curd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/domain/TestCaseReport.java | 20 ++ .../base/domain/TestCaseReportExample.java | 120 +++++++ .../base/domain/TestCaseReportTemplate.java | 20 ++ .../domain/TestCaseReportTemplateExample.java | 120 +++++++ .../base/mapper/TestCaseReportMapper.xml | 48 ++- .../mapper/TestCaseReportTemplateMapper.xml | 48 ++- .../db/migration/V2__metersphere_ddl.sql | 4 + .../resources/db/migration/V3__init_data.sql | 2 +- .../src/main/resources/generatorConfig.xml | 14 +- .../workspace/TestCaseReportTemplate.vue | 9 +- .../TemplateComponent/BaseInfoComponent.vue | 56 +-- .../TemplateComponent/CommonComponent.vue | 16 +- .../TemplateComponent/RichTextComponent.vue | 47 +++ .../TemplateComponentEditHeader.vue | 82 +++++ .../components/TestCaseReportTemplateEdit.vue | 327 +++++++++++------- .../components/TestcaseTemplateItem.vue | 25 +- .../tableItems/planview/StatusTableItem.vue | 2 +- frontend/src/common/css/main.css | 7 + frontend/src/common/js/utils.js | 18 + 19 files changed, 805 insertions(+), 180 deletions(-) create mode 100644 frontend/src/business/components/settings/workspace/components/TemplateComponent/RichTextComponent.vue create mode 100644 frontend/src/business/components/settings/workspace/components/TemplateComponentEditHeader.vue diff --git a/backend/src/main/java/io/metersphere/base/domain/TestCaseReport.java b/backend/src/main/java/io/metersphere/base/domain/TestCaseReport.java index b70e93cbf2..af1f0705ca 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestCaseReport.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestCaseReport.java @@ -9,6 +9,10 @@ public class TestCaseReport implements Serializable { private String planId; + private Long startTime; + + private Long endTime; + private String content; private static final long serialVersionUID = 1L; @@ -37,6 +41,22 @@ public class TestCaseReport implements Serializable { this.planId = planId == null ? null : planId.trim(); } + public Long getStartTime() { + return startTime; + } + + public void setStartTime(Long startTime) { + this.startTime = startTime; + } + + public Long getEndTime() { + return endTime; + } + + public void setEndTime(Long endTime) { + this.endTime = endTime; + } + public String getContent() { return content; } diff --git a/backend/src/main/java/io/metersphere/base/domain/TestCaseReportExample.java b/backend/src/main/java/io/metersphere/base/domain/TestCaseReportExample.java index f43ff0744f..840e65ac12 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestCaseReportExample.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestCaseReportExample.java @@ -303,6 +303,126 @@ public class TestCaseReportExample { addCriterion("plan_id not between", value1, value2, "planId"); return (Criteria) this; } + + public Criteria andStartTimeIsNull() { + addCriterion("start_time is null"); + return (Criteria) this; + } + + public Criteria andStartTimeIsNotNull() { + addCriterion("start_time is not null"); + return (Criteria) this; + } + + public Criteria andStartTimeEqualTo(Long value) { + addCriterion("start_time =", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotEqualTo(Long value) { + addCriterion("start_time <>", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeGreaterThan(Long value) { + addCriterion("start_time >", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeGreaterThanOrEqualTo(Long value) { + addCriterion("start_time >=", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeLessThan(Long value) { + addCriterion("start_time <", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeLessThanOrEqualTo(Long value) { + addCriterion("start_time <=", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeIn(List values) { + addCriterion("start_time in", values, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotIn(List values) { + addCriterion("start_time not in", values, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeBetween(Long value1, Long value2) { + addCriterion("start_time between", value1, value2, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotBetween(Long value1, Long value2) { + addCriterion("start_time not between", value1, value2, "startTime"); + return (Criteria) this; + } + + public Criteria andEndTimeIsNull() { + addCriterion("end_time is null"); + return (Criteria) this; + } + + public Criteria andEndTimeIsNotNull() { + addCriterion("end_time is not null"); + return (Criteria) this; + } + + public Criteria andEndTimeEqualTo(Long value) { + addCriterion("end_time =", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotEqualTo(Long value) { + addCriterion("end_time <>", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeGreaterThan(Long value) { + addCriterion("end_time >", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeGreaterThanOrEqualTo(Long value) { + addCriterion("end_time >=", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeLessThan(Long value) { + addCriterion("end_time <", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeLessThanOrEqualTo(Long value) { + addCriterion("end_time <=", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeIn(List values) { + addCriterion("end_time in", values, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotIn(List values) { + addCriterion("end_time not in", values, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeBetween(Long value1, Long value2) { + addCriterion("end_time between", value1, value2, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotBetween(Long value1, Long value2) { + addCriterion("end_time not between", value1, value2, "endTime"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/backend/src/main/java/io/metersphere/base/domain/TestCaseReportTemplate.java b/backend/src/main/java/io/metersphere/base/domain/TestCaseReportTemplate.java index 05220801fd..9075abecf7 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestCaseReportTemplate.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestCaseReportTemplate.java @@ -9,6 +9,10 @@ public class TestCaseReportTemplate implements Serializable { private String workspaceId; + private Long startTime; + + private Long endTime; + private String content; private static final long serialVersionUID = 1L; @@ -37,6 +41,22 @@ public class TestCaseReportTemplate implements Serializable { this.workspaceId = workspaceId == null ? null : workspaceId.trim(); } + public Long getStartTime() { + return startTime; + } + + public void setStartTime(Long startTime) { + this.startTime = startTime; + } + + public Long getEndTime() { + return endTime; + } + + public void setEndTime(Long endTime) { + this.endTime = endTime; + } + public String getContent() { return content; } diff --git a/backend/src/main/java/io/metersphere/base/domain/TestCaseReportTemplateExample.java b/backend/src/main/java/io/metersphere/base/domain/TestCaseReportTemplateExample.java index a0c5b96a60..03b3616d6f 100644 --- a/backend/src/main/java/io/metersphere/base/domain/TestCaseReportTemplateExample.java +++ b/backend/src/main/java/io/metersphere/base/domain/TestCaseReportTemplateExample.java @@ -303,6 +303,126 @@ public class TestCaseReportTemplateExample { addCriterion("workspace_id not between", value1, value2, "workspaceId"); return (Criteria) this; } + + public Criteria andStartTimeIsNull() { + addCriterion("start_time is null"); + return (Criteria) this; + } + + public Criteria andStartTimeIsNotNull() { + addCriterion("start_time is not null"); + return (Criteria) this; + } + + public Criteria andStartTimeEqualTo(Long value) { + addCriterion("start_time =", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotEqualTo(Long value) { + addCriterion("start_time <>", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeGreaterThan(Long value) { + addCriterion("start_time >", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeGreaterThanOrEqualTo(Long value) { + addCriterion("start_time >=", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeLessThan(Long value) { + addCriterion("start_time <", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeLessThanOrEqualTo(Long value) { + addCriterion("start_time <=", value, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeIn(List values) { + addCriterion("start_time in", values, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotIn(List values) { + addCriterion("start_time not in", values, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeBetween(Long value1, Long value2) { + addCriterion("start_time between", value1, value2, "startTime"); + return (Criteria) this; + } + + public Criteria andStartTimeNotBetween(Long value1, Long value2) { + addCriterion("start_time not between", value1, value2, "startTime"); + return (Criteria) this; + } + + public Criteria andEndTimeIsNull() { + addCriterion("end_time is null"); + return (Criteria) this; + } + + public Criteria andEndTimeIsNotNull() { + addCriterion("end_time is not null"); + return (Criteria) this; + } + + public Criteria andEndTimeEqualTo(Long value) { + addCriterion("end_time =", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotEqualTo(Long value) { + addCriterion("end_time <>", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeGreaterThan(Long value) { + addCriterion("end_time >", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeGreaterThanOrEqualTo(Long value) { + addCriterion("end_time >=", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeLessThan(Long value) { + addCriterion("end_time <", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeLessThanOrEqualTo(Long value) { + addCriterion("end_time <=", value, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeIn(List values) { + addCriterion("end_time in", values, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotIn(List values) { + addCriterion("end_time not in", values, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeBetween(Long value1, Long value2) { + addCriterion("end_time between", value1, value2, "endTime"); + return (Criteria) this; + } + + public Criteria andEndTimeNotBetween(Long value1, Long value2) { + addCriterion("end_time not between", value1, value2, "endTime"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportMapper.xml index 83b9a98434..20e021dc4f 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportMapper.xml @@ -5,6 +5,8 @@ + + @@ -68,7 +70,7 @@ - id, name, plan_id + id, name, plan_id, start_time, end_time content @@ -125,10 +127,10 @@ SELECT LAST_INSERT_ID() - insert into test_case_report (name, plan_id, content - ) - values (#{name,jdbcType=VARCHAR}, #{planId,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR} - ) + insert into test_case_report (name, plan_id, start_time, + end_time, content) + values (#{name,jdbcType=VARCHAR}, #{planId,jdbcType=VARCHAR}, #{startTime,jdbcType=BIGINT}, + #{endTime,jdbcType=BIGINT}, #{content,jdbcType=LONGVARCHAR}) @@ -142,6 +144,12 @@ plan_id, + + start_time, + + + end_time, + content, @@ -153,6 +161,12 @@ #{planId,jdbcType=VARCHAR}, + + #{startTime,jdbcType=BIGINT}, + + + #{endTime,jdbcType=BIGINT}, + #{content,jdbcType=LONGVARCHAR}, @@ -176,6 +190,12 @@ plan_id = #{record.planId,jdbcType=VARCHAR}, + + start_time = #{record.startTime,jdbcType=BIGINT}, + + + end_time = #{record.endTime,jdbcType=BIGINT}, + content = #{record.content,jdbcType=LONGVARCHAR}, @@ -189,6 +209,8 @@ set id = #{record.id,jdbcType=BIGINT}, name = #{record.name,jdbcType=VARCHAR}, plan_id = #{record.planId,jdbcType=VARCHAR}, + start_time = #{record.startTime,jdbcType=BIGINT}, + end_time = #{record.endTime,jdbcType=BIGINT}, content = #{record.content,jdbcType=LONGVARCHAR} @@ -198,7 +220,9 @@ update test_case_report set id = #{record.id,jdbcType=BIGINT}, name = #{record.name,jdbcType=VARCHAR}, - plan_id = #{record.planId,jdbcType=VARCHAR} + plan_id = #{record.planId,jdbcType=VARCHAR}, + start_time = #{record.startTime,jdbcType=BIGINT}, + end_time = #{record.endTime,jdbcType=BIGINT} @@ -212,6 +236,12 @@ plan_id = #{planId,jdbcType=VARCHAR}, + + start_time = #{startTime,jdbcType=BIGINT}, + + + end_time = #{endTime,jdbcType=BIGINT}, + content = #{content,jdbcType=LONGVARCHAR}, @@ -222,13 +252,17 @@ update test_case_report set name = #{name,jdbcType=VARCHAR}, plan_id = #{planId,jdbcType=VARCHAR}, + start_time = #{startTime,jdbcType=BIGINT}, + end_time = #{endTime,jdbcType=BIGINT}, content = #{content,jdbcType=LONGVARCHAR} where id = #{id,jdbcType=BIGINT} update test_case_report set name = #{name,jdbcType=VARCHAR}, - plan_id = #{planId,jdbcType=VARCHAR} + plan_id = #{planId,jdbcType=VARCHAR}, + start_time = #{startTime,jdbcType=BIGINT}, + end_time = #{endTime,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportTemplateMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportTemplateMapper.xml index 69175ac67b..13914112de 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportTemplateMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/TestCaseReportTemplateMapper.xml @@ -5,6 +5,8 @@ + + @@ -68,7 +70,7 @@ - id, name, workspace_id + id, name, workspace_id, start_time, end_time content @@ -125,10 +127,10 @@ SELECT LAST_INSERT_ID() - insert into test_case_report_template (name, workspace_id, content - ) - values (#{name,jdbcType=VARCHAR}, #{workspaceId,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARCHAR} - ) + insert into test_case_report_template (name, workspace_id, start_time, + end_time, content) + values (#{name,jdbcType=VARCHAR}, #{workspaceId,jdbcType=VARCHAR}, #{startTime,jdbcType=BIGINT}, + #{endTime,jdbcType=BIGINT}, #{content,jdbcType=LONGVARCHAR}) @@ -142,6 +144,12 @@ workspace_id, + + start_time, + + + end_time, + content, @@ -153,6 +161,12 @@ #{workspaceId,jdbcType=VARCHAR}, + + #{startTime,jdbcType=BIGINT}, + + + #{endTime,jdbcType=BIGINT}, + #{content,jdbcType=LONGVARCHAR}, @@ -176,6 +190,12 @@ workspace_id = #{record.workspaceId,jdbcType=VARCHAR}, + + start_time = #{record.startTime,jdbcType=BIGINT}, + + + end_time = #{record.endTime,jdbcType=BIGINT}, + content = #{record.content,jdbcType=LONGVARCHAR}, @@ -189,6 +209,8 @@ set id = #{record.id,jdbcType=BIGINT}, name = #{record.name,jdbcType=VARCHAR}, workspace_id = #{record.workspaceId,jdbcType=VARCHAR}, + start_time = #{record.startTime,jdbcType=BIGINT}, + end_time = #{record.endTime,jdbcType=BIGINT}, content = #{record.content,jdbcType=LONGVARCHAR} @@ -198,7 +220,9 @@ update test_case_report_template set id = #{record.id,jdbcType=BIGINT}, name = #{record.name,jdbcType=VARCHAR}, - workspace_id = #{record.workspaceId,jdbcType=VARCHAR} + workspace_id = #{record.workspaceId,jdbcType=VARCHAR}, + start_time = #{record.startTime,jdbcType=BIGINT}, + end_time = #{record.endTime,jdbcType=BIGINT} @@ -212,6 +236,12 @@ workspace_id = #{workspaceId,jdbcType=VARCHAR}, + + start_time = #{startTime,jdbcType=BIGINT}, + + + end_time = #{endTime,jdbcType=BIGINT}, + content = #{content,jdbcType=LONGVARCHAR}, @@ -222,13 +252,17 @@ update test_case_report_template set name = #{name,jdbcType=VARCHAR}, workspace_id = #{workspaceId,jdbcType=VARCHAR}, + start_time = #{startTime,jdbcType=BIGINT}, + end_time = #{endTime,jdbcType=BIGINT}, content = #{content,jdbcType=LONGVARCHAR} where id = #{id,jdbcType=BIGINT} update test_case_report_template set name = #{name,jdbcType=VARCHAR}, - workspace_id = #{workspaceId,jdbcType=VARCHAR} + workspace_id = #{workspaceId,jdbcType=VARCHAR}, + start_time = #{startTime,jdbcType=BIGINT}, + end_time = #{endTime,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT} \ No newline at end of file diff --git a/backend/src/main/resources/db/migration/V2__metersphere_ddl.sql b/backend/src/main/resources/db/migration/V2__metersphere_ddl.sql index c67f00b42c..c947098fd3 100644 --- a/backend/src/main/resources/db/migration/V2__metersphere_ddl.sql +++ b/backend/src/main/resources/db/migration/V2__metersphere_ddl.sql @@ -335,6 +335,8 @@ CREATE TABLE IF NOT EXISTS `test_case_report_template` ( `name` varchar(64) NOT NULL COMMENT 'Test case report template name', `workspace_id` varchar(50) DEFAULT NULL COMMENT 'Workspace ID this project belongs to', `content` longtext COMMENT 'Template content (JSON format)', + `start_time` bigint(13) COMMENT 'Test start time', + `end_time` bigint(13) COMMENT 'Test end time', PRIMARY KEY (`id`) ) ENGINE=InnoDB @@ -346,6 +348,8 @@ CREATE TABLE IF NOT EXISTS `test_case_report` ( `name` varchar(64) NOT NULL COMMENT 'Test case report name', `plan_id` varchar(50) NOT NULL COMMENT 'Plan ID relation to', `content` longtext COMMENT 'Report content (JSON format)', + `start_time` bigint(13) COMMENT 'Test start time', + `end_time` bigint(13) COMMENT 'Test end time', PRIMARY KEY (`id`) ) ENGINE=InnoDB diff --git a/backend/src/main/resources/db/migration/V3__init_data.sql b/backend/src/main/resources/db/migration/V3__init_data.sql index a66cc043ec..daf2460bc5 100644 --- a/backend/src/main/resources/db/migration/V3__init_data.sql +++ b/backend/src/main/resources/db/migration/V3__init_data.sql @@ -10,4 +10,4 @@ INSERT INTO role (id, name, description, type, create_time, update_time) VALUES INSERT INTO role (id, name, description, type, create_time, update_time) VALUES ('test_user', '测试人员', null, null, 1581576575948, 1581576575948); INSERT INTO role (id, name, description, type, create_time, update_time) VALUES ('test_viewer', 'Viewer', null, null, 1581576575948, 1581576575948); -INSERT INTO test_case_report_template (name,content) VALUES ("默认模版","{\"components\":[1,2,3,4,5],\"contentMap\":{\"richTextComponentTitleSet\":{},\"richTextComponentContentSet\":{}}}"); +INSERT INTO test_case_report_template (name,content) VALUES ("默认模版","{\"components\": [1,2,3,4,5]}"); diff --git a/backend/src/main/resources/generatorConfig.xml b/backend/src/main/resources/generatorConfig.xml index 74208c1aae..ebfccc8be0 100644 --- a/backend/src/main/resources/generatorConfig.xml +++ b/backend/src/main/resources/generatorConfig.xml @@ -46,14 +46,22 @@ -
-
-
+ + + +
+ +
+ + + +
+
\ No newline at end of file diff --git a/frontend/src/business/components/settings/workspace/TestCaseReportTemplate.vue b/frontend/src/business/components/settings/workspace/TestCaseReportTemplate.vue index 2ba4b56aab..d8d1b63aa5 100644 --- a/frontend/src/business/components/settings/workspace/TestCaseReportTemplate.vue +++ b/frontend/src/business/components/settings/workspace/TestCaseReportTemplate.vue @@ -12,10 +12,10 @@ + :template="item" @templateEdit="templateEdit" @refresh="initData"/> - + @@ -60,8 +60,8 @@ templateCreate() { }, - templateEdit(template) { - this.$refs.templateEdit.open(template); + templateEdit(id) { + this.$refs.templateEdit.open(id); } } } @@ -70,5 +70,4 @@ diff --git a/frontend/src/business/components/settings/workspace/components/TemplateComponent/BaseInfoComponent.vue b/frontend/src/business/components/settings/workspace/components/TemplateComponent/BaseInfoComponent.vue index 819330b168..6a298c0e55 100644 --- a/frontend/src/business/components/settings/workspace/components/TemplateComponent/BaseInfoComponent.vue +++ b/frontend/src/business/components/settings/workspace/components/TemplateComponent/BaseInfoComponent.vue @@ -3,34 +3,38 @@ - - - 所属项目: - {{reportInfo.project}} - - - 测试负责人: - {{reportInfo.principal}} - - + diff --git a/frontend/src/business/components/settings/workspace/components/TemplateComponent/CommonComponent.vue b/frontend/src/business/components/settings/workspace/components/TemplateComponent/CommonComponent.vue index 6bd02f0789..5a4fefa99b 100644 --- a/frontend/src/business/components/settings/workspace/components/TemplateComponent/CommonComponent.vue +++ b/frontend/src/business/components/settings/workspace/components/TemplateComponent/CommonComponent.vue @@ -1,17 +1,18 @@