Compare commits
No commits in common. "0c640eeeb81fec771be0502fdf542239ed5b5db0f0aeb321ec24bfe40e0fff21" and "2ffd81991e975cdc3d443bf41701708f8bbb78a8b60186dcc202bf78f49854c4" have entirely different histories.
0c640eeeb8
...
2ffd81991e
@ -112,12 +112,12 @@ public class EbikeEcuInfoServiceImpl extends ServiceImpl<EbikeEcuInfoMapper, Ebi
|
||||
@Override
|
||||
public boolean online(String ecuSn, String bikeCode) throws IOException {
|
||||
check(ecuSn, bikeCode);
|
||||
// if (StringUtil.hasText(ecuSn)) {
|
||||
// checkEcuSn(ecuSn);
|
||||
// } else {
|
||||
// EbikeEcuInfo ebikeEcuInfo = getEcu(bikeCode);
|
||||
// ecuSn = ebikeEcuInfo.getEcuSn();
|
||||
// }
|
||||
if (StringUtil.hasText(ecuSn)) {
|
||||
checkEcuSn(ecuSn);
|
||||
} else {
|
||||
EbikeEcuInfo ebikeEcuInfo = getEcu(bikeCode);
|
||||
ecuSn = ebikeEcuInfo.getEcuSn();
|
||||
}
|
||||
return EmqxApiClient.isClientOnline(ecuSn);
|
||||
}
|
||||
|
||||
|
||||
@ -77,14 +77,6 @@ public class EmqxApiClient {
|
||||
|
||||
String response = executeRequest(request);
|
||||
JsonNode jsonNode = mapper.readValue(response,JsonNode.class);
|
||||
try {
|
||||
JsonNode node = jsonNode.get("code");
|
||||
if (node!=null && node.asInt() != 200) {
|
||||
return false;
|
||||
}
|
||||
}catch (Exception e){
|
||||
return false;
|
||||
}
|
||||
return jsonNode.get("connected").asBoolean();
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user