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 @@