|
@@ -11,6 +11,7 @@ import com.lutao.cloud.oil.pojo.vo.*;
|
|
|
import com.lutao.cloud.oil.service.VideoEquipmentInfoService;
|
|
|
import com.lutao.cloud.oil.service.VideoInfoService;
|
|
|
import com.lutao.entity.VideoEquipmentInfo;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
@@ -20,6 +21,7 @@ import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
@Service
|
|
|
+@Slf4j
|
|
|
public class VideoEquipmentInfoServiceImpl extends ServiceImpl<VideoEquipmentInfoMapper, VideoEquipmentInfo> implements VideoEquipmentInfoService {
|
|
|
|
|
|
@Resource
|
|
@@ -139,7 +141,9 @@ public class VideoEquipmentInfoServiceImpl extends ServiceImpl<VideoEquipmentInf
|
|
|
@Override
|
|
|
public MessageInfo getVideoUrl(String videoCode) {
|
|
|
// 获取token
|
|
|
+ log.info("获取视频地址");
|
|
|
String url = "http://dgs-servicebusgate2.zww.yjcloud.cn/oauth/token?client_id=8a7b785f08d04d439b71bc2b415cb685&client_secret=OA!Bq_P!";
|
|
|
+ log.info("url:" + url);
|
|
|
Map<String, String> map = restTemplate.getForObject(url, Map.class);
|
|
|
System.out.println("map:" + map);
|
|
|
String token = map.get("access_token");
|
|
@@ -149,6 +153,7 @@ public class VideoEquipmentInfoServiceImpl extends ServiceImpl<VideoEquipmentInf
|
|
|
Map<String, String> parameters = new LinkedHashMap<>();
|
|
|
parameters.put("cameraIndexCode", videoCode);
|
|
|
parameters.put("protocol", "wss");
|
|
|
+ log.info("url:" + url2);
|
|
|
MessageInfo result = restTemplate.postForObject(url2, JSONObject.toJSONString(parameters), MessageInfo.class);
|
|
|
// ws地址转化,从10段到59段
|
|
|
/**
|
|
@@ -171,6 +176,7 @@ public class VideoEquipmentInfoServiceImpl extends ServiceImpl<VideoEquipmentInf
|
|
|
if (data != null) {
|
|
|
String wsUrl = data.get("url");
|
|
|
String replace;
|
|
|
+ //
|
|
|
|
|
|
// 解决院网不能播放视频问题
|
|
|
//replace = wsUrl.replace("10.18.18.53", "splw2.mem.cegn.cn");
|