parent
cbb1d29a63
commit
31265036f0
|
@ -172,12 +172,12 @@ public class PengXinAbilityImpl implements DisposeAbility {
|
|||
}
|
||||
|
||||
reqItems.add(PengXinStartTaskItem.builder()
|
||||
.type(getPengXinTaskType(capType))
|
||||
.disposeObject(disposeObject)
|
||||
.objectType(getPengXinObjectType(objectType))
|
||||
.disposeTime(duration)
|
||||
.taskReqId(String.valueOf(taskReqId++))
|
||||
.build());
|
||||
.type(getPengXinTaskType(capType))
|
||||
.disposeObject(disposeObject)
|
||||
.objectType(getPengXinObjectType(objectType))
|
||||
.disposeTime(duration)
|
||||
.taskReqId(String.valueOf(taskReqId++))
|
||||
.build());
|
||||
|
||||
ProtocolRespDTO<PengXinStartTaskRsp> rspInfo = restfulInterface.startDisposeTask(url, token, reqItems);
|
||||
|
||||
|
@ -245,7 +245,7 @@ public class PengXinAbilityImpl implements DisposeAbility {
|
|||
}
|
||||
|
||||
ProtocolRespDTO<PengXinStopTaskRsp> rspInfo = restfulInterface.stopDisposeTask(url, token,
|
||||
new String[]{taskId});
|
||||
new String[]{taskId});
|
||||
|
||||
// 判断是否token过期
|
||||
if (rspInfo != null && reLogin(rspInfo, rspInfo.getMsgContent().getItems().get(0).getStatus())) {
|
||||
|
@ -285,18 +285,18 @@ public class PengXinAbilityImpl implements DisposeAbility {
|
|||
@Override
|
||||
public MulReturnType<ErrorCode, DeviceFirewareInfo> getAbilityDeviceFireware() {
|
||||
return new MulReturnType<>(ErrorCode.ERR_OK,
|
||||
DeviceFirewareInfo.builder()
|
||||
.vendor("PengXin")
|
||||
.model("Unknown")
|
||||
.firmware("Unknown")
|
||||
.os("Linux Server")
|
||||
.kernel("Linux")
|
||||
.arch("x86_64")
|
||||
.version("Unknown")
|
||||
.memory(-1)
|
||||
.freeMemory(-1)
|
||||
.cpuUsed(-1)
|
||||
.build());
|
||||
DeviceFirewareInfo.builder()
|
||||
.vendor("PengXin")
|
||||
.model("Unknown")
|
||||
.firmware("Unknown")
|
||||
.os("Linux Server")
|
||||
.kernel("Linux")
|
||||
.arch("x86_64")
|
||||
.version("Unknown")
|
||||
.memory(-1)
|
||||
.freeMemory(-1)
|
||||
.cpuUsed(-1)
|
||||
.build());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -459,7 +459,7 @@ public class PengXinAbilityImpl implements DisposeAbility {
|
|||
String url = urlRootPath + "dispose_device/task/get";
|
||||
|
||||
ProtocolRespDTO<PengXinTaskStatusRsp> rspInfo = restfulInterface.getDeviceTaskStatus(url, token,
|
||||
new String[]{taskId});
|
||||
new String[]{taskId});
|
||||
|
||||
// 判断是否token过期
|
||||
if (rspInfo != null && reLogin(rspInfo, rspInfo.getMsgContent().getItems().get(0).getStatus())) {
|
||||
|
@ -474,7 +474,7 @@ public class PengXinAbilityImpl implements DisposeAbility {
|
|||
}
|
||||
|
||||
return new MulReturnType<>(ErrorCode.ERR_OK,
|
||||
rspInfo.getMsgContent().getItems().get(0).getTaskStatus());
|
||||
rspInfo.getMsgContent().getItems().get(0).getTaskStatus());
|
||||
} else {
|
||||
return new MulReturnType<>(ErrorCode.ERR_CALLDEVICE, -1L);
|
||||
}
|
||||
|
@ -510,12 +510,15 @@ public class PengXinAbilityImpl implements DisposeAbility {
|
|||
return true;
|
||||
}
|
||||
|
||||
if (rspInfo.getCode() == HttpServletResponse.SC_OK &&
|
||||
(status == ErrorCode.ERR_LOGOUT.getCode() || status == ErrorCode.ERR_TOKENTIMEOUT.getCode() ||
|
||||
status == ErrorCode.ERR_TOKENNOTFOUND.getCode())) {
|
||||
upgradeToken();
|
||||
return true;
|
||||
if (rspInfo.getCode() == HttpServletResponse.SC_OK) {
|
||||
if (status == ErrorCode.ERR_LOGOUT.getCode() ||
|
||||
status == ErrorCode.ERR_TOKENTIMEOUT.getCode() ||
|
||||
status == ErrorCode.ERR_TOKENNOTFOUND.getCode()) {
|
||||
upgradeToken();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
} catch (Exception ignored) {
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue