From b6e604f2449bb65dfaafb0f0741ba54ff0d2f9c2 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期二, 30 四月 2024 15:20:03 +0800
Subject: [PATCH] 修改云端录像详情页使用直接访问zlm的方式播放录像
---
src/main/java/com/genersoft/iot/vmp/vmanager/log/LogController.java | 47 ++++++++++++++++++++++++++++-------------------
1 files changed, 28 insertions(+), 19 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/vmanager/log/LogController.java b/src/main/java/com/genersoft/iot/vmp/vmanager/log/LogController.java
old mode 100644
new mode 100755
index 42efbb1..59a6943
--- a/src/main/java/com/genersoft/iot/vmp/vmanager/log/LogController.java
+++ b/src/main/java/com/genersoft/iot/vmp/vmanager/log/LogController.java
@@ -2,29 +2,25 @@
import com.genersoft.iot.vmp.conf.UserSetting;
import com.genersoft.iot.vmp.conf.exception.ControllerException;
+import com.genersoft.iot.vmp.conf.redis.RedisRpcConfig;
+import com.genersoft.iot.vmp.conf.security.JwtUtils;
import com.genersoft.iot.vmp.service.ILogService;
import com.genersoft.iot.vmp.storager.dao.dto.LogDto;
import com.genersoft.iot.vmp.utils.DateUtil;
import com.genersoft.iot.vmp.vmanager.bean.ErrorCode;
-import com.genersoft.iot.vmp.vmanager.bean.WVPResult;
import com.github.pagehelper.PageInfo;
-
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
import org.springframework.util.ObjectUtils;
-import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
-import java.text.ParseException;
-
@Tag(name = "鏃ュ織绠$悊")
-@CrossOrigin
+
@RestController
@RequestMapping("/api/log")
public class LogController {
@@ -49,7 +45,7 @@
* @return
*/
@GetMapping("/all")
- @Operation(summary = "鍒嗛〉鏌ヨ鎶ヨ")
+ @Operation(summary = "鍒嗛〉鏌ヨ鏃ュ織", security = @SecurityRequirement(name = JwtUtils.HEADER))
@Parameter(name = "query", description = "鏌ヨ鍐呭", required = true)
@Parameter(name = "page", description = "褰撳墠椤�", required = true)
@Parameter(name = "count", description = "姣忛〉鏌ヨ鏁伴噺", required = true)
@@ -67,18 +63,21 @@
if (ObjectUtils.isEmpty(query)) {
query = null;
}
- if (ObjectUtils.isEmpty(startTime)) {
- startTime = null;
- }
- if (ObjectUtils.isEmpty(endTime)) {
- endTime = null;
- }
- if (!userSetting.getLogInDatebase()) {
+
+ if (!userSetting.getLogInDatabase()) {
logger.warn("鑷姩璁板綍鏃ュ織鍔熻兘宸插叧闂紝鏌ヨ缁撴灉鍙兘涓嶅畬鏁淬��");
}
- if (!DateUtil.verification(startTime, DateUtil.formatter) || !DateUtil.verification(endTime, DateUtil.formatter)){
- throw new ControllerException(ErrorCode.ERROR400);
+ if (ObjectUtils.isEmpty(startTime)) {
+ startTime = null;
+ }else if (!DateUtil.verification(startTime, DateUtil.formatter) ){
+ throw new ControllerException(ErrorCode.ERROR400.getCode(), "startTime鏍煎紡涓�" + DateUtil.PATTERN);
+ }
+
+ if (ObjectUtils.isEmpty(endTime)) {
+ endTime = null;
+ }else if (!DateUtil.verification(endTime, DateUtil.formatter) ){
+ throw new ControllerException(ErrorCode.ERROR400.getCode(), "endTime鏍煎紡涓�" + DateUtil.PATTERN);
}
return logService.getAll(page, count, query, type, startTime, endTime);
@@ -88,10 +87,20 @@
* 娓呯┖鏃ュ織
*
*/
- @Operation(summary = "鍋滄瑙嗛鍥炴斁")
+ @Operation(summary = "娓呯┖鏃ュ織", security = @SecurityRequirement(name = JwtUtils.HEADER))
@DeleteMapping("/clear")
public void clear() {
logService.clear();
}
+ @Autowired
+ private RedisRpcConfig redisRpcConfig;
+
+ @GetMapping("/test/count")
+ public Object count() {
+ return redisRpcConfig.getCallbackCount();
+ }
+
+
+
}
--
Gitblit v1.8.0