67 lines
2.6 KiB
Java
67 lines
2.6 KiB
Java
|
|
package com.zhgd.xmgl.call;
|
||
|
|
|
||
|
|
import com.alibaba.fastjson.JSONArray;
|
||
|
|
import com.alibaba.fastjson.JSONObject;
|
||
|
|
import com.zhgd.xmgl.modules.project.entity.Project;
|
||
|
|
import com.zhgd.xmgl.modules.video.mapper.VideoItemMapper;
|
||
|
|
import com.zhgd.xmgl.modules.xz.mapper.XzHikvisionVideoOnlineMapper;
|
||
|
|
import com.zhgd.xmgl.util.HikvisionUtil;
|
||
|
|
import lombok.extern.slf4j.Slf4j;
|
||
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
|
import org.springframework.context.annotation.Lazy;
|
||
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||
|
|
import org.springframework.web.bind.annotation.RestController;
|
||
|
|
|
||
|
|
@Slf4j
|
||
|
|
@RestController
|
||
|
|
@RequestMapping("/xmgl/hikvisionVideo")
|
||
|
|
public class HikvisionVideoCall {
|
||
|
|
@Lazy
|
||
|
|
@Autowired
|
||
|
|
HikvisionVideoCall hikvisionVideoCall;
|
||
|
|
@Lazy
|
||
|
|
@Autowired
|
||
|
|
VideoItemMapper videoItemMapper;
|
||
|
|
|
||
|
|
@Lazy
|
||
|
|
@Autowired
|
||
|
|
XzHikvisionVideoOnlineMapper xzHikvisionVideoOnlineMapper;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 获取监控点在线状态
|
||
|
|
*
|
||
|
|
* @param project
|
||
|
|
*/
|
||
|
|
public JSONObject getCameraOnlineForHttp(Project project, JSONObject requestParam) throws Exception {
|
||
|
|
final String ARTEMIS_PATH = "/artemis";
|
||
|
|
final String path = ARTEMIS_PATH + "/api/nms/v1/online/camera/get";
|
||
|
|
String host = "https://" + project.getArtemisConfigHost();
|
||
|
|
String rs = HikvisionUtil.doPost(host, path, JSONArray.toJSONString(requestParam), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret());
|
||
|
|
return JSONObject.parseObject(rs);
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 获取视频质量诊断结果
|
||
|
|
*/
|
||
|
|
public JSONObject getVqdForHikvisionForHttp(Project project, JSONObject requestParam) throws Exception {
|
||
|
|
final String ARTEMIS_PATH = "/artemis";
|
||
|
|
final String path = ARTEMIS_PATH + "/api/nms/v1/vqd/list";
|
||
|
|
String host = "https://" + project.getArtemisConfigHost();
|
||
|
|
String rs = HikvisionUtil.doPost(host, path, JSONArray.toJSONString(requestParam), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret());
|
||
|
|
return JSONObject.parseObject(rs);
|
||
|
|
}
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 根据监控点列表查询录像完整性结果
|
||
|
|
*/
|
||
|
|
public JSONObject getNmsRecordForHikvisionForHttp(Project project, JSONObject requestParam) throws Exception {
|
||
|
|
final String ARTEMIS_PATH = "/artemis";
|
||
|
|
final String path = ARTEMIS_PATH + "/api/nms/v1/record/list";
|
||
|
|
String host = "https://" + project.getArtemisConfigHost();
|
||
|
|
String rs = HikvisionUtil.doPost(host, path, JSONArray.toJSONString(requestParam), null, project.getArtemisConfigAppKey(), project.getArtemisConfigAppSecret());
|
||
|
|
return JSONObject.parseObject(rs);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|