Commit 0552ff9a authored by kinky2014's avatar kinky2014

视频接口增加截图

parent 6727088e
...@@ -17,4 +17,6 @@ public class CommonVideoDto { ...@@ -17,4 +17,6 @@ public class CommonVideoDto {
private String title; private String title;
private String thumb;
} }
...@@ -68,12 +68,13 @@ public class CylinderUnitVideoServiceImpl extends BaseService<CylinderUnitVideoD ...@@ -68,12 +68,13 @@ public class CylinderUnitVideoServiceImpl extends BaseService<CylinderUnitVideoD
String accessToken = objTokenJson.get("accessToken").toString(); String accessToken = objTokenJson.get("accessToken").toString();
System.out.println(accessToken); System.out.println(accessToken);
String channelNos = cylinderUnitVideo.getChannelNo(); String channelNos = cylinderUnitVideo.getChannelNo();
List<String> channelNoList = Arrays.asList(channelNos.split(",")); List<CommonVideoDto> channelNoList = JSONObject.parseArray(channelNos, CommonVideoDto.class);
for (String channelNo : channelNoList) { // List<String> channelNoList = Arrays.asList(channelNos.split(","));
for (CommonVideoDto channelNo : channelNoList) {
HashMap<String, Object> requestVideosInfo = new HashMap<>(); HashMap<String, Object> requestVideosInfo = new HashMap<>();
requestVideosInfo.put("accessToken",accessToken); requestVideosInfo.put("accessToken",accessToken);
requestVideosInfo.put("deviceSerial",cylinderUnitVideo.getDeviceSerial()); requestVideosInfo.put("deviceSerial",cylinderUnitVideo.getDeviceSerial());
requestVideosInfo.put("channelNo",channelNo); requestVideosInfo.put("channelNo",channelNo.getKey());
requestVideosInfo.put("protocol",cylinderUnitVideo.getProtocol()); requestVideosInfo.put("protocol",cylinderUnitVideo.getProtocol());
requestVideosInfo.put("expireTime",cylinderUnitVideo.getExpireTime()); requestVideosInfo.put("expireTime",cylinderUnitVideo.getExpireTime());
String videoData = HttpUtil.post(cylinderUnitVideo.getUrl(),requestVideosInfo); String videoData = HttpUtil.post(cylinderUnitVideo.getUrl(),requestVideosInfo);
...@@ -90,9 +91,10 @@ public class CylinderUnitVideoServiceImpl extends BaseService<CylinderUnitVideoD ...@@ -90,9 +91,10 @@ public class CylinderUnitVideoServiceImpl extends BaseService<CylinderUnitVideoD
String url = dd.get("url").toString(); String url = dd.get("url").toString();
CommonVideoDto commonVideoDto = new CommonVideoDto(); CommonVideoDto commonVideoDto = new CommonVideoDto();
commonVideoDto.setUrl(url); commonVideoDto.setUrl(url);
commonVideoDto.setKey(channelNo); commonVideoDto.setKey(channelNo.getKey());
commonVideoDto.setType(CommonVideoEnum.getEnum(cylinderUnitVideo.getProtocol()).getName()); commonVideoDto.setType(CommonVideoEnum.getEnum(cylinderUnitVideo.getProtocol()).getName());
commonVideoDto.setTitle(cylinderUnitVideo.getTitle()); commonVideoDto.setTitle(channelNo.getTitle());
commonVideoDto.setThumb(channelNo.getThumb());
result.add(commonVideoDto); result.add(commonVideoDto);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment