| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alibaba.fastjson.TypeReference; |
| | | import com.genersoft.iot.vmp.conf.MediaConfig; |
| | | import com.genersoft.iot.vmp.conf.UserSetting; |
| | | import com.genersoft.iot.vmp.gb28181.bean.*; |
| | | import com.genersoft.iot.vmp.gb28181.event.EventPublisher; |
| | |
| | | @Autowired |
| | | TransactionDefinition transactionDefinition; |
| | | |
| | | @Autowired |
| | | private MediaConfig mediaConfig; |
| | | |
| | | |
| | | @Override |
| | | public List<StreamPushItem> handleJSON(String jsonData, MediaServerItem mediaServerItem) { |
| | | if (jsonData == null) { |
| | |
| | | stream.setStreamType("push"); |
| | | stream.setStatus(true); |
| | | stream.setCreateTime(DateUtil.getNow()); |
| | | stream.setStreamType("push"); |
| | | stream.setMediaServerId(mediaConfig.getId()); |
| | | int add = gbStreamMapper.add(stream); |
| | | return add > 0; |
| | | } |
| | |
| | | gbStreamMapper.batchAdd(streamPushItems); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void batchAddForUpload(List<StreamPushItem> streamPushItems, Map<String, List<String[]>> streamPushItemsForAll ) { |
| | | // 存储数据到stream_push表 |
| | |
| | | try { |
| | | int addStreamResult = streamPushMapper.add(stream); |
| | | if (!StringUtils.isEmpty(stream.getGbId())) { |
| | | stream.setStreamType("push"); |
| | | gbStreamMapper.add(stream); |
| | | } |
| | | dataSourceTransactionManager.commit(transactionStatus); |
| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public List<String> getAllAppAndStream() { |
| | | return streamPushMapper.getAllAppAndStream(); |
| | | } |
| | | } |