Commit 2b1e56973edb72f990ee0d4a1b3e6d06ba3aa4d7
1 parent
20dca0f6
移除推流的国标关联移除未推流的数据
Showing
1 changed file
with
8 additions
and
0 deletions
src/main/java/com/genersoft/iot/vmp/service/impl/StreamPushServiceImpl.java
| ... | ... | @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; |
| 4 | 4 | import com.alibaba.fastjson.JSONObject; |
| 5 | 5 | import com.alibaba.fastjson.TypeReference; |
| 6 | 6 | import com.genersoft.iot.vmp.gb28181.bean.GbStream; |
| 7 | +import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils; | |
| 7 | 8 | import com.genersoft.iot.vmp.media.zlm.dto.MediaItem; |
| 8 | 9 | import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem; |
| 9 | 10 | import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem; |
| ... | ... | @@ -29,6 +30,9 @@ public class StreamPushServiceImpl implements IStreamPushService { |
| 29 | 30 | @Autowired |
| 30 | 31 | private StreamPushMapper streamPushMapper; |
| 31 | 32 | |
| 33 | + @Autowired | |
| 34 | + private ZLMRESTfulUtils zlmresTfulUtils; | |
| 35 | + | |
| 32 | 36 | @Override |
| 33 | 37 | public List<StreamPushItem> handleJSON(String jsonData) { |
| 34 | 38 | if (jsonData == null) return null; |
| ... | ... | @@ -84,6 +88,10 @@ public class StreamPushServiceImpl implements IStreamPushService { |
| 84 | 88 | @Override |
| 85 | 89 | public boolean removeFromGB(GbStream stream) { |
| 86 | 90 | int del = gbStreamMapper.del(stream.getApp(), stream.getStream()); |
| 91 | + JSONObject mediaList = zlmresTfulUtils.getMediaList(stream.getApp(), stream.getStream()); | |
| 92 | + if (mediaList == null) { | |
| 93 | + streamPushMapper.del(stream.getApp(), stream.getStream()); | |
| 94 | + } | |
| 87 | 95 | return del > 0; |
| 88 | 96 | } |
| 89 | 97 | } | ... | ... |