|
|
@@ -0,0 +1,65 @@
|
|
|
+package cn.iocoder.yudao.module.pms.hikvision;
|
|
|
+
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
+import cn.iocoder.yudao.module.pms.hikvision.vo.MonitorPointsPageReqVO;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
+import com.hikvision.artemis.sdk.ArtemisHttpUtil;
|
|
|
+import com.hikvision.artemis.sdk.config.ArtemisConfig;
|
|
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
|
+import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
|
+import org.springframework.web.bind.annotation.GetMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+@Tag(name = "管理后台 - hikvision 实时视频 录像相关接口")
|
|
|
+@RequestMapping("/vms")
|
|
|
+@RestController
|
|
|
+@Validated
|
|
|
+public class HikvisionController {
|
|
|
+
|
|
|
+ @Value("${hikvision.appKey}")
|
|
|
+ private String appKey;
|
|
|
+
|
|
|
+ @Value("${hikvision.appSecret}")
|
|
|
+ private String appSecret;
|
|
|
+
|
|
|
+ @Value("${hikvision.host}")
|
|
|
+ private String host;
|
|
|
+
|
|
|
+ @Value("${hikvision.artemisPath}")
|
|
|
+ private String artemisPath;
|
|
|
+
|
|
|
+ @Value("${hikvision.monitorPoints}")
|
|
|
+ private String monitorPoints;
|
|
|
+
|
|
|
+ @GetMapping("/monitorPoints")
|
|
|
+ @Operation(summary = "查询监控点列表v2")
|
|
|
+ public String monitorPoints(MonitorPointsPageReqVO pageReqVO) {
|
|
|
+ ArtemisConfig config = new ArtemisConfig();
|
|
|
+ config.setHost(host); // 代理API网关nginx服务器ip端口
|
|
|
+ config.setAppKey(appKey); // 秘钥appkey
|
|
|
+ config.setAppSecret(appSecret);// 秘钥appSecret
|
|
|
+ Map<String, String> paramMap = new HashMap<String, String>();// post请求Form表单参数
|
|
|
+ paramMap.put("pageNo", pageReqVO.getPageNo().toString());
|
|
|
+ paramMap.put("pageSize", pageReqVO.getPageSize().toString());
|
|
|
+ String body = JSON.toJSON(paramMap).toString();
|
|
|
+ Map<String, String> path = new HashMap<String, String>(2) {
|
|
|
+ {
|
|
|
+ put("https://", monitorPoints);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ String result = StrUtil.EMPTY;
|
|
|
+ try {
|
|
|
+ result = ArtemisHttpUtil.doPostStringArtemis(config, path, body, null, null, "application/json");
|
|
|
+ } catch (Exception e) {
|
|
|
+ result = "接口异常";
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+}
|