| | |
| | | } |
| | | // TODO 检查是否已经存在,且注册成功, 如果注册成功,需要先注销之前再,修改并注册 |
| | | |
| | | ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getDeviceGBId()); |
| | | // ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getDeviceGBId()); |
| | | ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getServerGBId()); |
| | | |
| | | boolean updateResult = storager.updateParentPlatform(parentPlatform); |
| | | |
| | |
| | | if (logger.isDebugEnabled()) { |
| | | logger.debug("查询所有上级设备API调用"); |
| | | } |
| | | if (StringUtils.isEmpty(parentPlatform.getDeviceGBId()) |
| | | if (StringUtils.isEmpty(parentPlatform.getServerGBId()) |
| | | ){ |
| | | return new ResponseEntity<>("missing parameters", HttpStatus.BAD_REQUEST); |
| | | } |
| | |
| | | // 发送离线消息,无论是否成功都删除缓存 |
| | | commanderForPlatform.unregister(parentPlatform, (event -> { |
| | | // 清空redis缓存 |
| | | redisCatchStorage.delPlatformCatchInfo(parentPlatform.getDeviceGBId()); |
| | | redisCatchStorage.delPlatformKeepalive(parentPlatform.getDeviceGBId()); |
| | | redisCatchStorage.delPlatformRegister(parentPlatform.getDeviceGBId()); |
| | | redisCatchStorage.delPlatformCatchInfo(parentPlatform.getServerGBId()); |
| | | redisCatchStorage.delPlatformKeepalive(parentPlatform.getServerGBId()); |
| | | redisCatchStorage.delPlatformRegister(parentPlatform.getServerGBId()); |
| | | }), (event -> { |
| | | // 清空redis缓存 |
| | | redisCatchStorage.delPlatformCatchInfo(parentPlatform.getDeviceGBId()); |
| | | redisCatchStorage.delPlatformKeepalive(parentPlatform.getDeviceGBId()); |
| | | redisCatchStorage.delPlatformRegister(parentPlatform.getDeviceGBId()); |
| | | redisCatchStorage.delPlatformCatchInfo(parentPlatform.getServerGBId()); |
| | | redisCatchStorage.delPlatformKeepalive(parentPlatform.getServerGBId()); |
| | | redisCatchStorage.delPlatformRegister(parentPlatform.getServerGBId()); |
| | | })); |
| | | |
| | | boolean deleteResult = storager.deleteParentPlatform(parentPlatform); |