From ae11f66b7992df4b682f7f176cb20dc184e2cc67 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Mon, 30 Nov 2020 14:29:49 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E6=8E=A5=E5=8F=A3=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96):=20=E5=9F=BA=E7=A1=80=E7=BB=93=E6=9E=84=E5=88=9B?= =?UTF-8?q?=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ApiAutomationController.java | 21 ++++++++++++ .../api/service/ApiAutomationService.java | 15 ++++++++ .../service/ApiDefinitionHistoryService.java | 20 +++++++++++ .../metersphere/base/domain/ApiScenario.java | 28 +++++++++++++++ .../base/domain/ApiScenarioModule.java | 25 ++++++++++++++ .../base/domain/ApiScenarioReport.java | 34 +++++++++++++++++++ .../base/domain/ApiScenarioReportDetail.java | 16 +++++++++ .../io/metersphere/base/domain/ApiTag.java | 22 ++++++++++++ .../base/mapper/ApiAutomationMapper.java | 5 +++ .../base/mapper/ApiAutomationMapper.xml | 5 +++ .../api/automation/ApiAutomation.vue | 21 ++++++++++++ .../api/automation/report/ApiReport.vue | 21 ++++++++++++ .../automation/scenario/EditApiScenario.vue | 21 ++++++++++++ .../components/api/head/ApiHeaderMenus.vue | 8 +++-- .../src/business/components/api/router.js | 5 +++ frontend/src/i18n/en-US.js | 3 +- frontend/src/i18n/zh-CN.js | 1 + frontend/src/i18n/zh-TW.js | 1 + 18 files changed, 269 insertions(+), 3 deletions(-) create mode 100644 backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java create mode 100644 backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java create mode 100644 backend/src/main/java/io/metersphere/api/service/ApiDefinitionHistoryService.java create mode 100644 backend/src/main/java/io/metersphere/base/domain/ApiScenario.java create mode 100644 backend/src/main/java/io/metersphere/base/domain/ApiScenarioModule.java create mode 100644 backend/src/main/java/io/metersphere/base/domain/ApiScenarioReport.java create mode 100644 backend/src/main/java/io/metersphere/base/domain/ApiScenarioReportDetail.java create mode 100644 backend/src/main/java/io/metersphere/base/domain/ApiTag.java create mode 100644 backend/src/main/java/io/metersphere/base/mapper/ApiAutomationMapper.java create mode 100644 backend/src/main/java/io/metersphere/base/mapper/ApiAutomationMapper.xml create mode 100644 frontend/src/business/components/api/automation/ApiAutomation.vue create mode 100644 frontend/src/business/components/api/automation/report/ApiReport.vue create mode 100644 frontend/src/business/components/api/automation/scenario/EditApiScenario.vue diff --git a/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java b/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java new file mode 100644 index 0000000000..75d38cb2b6 --- /dev/null +++ b/backend/src/main/java/io/metersphere/api/controller/ApiAutomationController.java @@ -0,0 +1,21 @@ +package io.metersphere.api.controller; + +import io.metersphere.api.service.ApiAutomationService; +import io.metersphere.commons.constants.RoleConstants; +import org.apache.shiro.authz.annotation.Logical; +import org.apache.shiro.authz.annotation.RequiresRoles; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; + +@RestController +@RequestMapping(value = "/api/automation") +@RequiresRoles(value = {RoleConstants.TEST_MANAGER, RoleConstants.TEST_USER}, logical = Logical.OR) +public class ApiAutomationController { + + @Resource + ApiAutomationService apiAutomationService; + +} + diff --git a/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java new file mode 100644 index 0000000000..e9655acdc0 --- /dev/null +++ b/backend/src/main/java/io/metersphere/api/service/ApiAutomationService.java @@ -0,0 +1,15 @@ +package io.metersphere.api.service; + +import io.metersphere.base.mapper.ApiDefinitionHistoryMapper; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; + +@Service +@Transactional(rollbackFor = Exception.class) +public class ApiAutomationService { + @Resource + private ApiDefinitionHistoryMapper apiDefinitionHistoryMapper; + +} diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionHistoryService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionHistoryService.java new file mode 100644 index 0000000000..75d93f7bce --- /dev/null +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionHistoryService.java @@ -0,0 +1,20 @@ +package io.metersphere.api.service; + +import io.metersphere.base.domain.ApiDefinitionHistory; +import io.metersphere.base.mapper.ApiDefinitionHistoryMapper; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.List; + +@Service +@Transactional(rollbackFor = Exception.class) +public class ApiDefinitionHistoryService { + @Resource + private ApiDefinitionHistoryMapper apiDefinitionHistoryMapper; + + public List selectByApiDefinitionId(String id){ + return apiDefinitionHistoryMapper.selectByApiDefinitionId(id); + } +} diff --git a/backend/src/main/java/io/metersphere/base/domain/ApiScenario.java b/backend/src/main/java/io/metersphere/base/domain/ApiScenario.java new file mode 100644 index 0000000000..a6cf1a7b5a --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/domain/ApiScenario.java @@ -0,0 +1,28 @@ +package io.metersphere.base.domain; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class ApiScenario implements Serializable { + private String id; + + private String apiScenarioId; + + private String name; + + private String description; + + private Long createTime; + + private Long updateTime; + + private String status; + + private String userId; + + private String triggerMode; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/ApiScenarioModule.java b/backend/src/main/java/io/metersphere/base/domain/ApiScenarioModule.java new file mode 100644 index 0000000000..9981a8982e --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/domain/ApiScenarioModule.java @@ -0,0 +1,25 @@ +package io.metersphere.base.domain; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class ApiScenarioModule implements Serializable { + private String id; + + private String projectId; + + private String name; + + private String userId; + + private String parentId; + + private String level; + + private Long createTime; + + private Long updateTime; + +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/ApiScenarioReport.java b/backend/src/main/java/io/metersphere/base/domain/ApiScenarioReport.java new file mode 100644 index 0000000000..6e73be36a5 --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/domain/ApiScenarioReport.java @@ -0,0 +1,34 @@ +package io.metersphere.base.domain; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class ApiScenarioReport implements Serializable { + private String id; + + private String projectId; + + private String name; + + private String scenarioId; + + private String level; + + private String status; + + private String principal; + + private String followPeople; + + private String description; + + private String scenarioDefinition; + + private String userId; + + private Long createTime; + + private Long updateTime; +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/ApiScenarioReportDetail.java b/backend/src/main/java/io/metersphere/base/domain/ApiScenarioReportDetail.java new file mode 100644 index 0000000000..4a9b326731 --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/domain/ApiScenarioReportDetail.java @@ -0,0 +1,16 @@ +package io.metersphere.base.domain; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class ApiScenarioReportDetail implements Serializable { + private String reportId; + + private String apiScenarioId; + + private byte[] content; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/domain/ApiTag.java b/backend/src/main/java/io/metersphere/base/domain/ApiTag.java new file mode 100644 index 0000000000..18bee19de7 --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/domain/ApiTag.java @@ -0,0 +1,22 @@ +package io.metersphere.base.domain; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class ApiTag implements Serializable { + private String id; + + private String projectId; + + private String name; + + private String userId; + + private Long createTime; + + private Long updateTime; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ApiAutomationMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ApiAutomationMapper.java new file mode 100644 index 0000000000..604b9c2419 --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/ApiAutomationMapper.java @@ -0,0 +1,5 @@ +package io.metersphere.base.mapper; + +public interface ApiAutomationMapper { + +} \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ApiAutomationMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ApiAutomationMapper.xml new file mode 100644 index 0000000000..db74bb4db1 --- /dev/null +++ b/backend/src/main/java/io/metersphere/base/mapper/ApiAutomationMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/business/components/api/automation/ApiAutomation.vue b/frontend/src/business/components/api/automation/ApiAutomation.vue new file mode 100644 index 0000000000..e1b1867e21 --- /dev/null +++ b/frontend/src/business/components/api/automation/ApiAutomation.vue @@ -0,0 +1,21 @@ + + + + + diff --git a/frontend/src/business/components/api/automation/report/ApiReport.vue b/frontend/src/business/components/api/automation/report/ApiReport.vue new file mode 100644 index 0000000000..222b287be3 --- /dev/null +++ b/frontend/src/business/components/api/automation/report/ApiReport.vue @@ -0,0 +1,21 @@ + + + + + diff --git a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue new file mode 100644 index 0000000000..238149d399 --- /dev/null +++ b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue @@ -0,0 +1,21 @@ + + + + + diff --git a/frontend/src/business/components/api/head/ApiHeaderMenus.vue b/frontend/src/business/components/api/head/ApiHeaderMenus.vue index cd1817adef..532283844c 100644 --- a/frontend/src/business/components/api/head/ApiHeaderMenus.vue +++ b/frontend/src/business/components/api/head/ApiHeaderMenus.vue @@ -1,7 +1,7 @@