From a1fa867f03be79e774691127f1894f761e1af64a Mon Sep 17 00:00:00 2001 From: youys <1272586223@qq.com> Date: Tue, 12 Jul 2022 16:56:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../educoder/ecsonar/controller/CloudBrainController.java | 7 +++++++ .../net/educoder/ecsonar/services/CloudBrainService.java | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/educoder/ecsonar/controller/CloudBrainController.java b/src/main/java/net/educoder/ecsonar/controller/CloudBrainController.java index 951243d..1a24c9d 100644 --- a/src/main/java/net/educoder/ecsonar/controller/CloudBrainController.java +++ b/src/main/java/net/educoder/ecsonar/controller/CloudBrainController.java @@ -8,6 +8,7 @@ import net.educoder.ecsonar.model.vo.*; import net.educoder.ecsonar.services.CloudBrainService; import net.educoder.ecsonar.utils.ResponseResult; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -69,6 +70,12 @@ public class CloudBrainController { */ @GetMapping(value = "/issues/search") public ResponseResult issuesSearch(IssuesSearchVO searchVO) { + if (StringUtils.isBlank(searchVO.getTaskName())) { + return ResponseResult.error("taskName不能为空"); + } + if (StringUtils.isBlank(searchVO.getType())) { + return ResponseResult.error("type不能为空"); + } List result = cloudBrainService.issuesSearch(searchVO); return ResponseResult.success(result); } diff --git a/src/main/java/net/educoder/ecsonar/services/CloudBrainService.java b/src/main/java/net/educoder/ecsonar/services/CloudBrainService.java index ba7497a..6ebf78b 100644 --- a/src/main/java/net/educoder/ecsonar/services/CloudBrainService.java +++ b/src/main/java/net/educoder/ecsonar/services/CloudBrainService.java @@ -213,7 +213,7 @@ public class CloudBrainService { IssuesVO vo = new IssuesVO(); vo.setComponent(issueObj.getString("component")); - vo.setLine(issueObj.getInteger("line")); + vo.setLine(issueObj.getIntValue("line")); vo.setMessage(issueObj.getString("message")); vo.setSeverity(issueObj.getString("severity")); vo.setStatus(issueObj.getString("status")); @@ -223,6 +223,7 @@ public class CloudBrainService { return issuesVOS; } + /** * 获取问题源代码 *