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