| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform; |
| | | import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; |
| | | import com.genersoft.iot.vmp.storager.IRedisCatchStorage; |
| | | import com.genersoft.iot.vmp.storager.IVideoManagerStorager; |
| | | import com.github.pagehelper.PageInfo; |
| | | import org.slf4j.Logger; |
| | |
| | | |
| | | @Autowired |
| | | private IVideoManagerStorager storager; |
| | | @Autowired |
| | | private IRedisCatchStorage redisCatchStorage; |
| | | |
| | | @Autowired |
| | | private ISIPCommanderForPlatform commanderForPlatform; |
| | |
| | | boolean updateResult = storager.updateParentPlatform(parentPlatform); |
| | | |
| | | if (updateResult) { |
| | | commanderForPlatform.register(parentPlatform, null, null, null, null); |
| | | commanderForPlatform.register(parentPlatform); |
| | | |
| | | return new ResponseEntity<>("success", HttpStatus.OK); |
| | | }else { |
| | |
| | | ){ |
| | | 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()); |
| | | }), (event -> { |
| | | // 清空redis缓存 |
| | | redisCatchStorage.delPlatformCatchInfo(parentPlatform.getDeviceGBId()); |
| | | redisCatchStorage.delPlatformKeepalive(parentPlatform.getDeviceGBId()); |
| | | redisCatchStorage.delPlatformRegister(parentPlatform.getDeviceGBId()); |
| | | })); |
| | | |
| | | boolean deleteResult = storager.deleteParentPlatform(parentPlatform); |
| | | |
| | | |
| | | if (deleteResult) { |
| | | return new ResponseEntity<>("success", HttpStatus.OK); |
| | | }else { |