From 96bafa3d770db83a8e402b0ffa3b9026f0f15527 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Tue, 4 Apr 2023 11:45:37 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=A8=E4=BE=8B=E6=89=A7=E8=A1=8C=E5=90=8E?= =?UTF-8?q?=E9=80=9A=E8=BF=87=E7=8E=87=E6=B2=A1=E6=9C=89=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1025098 --user=王孝刚 【接口测试】github#23386,接口用力执行完成,通过率数据不会自动更新,需要刷新页面才能更新 https://www.tapd.cn/55049933/s/1359097 --- .../base/mapper/ext/ExtApiTestCaseMapper.java | 2 ++ .../base/mapper/ext/ExtApiTestCaseMapper.xml | 10 ++++++++++ .../definition/ApiTestCaseController.java | 5 +++++ .../service/definition/ApiTestCaseService.java | 5 +++++ api-test/frontend/src/api/api-test-case.js | 4 ++++ .../definition/components/case/EditApiCase.vue | 16 ++++++++++------ .../components/list/ApiCaseSimpleList.vue | 5 +++-- 7 files changed, 39 insertions(+), 8 deletions(-) diff --git a/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.java b/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.java index 8d90b9d048..52399a013a 100644 --- a/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.java +++ b/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.java @@ -110,4 +110,6 @@ public interface ExtApiTestCaseMapper { List selectSourceIdByProjectIdIsNull(); long countSourceIdByProjectIdIsNull(); + + String findPassRateById(String id); } diff --git a/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml b/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml index 1d095122ed..277f5ad147 100644 --- a/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml +++ b/api-test/backend/src/main/java/io/metersphere/base/mapper/ext/ExtApiTestCaseMapper.xml @@ -1309,4 +1309,14 @@ FROM api_case_execution_info WHERE project_id IS NULL + + diff --git a/api-test/backend/src/main/java/io/metersphere/controller/definition/ApiTestCaseController.java b/api-test/backend/src/main/java/io/metersphere/controller/definition/ApiTestCaseController.java index 55699e83fd..440a7d9ac5 100644 --- a/api-test/backend/src/main/java/io/metersphere/controller/definition/ApiTestCaseController.java +++ b/api-test/backend/src/main/java/io/metersphere/controller/definition/ApiTestCaseController.java @@ -82,6 +82,11 @@ public class ApiTestCaseController { return apiTestCaseService.listSimple(request); } + @GetMapping("/get/pass-rate/{id}") + public String getPassRate(@PathVariable String id) { + return apiTestCaseService.getPassRate(id); + } + @PostMapping("/get/request") public Map listSimple(@RequestBody ApiTestCaseRequest request) { return apiTestCaseService.getRequest(request); diff --git a/api-test/backend/src/main/java/io/metersphere/service/definition/ApiTestCaseService.java b/api-test/backend/src/main/java/io/metersphere/service/definition/ApiTestCaseService.java index 239dd38368..76170fe793 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/definition/ApiTestCaseService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/definition/ApiTestCaseService.java @@ -1281,4 +1281,9 @@ public class ApiTestCaseService { public void updateByPrimaryKeySelective(ApiTestCaseWithBLOBs apiTestCase) { apiTestCaseMapper.updateByPrimaryKeySelective(apiTestCase); } + + public String getPassRate(String id) { + return extApiTestCaseMapper.findPassRateById(id); + + } } diff --git a/api-test/frontend/src/api/api-test-case.js b/api-test/frontend/src/api/api-test-case.js index fd3c320dba..d15bbe874e 100644 --- a/api-test/frontend/src/api/api-test-case.js +++ b/api-test/frontend/src/api/api-test-case.js @@ -89,3 +89,7 @@ export function apiTestCaseCount(param) { export function getApiCaseEnvironments(param) { return post('/api/testcase/get/env', param); } + +export function getPassRateById(id) { + return get('/api/testcase/get/pass-rate/' + id); +} diff --git a/api-test/frontend/src/business/definition/components/case/EditApiCase.vue b/api-test/frontend/src/business/definition/components/case/EditApiCase.vue index df50e22bd6..8c49b14db2 100644 --- a/api-test/frontend/src/business/definition/components/case/EditApiCase.vue +++ b/api-test/frontend/src/business/definition/components/case/EditApiCase.vue @@ -60,7 +60,7 @@