parent
add96e6bae
commit
9f3d968c50
|
@ -42,6 +42,7 @@ import javax.annotation.Resource;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
@ -86,6 +87,11 @@ public class DisposeNodeInfoController {
|
|||
LinkStatusListRsp linkStatusListRsp = new LinkStatusListRsp();
|
||||
linkStatusListRsp.setItems(new ArrayList<>());
|
||||
|
||||
if (Arrays.stream(reqInfo.getId()).anyMatch(Objects::isNull)) {
|
||||
log.error("Request params error, error:{}", mr.getMsgContent());
|
||||
return ProtocolRespDTO.result(ErrorCode.ERR_PARAMS);
|
||||
}
|
||||
|
||||
if (reqInfo.getId().length == 0) {
|
||||
List<DisposeDevice> devs = disposeNodeManager.getAllDisposeDevice();
|
||||
|
||||
|
@ -147,6 +153,11 @@ public class DisposeNodeInfoController {
|
|||
VersionListRsp versionListRsp = new VersionListRsp();
|
||||
versionListRsp.setItems(new ArrayList<>());
|
||||
|
||||
if (Arrays.stream(reqInfo.getId()).anyMatch(Objects::isNull)) {
|
||||
log.error("Request params error, error:{}", mr.getMsgContent());
|
||||
return ProtocolRespDTO.result(ErrorCode.ERR_PARAMS);
|
||||
}
|
||||
|
||||
if (reqInfo.getId().length == 0) {
|
||||
List<DisposeDevice> devList = disposeNodeManager.getAllDisposeDevice();
|
||||
if (devList != null && devList.size() > 0) {
|
||||
|
@ -204,9 +215,13 @@ public class DisposeNodeInfoController {
|
|||
|
||||
IDArrayReq reqInfo = mr.getRequestObject(IDArrayReq.class);
|
||||
DeviceInfoRsp rspInfo = new DeviceInfoRsp();
|
||||
|
||||
rspInfo.setItems(new ArrayList<>());
|
||||
|
||||
if (Arrays.stream(reqInfo.getId()).anyMatch(Objects::isNull)) {
|
||||
log.error("Request params error, error:{}", mr.getMsgContent());
|
||||
return ProtocolRespDTO.result(ErrorCode.ERR_PARAMS);
|
||||
}
|
||||
|
||||
if (reqInfo.getId().length == 0) {
|
||||
List<DisposeDevice> devList = disposeNodeManager.getAllDisposeDevice();
|
||||
|
||||
|
@ -273,10 +288,14 @@ public class DisposeNodeInfoController {
|
|||
}
|
||||
|
||||
IDArrayReq reqInfo = mr.getRequestObject(IDArrayReq.class);
|
||||
|
||||
DeviceCapacityRsp rspInfo = new DeviceCapacityRsp();
|
||||
rspInfo.setItems(new ArrayList<>());
|
||||
|
||||
if (Arrays.stream(reqInfo.getId()).anyMatch(Objects::isNull)) {
|
||||
log.error("Request params error, error:{}", mr.getMsgContent());
|
||||
return ProtocolRespDTO.result(ErrorCode.ERR_PARAMS);
|
||||
}
|
||||
|
||||
if (reqInfo.getId().length == 0) {
|
||||
List<DisposeDevice> devList = disposeNodeManager.getAllDisposeDevice();
|
||||
|
||||
|
@ -338,10 +357,14 @@ public class DisposeNodeInfoController {
|
|||
}
|
||||
|
||||
IDArrayReq reqInfo = mr.getRequestObject(IDArrayReq.class);
|
||||
|
||||
DeviceCapacityRsp rspInfo = new DeviceCapacityRsp();
|
||||
rspInfo.setItems(new ArrayList<>());
|
||||
|
||||
if (Arrays.stream(reqInfo.getId()).anyMatch(Objects::isNull)) {
|
||||
log.error("Request params error, error:{}", mr.getMsgContent());
|
||||
return ProtocolRespDTO.result(ErrorCode.ERR_PARAMS);
|
||||
}
|
||||
|
||||
if (reqInfo.getId().length == 0) {
|
||||
List<DisposeDevice> devList = disposeNodeManager.getAllDisposeDevice();
|
||||
|
||||
|
@ -482,10 +505,14 @@ public class DisposeNodeInfoController {
|
|||
}
|
||||
|
||||
IDArrayReq reqInfo = mr.getRequestObject(IDArrayReq.class);
|
||||
|
||||
DisposeNodeListRsp rspInfo = new DisposeNodeListRsp();
|
||||
rspInfo.setItems(new ArrayList<>());
|
||||
|
||||
if (Arrays.stream(reqInfo.getId()).anyMatch(Objects::isNull)) {
|
||||
log.error("Request params error, error:{}", mr.getMsgContent());
|
||||
return ProtocolRespDTO.result(ErrorCode.ERR_PARAMS);
|
||||
}
|
||||
|
||||
if (reqInfo.getId().length == 0) {
|
||||
List<DisposeDevice> devList = disposeNodeManager.getAllDisposeDevice();
|
||||
|
||||
|
@ -564,6 +591,11 @@ public class DisposeNodeInfoController {
|
|||
IDArrayReq reqInfo = mr.getRequestObject(IDArrayReq.class);
|
||||
NodeTaskRsp rspInfo = new NodeTaskRsp();
|
||||
|
||||
if (Arrays.stream(reqInfo.getId()).anyMatch(Objects::isNull)) {
|
||||
log.error("Request params error, error:{}", mr.getMsgContent());
|
||||
return ProtocolRespDTO.result(ErrorCode.ERR_PARAMS);
|
||||
}
|
||||
|
||||
List<DisposeDevice> valuableData = disposeNodeManager.getAllDisposeDevice()
|
||||
.stream()
|
||||
.filter(v -> reqInfo.getId().length == 0
|
||||
|
@ -644,6 +676,11 @@ public class DisposeNodeInfoController {
|
|||
IDArrayReq reqInfo = mr.getRequestObject(IDArrayReq.class);
|
||||
NodeTaskRsp rspInfo = new NodeTaskRsp();
|
||||
|
||||
if (Arrays.stream(reqInfo.getId()).anyMatch(Objects::isNull)) {
|
||||
log.error("Request params error, error:{}", mr.getMsgContent());
|
||||
return ProtocolRespDTO.result(ErrorCode.ERR_PARAMS);
|
||||
}
|
||||
|
||||
List<DisposeDevice> valuableData = disposeNodeManager.getAllDisposeDevice()
|
||||
.stream()
|
||||
.filter(v -> reqInfo.getId().length == 0
|
||||
|
|
Loading…
Reference in New Issue