youys 2 years ago
parent 7a861c0c65
commit a1fa867f03

@ -8,6 +8,7 @@ import net.educoder.ecsonar.model.vo.*;
import net.educoder.ecsonar.services.CloudBrainService; import net.educoder.ecsonar.services.CloudBrainService;
import net.educoder.ecsonar.utils.ResponseResult; import net.educoder.ecsonar.utils.ResponseResult;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -69,6 +70,12 @@ public class CloudBrainController {
*/ */
@GetMapping(value = "/issues/search") @GetMapping(value = "/issues/search")
public ResponseResult<IssuesVO> issuesSearch(IssuesSearchVO searchVO) { public ResponseResult<IssuesVO> issuesSearch(IssuesSearchVO searchVO) {
if (StringUtils.isBlank(searchVO.getTaskName())) {
return ResponseResult.error("taskName不能为空");
}
if (StringUtils.isBlank(searchVO.getType())) {
return ResponseResult.error("type不能为空");
}
List<IssuesVO> result = cloudBrainService.issuesSearch(searchVO); List<IssuesVO> result = cloudBrainService.issuesSearch(searchVO);
return ResponseResult.success(result); return ResponseResult.success(result);
} }

@ -213,7 +213,7 @@ public class CloudBrainService {
IssuesVO vo = new IssuesVO(); IssuesVO vo = new IssuesVO();
vo.setComponent(issueObj.getString("component")); vo.setComponent(issueObj.getString("component"));
vo.setLine(issueObj.getInteger("line")); vo.setLine(issueObj.getIntValue("line"));
vo.setMessage(issueObj.getString("message")); vo.setMessage(issueObj.getString("message"));
vo.setSeverity(issueObj.getString("severity")); vo.setSeverity(issueObj.getString("severity"));
vo.setStatus(issueObj.getString("status")); vo.setStatus(issueObj.getString("status"));
@ -223,6 +223,7 @@ public class CloudBrainService {
return issuesVOS; return issuesVOS;
} }
/** /**
* *
* *

Loading…
Cancel
Save