...
|
...
|
@@ -4,8 +4,10 @@ import com.google.common.collect.Lists; |
|
|
import com.yoho.core.dal.datasource.annotation.Database;
|
|
|
import com.yoho.order.dal.CameraRecordMapper;
|
|
|
import com.yoho.order.dal.QiniuLiveRecordMapper;
|
|
|
import com.yoho.order.dal.UserCameraRecordMapper;
|
|
|
import com.yoho.order.model.CameraRecord;
|
|
|
import com.yoho.order.model.QiniuLiveRecord;
|
|
|
import com.yoho.order.model.UserCameraRecord;
|
|
|
import com.yoho.ufo.exception.PlatformException;
|
|
|
import com.yoho.ufo.order.service.event.QiniuLiveRecordEvent;
|
|
|
import com.yoho.ufo.service.impl.QNLiveUtil;
|
...
|
...
|
@@ -44,6 +46,9 @@ public class UfoLiveService implements ApplicationContextAware { |
|
|
@Autowired
|
|
|
private CameraRecordMapper cameraRecordMapper;
|
|
|
|
|
|
@Autowired
|
|
|
private UserCameraRecordMapper userCameraRecordMapper;
|
|
|
|
|
|
public void setApplicationContext(ApplicationContext applicationContext) {
|
|
|
this.context = applicationContext;
|
|
|
}
|
...
|
...
|
@@ -71,6 +76,8 @@ public class UfoLiveService implements ApplicationContextAware { |
|
|
|
|
|
// 保存记录
|
|
|
private void saveRecord(QNliveReq req, String fileName, String persistId) {
|
|
|
qiniuLiveRecordMapper.updateShowFlagBySkup(req.getSkup(), 0, 0); // 先更新之前的视频记录为不可见
|
|
|
|
|
|
QiniuLiveRecord record = new QiniuLiveRecord();
|
|
|
record.setDepotNo(req.getDepotNo());
|
|
|
record.setCreateTime(DateUtil.getCurrentTimeSeconds());
|
...
|
...
|
@@ -117,6 +124,8 @@ public class UfoLiveService implements ApplicationContextAware { |
|
|
}
|
|
|
|
|
|
public String queryM3u8Url(Integer cameraCode) throws PlatformException {
|
|
|
userCameraRecordMapper.insertUserCameraRecord(new UserHelper().getUserId(), cameraCode);
|
|
|
|
|
|
List<CameraRecord> cameraRecordList = cameraRecordMapper.selectAllCameraRecord();
|
|
|
|
|
|
for (CameraRecord item : cameraRecordList) {
|
...
|
...
|
@@ -135,4 +144,10 @@ public class UfoLiveService implements ApplicationContextAware { |
|
|
|
|
|
return cameraRecordResps;
|
|
|
}
|
|
|
|
|
|
// 查询当前登录用户默认的摄像头设备
|
|
|
public Integer queryInitCameraCode(QNliveReq req) {
|
|
|
UserCameraRecord userCameraRecord = userCameraRecordMapper.selectUserCameraRecord(new UserHelper().getUserId());
|
|
|
return null == userCameraRecord ? null : userCameraRecord.getCameraCode();
|
|
|
}
|
|
|
} |
...
|
...
|
|