Sfoglia il codice sorgente

Merge branch 'dev' of http://101.36.160.140:21044/depot-qinghai/depot-monitor-qinghai into dev

ZeroLiYi 1 anno fa
parent
commit
70cc9112b5

+ 10 - 0
pom.xml

@@ -222,6 +222,16 @@
222 222
             <plugin>
223 223
                 <groupId>org.springframework.boot</groupId>
224 224
                 <artifactId>spring-boot-maven-plugin</artifactId>
225
+                <configuration>
226
+                    <includeSystemScope>true</includeSystemScope>
227
+                </configuration>
228
+                <executions>
229
+                    <execution>
230
+                        <goals>
231
+                            <goal>repackage</goal>
232
+                        </goals>
233
+                    </execution>
234
+                </executions>
225 235
             </plugin>
226 236
 
227 237
             <plugin>

+ 7 - 0
src/main/java/com/chinaitop/depot/hk/constant/ApiHkConstant.java

@@ -49,6 +49,13 @@ public interface ApiHkConstant {
49 49
      * @date: 2024/6/20
50 50
      **/
51 51
     String API_HK_RECORD_STOP = "/artemis/api/video/v1/manualRecord/stop";
52
+    /**
53
+     * 手动抓图
54
+     *
55
+     * @author: ybw
56
+     * @date: 2024/6/20
57
+     **/
58
+    String API_HK_MANUAL_CAPTURE = "/artemis/api/video/v1/manualCapture";
52 59
 
53 60
 
54 61
     /**

+ 24 - 0
src/main/java/com/chinaitop/depot/hk/dto/req/CaptureReqDTO.java

@@ -0,0 +1,24 @@
1
+package com.chinaitop.depot.hk.dto.req;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+
6
+/**
7
+ * 手动抓图
8
+ *
9
+ * @author ybw
10
+ * @version V1.0
11
+ * @className CaptureReqDTO
12
+ * @date 2024/6/22
13
+ **/
14
+@Data
15
+@AllArgsConstructor
16
+public class CaptureReqDTO {
17
+    /**
18
+     * 监控点编号
19
+     *
20
+     * @author: ybw
21
+     * @date: 2024/6/19
22
+     **/
23
+    private String cameraIndexCode;
24
+}

+ 24 - 0
src/main/java/com/chinaitop/depot/hk/dto/res/CaptureResDTO.java

@@ -0,0 +1,24 @@
1
+package com.chinaitop.depot.hk.dto.res;
2
+
3
+import lombok.AllArgsConstructor;
4
+import lombok.Data;
5
+
6
+/**
7
+ * 手动抓图
8
+ *
9
+ * @author ybw
10
+ * @version V1.0
11
+ * @className CaptureReqDTO
12
+ * @date 2024/6/22
13
+ **/
14
+@Data
15
+@AllArgsConstructor
16
+public class CaptureResDTO {
17
+    /**
18
+     * 图片 url 信息
19
+     *
20
+     * @author: ybw
21
+     * @date: 2024/6/19
22
+     **/
23
+    private String picUrl;
24
+}

+ 12 - 0
src/main/java/com/chinaitop/depot/hk/service/HkService.java

@@ -83,4 +83,16 @@ public interface HkService {
83 83
      * @date: 2024/6/20
84 84
      **/
85 85
     void recordStop(RecordStopReqDTO recordStopReqDTO);
86
+
87
+
88
+    /**
89
+     * 手动抓图
90
+     *
91
+     * @param captureReqDTO
92
+     * @methodName: manualCapture
93
+     * @return: com.ybw.dto.res.CaptureResDTO
94
+     * @author: ybw
95
+     * @date: 2024/6/20
96
+     **/
97
+    CaptureResDTO manualCapture(CaptureReqDTO captureReqDTO);
86 98
 }

+ 23 - 2
src/main/java/com/chinaitop/depot/hk/service/impl/HkServiceImpl.java

@@ -146,7 +146,7 @@ public class HkServiceImpl implements HkService {
146 146
                 return resultResDTO.getData();
147 147
             }
148 148
         } catch (Exception e) {
149
-            log.error("previewURLs error:", e);
149
+            log.error("recordStart error:", e);
150 150
         }
151 151
         return null;
152 152
     }
@@ -164,7 +164,28 @@ public class HkServiceImpl implements HkService {
164 164
             );
165 165
             log.info("{}", JSON.toJSONString(resultResDTO));
166 166
         } catch (Exception e) {
167
-            log.error("previewURLs error:", e);
167
+            log.error("recordStop error:", e);
168 168
         }
169 169
     }
170
+
171
+    @Override
172
+    public CaptureResDTO manualCapture(CaptureReqDTO captureReqDTO) {
173
+        try {
174
+            // 接口地址
175
+            Map<String, String> path = getPath(ApiHkConstant.API_HK_MANUAL_CAPTURE);
176
+            String result = ArtemisHttpUtil.doPostStringArtemis(artemisConfig, path, JSON.toJSONString(captureReqDTO), null, null, "application/json");
177
+            ResultResDTO<CaptureResDTO> resultResDTO = JSONObject.parseObject(
178
+                    result,
179
+                    new TypeReference<ResultResDTO<CaptureResDTO>>() {
180
+                    }
181
+            );
182
+            log.info("{}", JSON.toJSONString(resultResDTO));
183
+            if (ApiHkConstant.Code.SUCCESS.equals(resultResDTO.getCode())) {
184
+                return resultResDTO.getData();
185
+            }
186
+        } catch (Exception e) {
187
+            log.error("manualCapture error:", e);
188
+        }
189
+        return null;
190
+    }
170 191
 }

+ 73 - 0
src/main/java/com/chinaitop/depot/monitor/controller/PreviewPlaybackController.java

@@ -0,0 +1,73 @@
1
+package com.chinaitop.depot.monitor.controller;
2
+
3
+import com.chinaitop.depot.hk.dto.req.PlaybackReqDTO;
4
+import com.chinaitop.depot.hk.dto.req.PreviewReqDTO;
5
+import com.chinaitop.depot.hk.dto.res.PlaybackResDTO;
6
+import com.chinaitop.depot.hk.dto.res.PreviewResDTO;
7
+import com.chinaitop.depot.hk.service.HkService;
8
+import io.swagger.annotations.Api;
9
+import io.swagger.annotations.ApiImplicitParam;
10
+import io.swagger.annotations.ApiImplicitParams;
11
+import io.swagger.annotations.ApiOperation;
12
+import org.springframework.http.MediaType;
13
+import org.springframework.web.bind.annotation.RequestBody;
14
+import org.springframework.web.bind.annotation.RequestMapping;
15
+import org.springframework.web.bind.annotation.RequestMethod;
16
+import org.springframework.web.bind.annotation.RestController;
17
+
18
+import javax.annotation.Resource;
19
+
20
+/**
21
+ * 视频预览回放
22
+ */
23
+@RestController
24
+@RequestMapping(value = "/previewPlayback")
25
+@Api(description = "预览回放")
26
+public class PreviewPlaybackController {
27
+
28
+    @Resource
29
+    private HkService hkService;
30
+
31
+    
32
+    /**
33
+     * 摄像头预览
34
+     * @param previewReqDTO
35
+     * @return
36
+     */
37
+    @RequestMapping(value="/getPreview", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
38
+    @ApiOperation(value="预览", notes = "预览")
39
+    @ApiImplicitParams({
40
+            @ApiImplicitParam(name = "{cameraIndexCode}", value = "监控点编号", paramType = "query")
41
+    })
42
+    public PreviewResDTO getAlarmPhone(PreviewReqDTO previewReqDTO) {
43
+        return hkService.previewURLs(previewReqDTO);
44
+    }
45
+    
46
+    
47
+    /**
48
+     * 摄像头回放
49
+     * @param playbackReqDTO
50
+     * @return
51
+     */
52
+    @RequestMapping(value="/getPlayback", produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET)
53
+    @ApiOperation(value="回放", notes = "回放")
54
+    /*@ApiImplicitParams({
55
+            @ApiImplicitParam(name = "cameraIndexCode", value = "监控点唯一标识,分页获取监控点资源接口获取返回参数", paramType = "query"),
56
+            @ApiImplicitParam(name = "recordLocation", value = "存储类型, 0:中心存储, 1:设备存储 (默认为中心存储)", paramType = "query"),
57
+            @ApiImplicitParam(name = "protocol", value = "取流协议", paramType = "query"),
58
+            @ApiImplicitParam(name = "transmode", value = "传输协议,默认为TCP", paramType = "query"),
59
+            @ApiImplicitParam(name = "beginTime", value = "开始时间,ISO8601格式", paramType = "query"),
60
+            @ApiImplicitParam(name = "endTime", value = "结束时间,与开始时间相差不超过三天,ISO8601格式", paramType = "query"),
61
+            @ApiImplicitParam(name = "uuid", value = "分页查询id,用于继续查询剩余片段,默认为空字符串 (设备存储生效)", paramType = "query"),
62
+            @ApiImplicitParam(name = "uuid", value = "分页查询id,用于继续查询剩余片段,默认为空字符串 (设备存储生效)", paramType = "query"),
63
+            @ApiImplicitParam(name = "expand", value = "扩展内容,支持指定解码格式等,格式:key=value,多个以&隔开", paramType = "query"),
64
+            @ApiImplicitParam(name = "streamform", value = "输出码流转封装格式,默认为RTP ,ps", paramType = "query"),
65
+            @ApiImplicitParam(name = "lockType", value = "查询录像的锁定类型,默认查询全部录像 0  1未锁定 2锁定", paramType = "query")
66
+
67
+    })*/
68
+    public PlaybackResDTO getPlayback(PlaybackReqDTO playbackReqDTO) {
69
+        return hkService.playbackURLs(playbackReqDTO);
70
+    }
71
+
72
+    
73
+}