| | |
| | | package com.genersoft.iot.vmp.vmanager.platform; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | 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.genersoft.iot.vmp.vmanager.platform.bean.ChannelReduce; |
| | | import com.genersoft.iot.vmp.vmanager.platform.bean.UpdateChannelParam; |
| | | import com.github.pagehelper.PageInfo; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.genersoft.iot.vmp.conf.SipConfig; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | @CrossOrigin |
| | |
| | | |
| | | @Autowired |
| | | private IVideoManagerStorager storager; |
| | | |
| | | @Autowired |
| | | private IRedisCatchStorage redisCatchStorage; |
| | | |
| | |
| | | } |
| | | // TODO 检查是否已经存在,且注册成功, 如果注册成功,需要先注销之前再,修改并注册 |
| | | |
| | | ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getDeviceGBId()); |
| | | // ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getDeviceGBId()); |
| | | ParentPlatform parentPlatformOld = storager.queryParentPlatById(parentPlatform.getServerGBId()); |
| | | |
| | | boolean updateResult = storager.updateParentPlatform(parentPlatform); |
| | | |
| | |
| | | return new ResponseEntity<>(String.valueOf(parentPlatform != null), HttpStatus.OK); |
| | | } |
| | | |
| | | @RequestMapping("/platforms/channelList") |
| | | @ResponseBody |
| | | public PageInfo<ChannelReduce> channelList(int page, int count, |
| | | @RequestParam(required = false) String platformId, |
| | | @RequestParam(required = false) String query, |
| | | @RequestParam(required = false) Boolean online, |
| | | @RequestParam(required = false) Boolean choosed, |
| | | @RequestParam(required = false) Boolean channelType){ |
| | | |
| | | if (logger.isDebugEnabled()) { |
| | | logger.debug("查询所有所有通道API调用"); |
| | | } |
| | | PageInfo<ChannelReduce> channelReduces = null; |
| | | if (platformId != null ) { |
| | | channelReduces = storager.queryAllChannelList(page, count, query, online, channelType, platformId, choosed); |
| | | }else { |
| | | channelReduces = storager.queryAllChannelList(page, count, query, online, channelType, null, false); |
| | | } |
| | | |
| | | return channelReduces; |
| | | } |
| | | |
| | | |
| | | @RequestMapping("/platforms/updateChannelForGB") |
| | | @ResponseBody |
| | | public ResponseEntity<String> updateChannelForGB(@RequestBody UpdateChannelParam param){ |
| | | |
| | | if (logger.isDebugEnabled()) { |
| | | logger.debug("给上级平台添加国标通道API调用"); |
| | | } |
| | | int result = storager.updateChannelForGB(param.getPlatformId(), param.getChannelReduces()); |
| | | |
| | | return new ResponseEntity<>(String.valueOf(result > 0), HttpStatus.OK); |
| | | } |
| | | |
| | | @RequestMapping("/platforms/delChannelForGB") |
| | | @ResponseBody |
| | | public ResponseEntity<String> delChannelForGB(@RequestBody UpdateChannelParam param){ |
| | | |
| | | if (logger.isDebugEnabled()) { |
| | | logger.debug("给上级平台添加国标通道API调用"); |
| | | } |
| | | int result = storager.delChannelForGB(param.getPlatformId(), param.getChannelReduces()); |
| | | |
| | | return new ResponseEntity<>(String.valueOf(result > 0), HttpStatus.OK); |
| | | } |
| | | |
| | | |
| | | } |