|  |  | 
 |  |  |     @GetMapping("/server_config") | 
 |  |  |     public ResponseEntity<JSONObject> serverConfig() { | 
 |  |  |         JSONObject result = new JSONObject(); | 
 |  |  |         result.put("deviceIp", sipConfig.getSipIp()); | 
 |  |  |         result.put("devicePort", sipConfig.getSipPort()); | 
 |  |  |         result.put("username", sipConfig.getSipId()); | 
 |  |  |         result.put("password", sipConfig.getSipPassword()); | 
 |  |  |         result.put("deviceIp", sipConfig.getIp()); | 
 |  |  |         result.put("devicePort", sipConfig.getPort()); | 
 |  |  |         result.put("username", sipConfig.getId()); | 
 |  |  |         result.put("password", sipConfig.getPassword()); | 
 |  |  |         return new ResponseEntity<>(result, HttpStatus.OK); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | 
 |  |  |     }) | 
 |  |  |     public PageInfo<ParentPlatform> platforms(@PathVariable int page, @PathVariable int count){ | 
 |  |  |  | 
 |  |  |         if (logger.isDebugEnabled()) { | 
 |  |  |             logger.debug("查询所有上级设备API调用"); | 
 |  |  |         } | 
 |  |  | //        if (logger.isDebugEnabled()) { | 
 |  |  | //            logger.debug("查询所有上级设备API调用"); | 
 |  |  | //        } | 
 |  |  |         return storager.queryParentPlatformList(page, count); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | 
 |  |  |         // TODO 检查是否已经存在,且注册成功, 如果注册成功,需要先注销之前再,修改并注册 | 
 |  |  |  | 
 |  |  |         // ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getDeviceGBId()); | 
 |  |  |         ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getServerGBId()); | 
 |  |  |         ParentPlatform parentPlatformOld = storager.queryParentPlatByServerGBId(parentPlatform.getServerGBId()); | 
 |  |  |  | 
 |  |  |         boolean updateResult = storager.updateParentPlatform(parentPlatform); | 
 |  |  |  | 
 |  |  | 
 |  |  |             // 保存时启用就发送注册 | 
 |  |  |             if (parentPlatform.isEnable()) { | 
 |  |  |                 //  只要保存就发送注册 | 
 |  |  |                 commanderForPlatform.register(parentPlatform); | 
 |  |  |                 commanderForPlatform.register(parentPlatform, null, null); | 
 |  |  |             } else if (parentPlatformOld != null && parentPlatformOld.isEnable() && !parentPlatform.isEnable()){ // 关闭启用时注销 | 
 |  |  |                 commanderForPlatform.unregister(parentPlatform, null, null); | 
 |  |  |             } | 
 |  |  |  | 
 |  |  |  | 
 |  |  |             return new ResponseEntity<>("success", HttpStatus.OK); | 
 |  |  |         } else { | 
 |  |  |             return new ResponseEntity<>("fail", HttpStatus.OK); | 
 |  |  | 
 |  |  |         ){ | 
 |  |  |             return new ResponseEntity<>("missing parameters", HttpStatus.BAD_REQUEST); | 
 |  |  |         } | 
 |  |  |         ParentPlatform parentPlatform = storager.queryParentPlatById(serverGBId); | 
 |  |  |         ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(serverGBId); | 
 |  |  |         if (parentPlatform == null) return new ResponseEntity<>("fail", HttpStatus.OK); | 
 |  |  |         // 发送离线消息,无论是否成功都删除缓存 | 
 |  |  |         commanderForPlatform.unregister(parentPlatform, (event -> { | 
 |  |  | 
 |  |  |     @ResponseBody | 
 |  |  |     public ResponseEntity<String> exitPlatform(@PathVariable String serverGBId){ | 
 |  |  |  | 
 |  |  |         if (logger.isDebugEnabled()) { | 
 |  |  |             logger.debug("查询上级平台是否存在API调用:" + serverGBId); | 
 |  |  |         } | 
 |  |  |         ParentPlatform parentPlatform = storager.queryParentPlatById(serverGBId); | 
 |  |  | //        if (logger.isDebugEnabled()) { | 
 |  |  | //            logger.debug("查询上级平台是否存在API调用:" + serverGBId); | 
 |  |  | //        } | 
 |  |  |         ParentPlatform parentPlatform = storager.queryParentPlatByServerGBId(serverGBId); | 
 |  |  |         return new ResponseEntity<>(String.valueOf(parentPlatform != null), HttpStatus.OK); | 
 |  |  |     } | 
 |  |  |  | 
 |  |  | 
 |  |  |                                               @RequestParam(required = false) Boolean choosed, | 
 |  |  |                                               @RequestParam(required = false) Boolean channelType){ | 
 |  |  |  | 
 |  |  |         if (logger.isDebugEnabled()) { | 
 |  |  |             logger.debug("查询所有所有通道API调用"); | 
 |  |  |         } | 
 |  |  | //        if (logger.isDebugEnabled()) { | 
 |  |  | //            logger.debug("查询所有所有通道API调用"); | 
 |  |  | //        } | 
 |  |  |         PageInfo<ChannelReduce> channelReduces = null; | 
 |  |  |         if (platformId != null ) { | 
 |  |  |             channelReduces = storager.queryAllChannelList(page, count, query, online, channelType, platformId, choosed); |