From 4333fdc8c986b648c0deb6707c7e2ebf309a4a6b Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Tue, 19 Mar 2024 14:07:33 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E7=B3=BB=E7=BB=9F=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9api=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1037319 --user=王孝刚 【api文档】api文档-“登录”写错了 https://www.tapd.cn/55049933/s/1477481 --- .../api/service/definition/ApiReportService.java | 8 +++++--- .../api/service/scenario/ApiScenarioReportService.java | 8 +++++--- .../io/metersphere/system/controller/LoginController.java | 2 +- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiReportService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiReportService.java index d9b50dd718..6dc9167542 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiReportService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/definition/ApiReportService.java @@ -121,11 +121,13 @@ public class ApiReportService { } private ApiReport checkResource(String id) { - ApiReport apiReport = apiReportMapper.selectByPrimaryKey(id); - if (apiReport == null) { + ApiReportExample example = new ApiReportExample(); + example.createCriteria().andIdEqualTo(id).andDeletedEqualTo(false); + List apiReport = apiReportMapper.selectByExample(example); + if (CollectionUtils.isEmpty(apiReport)) { throw new MSException(Translator.get("api_case_report_not_exist")); } - return apiReport; + return apiReport.getFirst(); } public void batchDelete(ApiReportBatchRequest request, String userId) { diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/service/scenario/ApiScenarioReportService.java b/backend/services/api-test/src/main/java/io/metersphere/api/service/scenario/ApiScenarioReportService.java index 798f5165a5..9b3209928f 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/service/scenario/ApiScenarioReportService.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/service/scenario/ApiScenarioReportService.java @@ -127,11 +127,13 @@ public class ApiScenarioReportService { } private ApiScenarioReport checkResource(String id) { - ApiScenarioReport scenarioReport = apiScenarioReportMapper.selectByPrimaryKey(id); - if (scenarioReport == null) { + ApiScenarioReportExample example = new ApiScenarioReportExample(); + example.createCriteria().andIdEqualTo(id).andDeletedEqualTo(false); + List scenarioReport = apiScenarioReportMapper.selectByExample(example); + if (CollectionUtils.isEmpty(scenarioReport)) { throw new RuntimeException(Translator.get("api_scenario_report_not_exist")); } - return scenarioReport; + return scenarioReport.getFirst(); } public void batchDelete(ApiReportBatchRequest request, String userId) { diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/LoginController.java b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/LoginController.java index 3c4d6df3c6..fd50185534 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/controller/LoginController.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/controller/LoginController.java @@ -29,7 +29,7 @@ import org.springframework.web.bind.annotation.*; @RestController @RequestMapping -@Tag(name="登陆") +@Tag(name="登录") public class LoginController { @Resource