From 8ef5e2618d6fed0bbfea1aca99ca010b1e041718 Mon Sep 17 00:00:00 2001
From: wangjunyi <junyi.wang@hiscene.com>
Date: 星期四, 27 四月 2023 17:39:45 +0800
Subject: [PATCH] 解决国标设备-通道-设备录像处的视频下载问题

---
 src/main/java/com/genersoft/iot/vmp/conf/GlobalExceptionHandler.java |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/conf/GlobalExceptionHandler.java b/src/main/java/com/genersoft/iot/vmp/conf/GlobalExceptionHandler.java
index 728afb9..0333e0d 100644
--- a/src/main/java/com/genersoft/iot/vmp/conf/GlobalExceptionHandler.java
+++ b/src/main/java/com/genersoft/iot/vmp/conf/GlobalExceptionHandler.java
@@ -8,6 +8,7 @@
 import org.springframework.http.HttpStatus;
 import org.springframework.http.ResponseEntity;
 import org.springframework.security.authentication.BadCredentialsException;
+import org.springframework.web.HttpRequestMethodNotSupportedException;
 import org.springframework.web.bind.annotation.ExceptionHandler;
 import org.springframework.web.bind.annotation.ResponseStatus;
 import org.springframework.web.bind.annotation.RestControllerAdvice;
@@ -32,6 +33,28 @@
         return WVPResult.fail(ErrorCode.ERROR500.getCode(), e.getMessage());
     }
 
+    /**
+     * 榛樿寮傚父澶勭悊
+     * @param e 寮傚父
+     * @return 缁熶竴杩斿洖缁撴灉
+     */
+    @ExceptionHandler(IllegalStateException.class)
+    @ResponseStatus(HttpStatus.BAD_REQUEST)
+    public WVPResult<String> exceptionHandler(IllegalStateException e) {
+        return WVPResult.fail(ErrorCode.ERROR400);
+    }
+
+    /**
+     * 榛樿寮傚父澶勭悊
+     * @param e 寮傚父
+     * @return 缁熶竴杩斿洖缁撴灉
+     */
+    @ExceptionHandler(HttpRequestMethodNotSupportedException.class)
+    @ResponseStatus(HttpStatus.BAD_REQUEST)
+    public WVPResult<String> exceptionHandler(HttpRequestMethodNotSupportedException e) {
+        return WVPResult.fail(ErrorCode.ERROR400);
+    }
+
 
     /**
      * 鑷畾涔夊紓甯稿鐞嗭紝 澶勭悊controller涓繑鍥炵殑閿欒

--
Gitblit v1.8.0