Browse Source

fix issue#14441 (#14441) (#14444)

alert-plugin-instances api, if no alert-plugin-instances, it will response an empty list, but not null

Co-authored-by: ligen60 <ligen60@jd.com>
3.2.1-prepare
ligen 1 year ago committed by GitHub
parent
commit
d8cf0f8b85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertPluginInstanceServiceImpl.java

6
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/AlertPluginInstanceServiceImpl.java

@ -243,16 +243,16 @@ public class AlertPluginInstanceServiceImpl extends BaseServiceImpl implements A
} }
private List<AlertPluginInstanceVO> buildPluginInstanceVOList(List<AlertPluginInstance> alertPluginInstances) { private List<AlertPluginInstanceVO> buildPluginInstanceVOList(List<AlertPluginInstance> alertPluginInstances) {
List<AlertPluginInstanceVO> alertPluginInstanceVOS = new ArrayList<>();
if (CollectionUtils.isEmpty(alertPluginInstances)) { if (CollectionUtils.isEmpty(alertPluginInstances)) {
return null; return alertPluginInstanceVOS;
} }
List<PluginDefine> pluginDefineList = pluginDefineMapper.queryAllPluginDefineList(); List<PluginDefine> pluginDefineList = pluginDefineMapper.queryAllPluginDefineList();
if (CollectionUtils.isEmpty(pluginDefineList)) { if (CollectionUtils.isEmpty(pluginDefineList)) {
return null; return alertPluginInstanceVOS;
} }
Map<Integer, PluginDefine> pluginDefineMap = Map<Integer, PluginDefine> pluginDefineMap =
pluginDefineList.stream().collect(Collectors.toMap(PluginDefine::getId, Function.identity())); pluginDefineList.stream().collect(Collectors.toMap(PluginDefine::getId, Function.identity()));
List<AlertPluginInstanceVO> alertPluginInstanceVOS = new ArrayList<>();
alertPluginInstances.forEach(alertPluginInstance -> { alertPluginInstances.forEach(alertPluginInstance -> {
AlertPluginInstanceVO alertPluginInstanceVO = new AlertPluginInstanceVO(); AlertPluginInstanceVO alertPluginInstanceVO = new AlertPluginInstanceVO();

Loading…
Cancel
Save