REM:
1.  版本更新为2.0.8.6
2.  接口调用验证失败时,自动调用重新登录接口
This commit is contained in:
HuangXin 2021-10-26 09:24:51 +08:00
parent 7fa5d10587
commit 6ac14e9371
2 changed files with 13 additions and 11 deletions

View File

@ -17,7 +17,7 @@
</parent>
<groupId>com.dispose</groupId>
<artifactId>dispose_platform</artifactId>
<version>2.0.8.5</version>
<version>2.0.8.6</version>
<name>dispose_platform</name>
<description>Dispose Platform</description>
<dependencies>

View File

@ -151,6 +151,7 @@ public class PengXinAbilityImpl implements DisposeAbility {
String url = urlRootPath + "dispose_device/task/start";
if (token == null || token.length() == 0) {
upgradeToken();
return new MulReturnType<>(ErrorCode.ERR_LOGOUT, "");
}
@ -200,7 +201,7 @@ public class PengXinAbilityImpl implements DisposeAbility {
return new MulReturnType<>(ErrorCode.ERR_PENGXIN_ERROR, null);
}
log.debug("----Finish PengXin Start Cleanup Task: {}", disposeObject);
log.info("----Finish PengXin Start Cleanup Task: {}", disposeObject);
return new MulReturnType<>(ErrorCode.ERR_OK, rspInfo.getMsgContent().getItems().get(0).getTaskId());
}
} catch (Exception ex) {
@ -227,6 +228,7 @@ public class PengXinAbilityImpl implements DisposeAbility {
String url = urlRootPath + "dispose_device/task/stop";
if (token == null || token.length() == 0) {
upgradeToken();
return new MulReturnType<>(ErrorCode.ERR_LOGOUT, null);
}
@ -266,7 +268,7 @@ public class PengXinAbilityImpl implements DisposeAbility {
return new MulReturnType<>(ErrorCode.ERR_PENGXIN_ERROR, null);
}
log.debug("----Finish PengXin Stop Cleanup Task: {}", taskId);
log.info("----Finish PengXin Stop Cleanup Task: {}", taskId);
return new MulReturnType<>(ErrorCode.ERR_OK, null);
}
} catch (Exception ex) {
@ -456,6 +458,7 @@ public class PengXinAbilityImpl implements DisposeAbility {
@Override
public MulReturnType<ErrorCode, Long> taskStatus(String taskId) {
if (token == null || token.length() == 0) {
upgradeToken();
return new MulReturnType<>(ErrorCode.ERR_LOGOUT, -1L);
}
@ -470,15 +473,14 @@ public class PengXinAbilityImpl implements DisposeAbility {
rspInfo = restfulInterface.getDeviceTaskStatus(url, token, new String[]{taskId});
}
if (rspInfo != null && rspInfo.getCode() == ErrorCode.ERR_OK.getHttpCode()) {
if (rspInfo != null) {
if (rspInfo.getCode() == ErrorCode.ERR_OK.getHttpCode()) {
int errCode = rspInfo.getMsgContent().getItems().get(0).getStatus();
if (rspInfo.getMsgContent().getItems().size() == 0 || errCode != ErrorCode.ERR_OK.getCode()) {
return new MulReturnType<>(ErrorCode.ERR_NOSUCHTASK, -1L);
}
return new MulReturnType<>(ErrorCode.ERR_OK,
rspInfo.getMsgContent().getItems().get(0).getTaskStatus());
}
return new MulReturnType<>(ErrorCode.ERR_OK, rspInfo.getMsgContent().getItems().get(0).getTaskStatus());
} else {
return new MulReturnType<>(ErrorCode.ERR_CALLDEVICE, -1L);
}