From e908578e95db6c52c44bba29e8bc17cb5b358553 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Mon, 21 Feb 2022 15:18:48 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=88=91=E7=9A=84=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E5=8F=B0):=20=E4=BF=AE=E5=A4=8D=E6=88=91=E7=9A=84=E5=BE=85?= =?UTF-8?q?=E5=8A=9E=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1010430--user=郭雨琦 修复我的待办接口定义数据查询问题 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001010430 --- .../metersphere/api/service/ApiDefinitionService.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java index c0c5412d69..96109e3c82 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -135,10 +135,20 @@ public class ApiDefinitionService { if (StringUtils.isNotBlank(request.getProjectId())) { buildProjectInfo(resList, request.getProjectId()); calculateResult(resList, request.getProjectId()); + }else{ + buildProjectInfoWidthoutProject(resList); } return resList; } + private void buildProjectInfoWidthoutProject(List resList) { + resList.forEach(i -> { + Project project = projectMapper.selectByPrimaryKey(i.getProjectId()); + i.setProjectName(project.getName()); + i.setVersionEnable(project.getVersionEnable()); + }); + } + public void buildUserInfo(List apis) { if (CollectionUtils.isEmpty(apis)) { return;