移除推流的国标关联移除未推流的数据

pull/80/head
panlinlin 2021-04-03 21:19:08 +08:00
parent 20dca0f6b6
commit 2b1e56973e
1 changed files with 8 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.genersoft.iot.vmp.gb28181.bean.GbStream;
import com.genersoft.iot.vmp.media.zlm.ZLMRESTfulUtils;
import com.genersoft.iot.vmp.media.zlm.dto.MediaItem;
import com.genersoft.iot.vmp.media.zlm.dto.StreamProxyItem;
import com.genersoft.iot.vmp.media.zlm.dto.StreamPushItem;
@ -29,6 +30,9 @@ public class StreamPushServiceImpl implements IStreamPushService {
@Autowired
private StreamPushMapper streamPushMapper;
@Autowired
private ZLMRESTfulUtils zlmresTfulUtils;
@Override
public List<StreamPushItem> handleJSON(String jsonData) {
if (jsonData == null) return null;
@ -84,6 +88,10 @@ public class StreamPushServiceImpl implements IStreamPushService {
@Override
public boolean removeFromGB(GbStream stream) {
int del = gbStreamMapper.del(stream.getApp(), stream.getStream());
JSONObject mediaList = zlmresTfulUtils.getMediaList(stream.getApp(), stream.getStream());
if (mediaList == null) {
streamPushMapper.del(stream.getApp(), stream.getStream());
}
return del > 0;
}
}