From 33ff754cc487ecd4679a271f51d522bea44e36e2 Mon Sep 17 00:00:00 2001 From: wenyann Date: Thu, 1 Jul 2021 13:50:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:jenkins=E8=B0=83=E7=94=A8=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=8A=A5=E5=91=8A=E4=B8=8D=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/controller/WorkspaceController.java | 5 +++++ .../io/metersphere/track/controller/TestPlanController.java | 5 +++-- .../io/metersphere/track/service/TestPlanReportService.java | 6 ++++++ .../java/io/metersphere/track/service/TestPlanService.java | 3 ++- frontend/src/business/components/common/model/JsonData.js | 2 +- .../track/plan/view/comonents/api/TestPlanApiCaseList.vue | 2 +- 6 files changed, 18 insertions(+), 5 deletions(-) diff --git a/backend/src/main/java/io/metersphere/controller/WorkspaceController.java b/backend/src/main/java/io/metersphere/controller/WorkspaceController.java index 86ff818f03..095126a15c 100644 --- a/backend/src/main/java/io/metersphere/controller/WorkspaceController.java +++ b/backend/src/main/java/io/metersphere/controller/WorkspaceController.java @@ -103,6 +103,11 @@ public class WorkspaceController { return workspaceService.getWorkspaceIdsByOrgId(orgId); } + @GetMapping("/list/orgworkspace/{userId}/{orgId}") + public List getWorkspaceListByOrgId(@PathVariable String userId, @PathVariable String orgId) { + return workspaceService.getWorkspaceIdsByOrgId(orgId); + } + @PostMapping("/member/update") @MsAuditLog(module = "workspace_member", type = OperLogConstants.UPDATE, beforeEvent = "#msClass.getLogDetails(#memberDTO)", content = "#msClass.getLogDetails(#memberDTO)", msClass = WorkspaceService.class) public void updateOrgMember(@RequestBody WorkspaceMemberDTO memberDTO) { diff --git a/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java b/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java index f9bd32b13b..49165e9b55 100644 --- a/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java +++ b/backend/src/main/java/io/metersphere/track/controller/TestPlanController.java @@ -152,14 +152,15 @@ public class TestPlanController { Page page = PageHelper.startPage(goPage, pageSize, true); return PageUtils.setPageInfo(page, testPlanProjectService.getProjectByPlanId(request)); } + @PostMapping("/testplan/jenkins") - public void runJenkins(@RequestBody TestplanRunRequest testplanRunRequest) { + public String runJenkins(@RequestBody TestplanRunRequest testplanRunRequest) { ApiRunConfigDTO api = new ApiRunConfigDTO(); api.setMode(testplanRunRequest.getMode()); api.setResourcePoolId(testplanRunRequest.getResourcePoolId()); api.setOnSampleError(true); api.setReportType("iddReport"); String apiRunConfig = JSONObject.toJSONString(api); - testPlanService.run(testplanRunRequest.getTestPlanId(), testplanRunRequest.getProjectId(), testplanRunRequest.getUserId(), testplanRunRequest.getTriggerMode(), apiRunConfig); + return testPlanService.run(testplanRunRequest.getTestPlanId(), testplanRunRequest.getProjectId(), testplanRunRequest.getUserId(), testplanRunRequest.getTriggerMode(), apiRunConfig); } } diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java index a6b6dd79f7..7087a0e0ca 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanReportService.java @@ -500,6 +500,12 @@ public class TestPlanReportService { noticeSendService.send(testPlanReport.getTriggerMode(), noticeModel); } + public List getTestPlanReportApi(String planId) { + TestPlanReportExample example = new TestPlanReportExample(); + example.createCriteria().andTestPlanIdEqualTo(planId); + return testPlanReportMapper.selectByExample(example); + } + public TestPlanReport getTestPlanReport(String planId) { return testPlanReportMapper.selectByPrimaryKey(planId); } diff --git a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java index bf199859fa..e8de42f31d 100644 --- a/backend/src/main/java/io/metersphere/track/service/TestPlanService.java +++ b/backend/src/main/java/io/metersphere/track/service/TestPlanService.java @@ -1000,7 +1000,7 @@ public class TestPlanService { return returnId; } - public void run(String testPlanID, String projectID, String userId, String triggerMode, String apiRunConfig) { + public String run(String testPlanID, String projectID, String userId, String triggerMode, String apiRunConfig) { Map planScenarioIdMap; Map apiTestCaseIdMap; Map performanceIdMap; @@ -1160,6 +1160,7 @@ public class TestPlanService { testPlanReport.setIsPerformanceExecuting(performaceIsExcuting); testPlanReportService.update(testPlanReport); } + return testPlanReport.getId(); } public String getLogDetails(String id) { diff --git a/frontend/src/business/components/common/model/JsonData.js b/frontend/src/business/components/common/model/JsonData.js index 2a4086abca..299a5bfa19 100644 --- a/frontend/src/business/components/common/model/JsonData.js +++ b/frontend/src/business/components/common/model/JsonData.js @@ -87,7 +87,7 @@ export const Test_Plan_Function_Test_Case = [ //测试计划-api用例 export const Test_Plan_Api_Case = [ {id: 'num', label: i18n.t('commons.id')}, - {id: 'name', label: i18n.t('api_test.definition.api_name')}, + {id: 'name', label: i18n.t('test_track.case.name')}, {id: 'priority', label: i18n.t('test_track.case.priority')}, {id: 'path', label: i18n.t('api_test.definition.api_path')}, {id: 'createUser', label: '创建人'}, diff --git a/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiCaseList.vue b/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiCaseList.vue index 8f35ee3879..57706be7be 100644 --- a/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiCaseList.vue +++ b/frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiCaseList.vue @@ -37,7 +37,7 @@ show-overflow-tooltip :key="index"/> + :label="$t('test_track.case.name')" show-overflow-tooltip :key="index"/>