Browse Source

1.版本号控制

heqinwei 7 years ago
parent
commit
9c897e2d05
2 changed files with 53 additions and 53 deletions
  1. 1 1
      pom.xml
  2. 52 52
      src/main/java/com/config/exception/GlobalException.java

+ 1 - 1
pom.xml

@@ -6,7 +6,7 @@
 
   <groupId>BI</groupId>
   <artifactId>BI</artifactId>
-  <version>1.0.1-SNAPSHOT</version>
+  <version>1.0.2-SNAPSHOT</version>
   <packaging>war</packaging>
 
   <name>BI Maven Webapp</name>

+ 52 - 52
src/main/java/com/config/exception/GlobalException.java

@@ -1,52 +1,52 @@
-//package com.config.exception;
-//
-//import com.auth0.jwt.exceptions.InvalidClaimException;
-//import org.apache.ibatis.binding.BindingException;
-//import org.springframework.web.bind.annotation.ControllerAdvice;
-//import org.springframework.web.bind.annotation.ExceptionHandler;
-//import org.springframework.web.bind.annotation.ResponseBody;
-//
-//import javax.management.OperationsException;
-//import java.util.HashMap;
-//import java.util.Map;
-//
-//@ControllerAdvice
-//public class GlobalException {
-//    @ExceptionHandler(RuntimeException.class)
-//    @ResponseBody
-//    public Map<String, Object> exceptionHandle(){
-//        Map<String, Object> result = new HashMap<String, Object>();
-//        result.put("code" , "-502");
-//        result.put("msg" , "服务器异常");
-//        return result;
-//    }
-//
-//    @ExceptionHandler(OperationsException.class)
-//    @ResponseBody
-//    public Map<String, Object> operationsException(){
-//        Map<String, Object> result = new HashMap<String, Object>();
-//        result.put("code" , "-503");
-//        result.put("msg", "权限不足");
-//        return result;
-//    }
-//
-//
-//    @ExceptionHandler(BindingException.class)
-//    @ResponseBody
-//    public Map<String, Object> BindingException(){
-//        Map<String, Object> result = new HashMap<String, Object>();
-//        result.put("code" , "-504");
-//        result.put("msg" , "数据为空");
-//        return result;
-//    }
-//
-//    @ExceptionHandler(InvalidClaimException.class)
-//    @ResponseBody
-//    public Map<String, Object> InvalidClaimException(){
-//        Map<String, Object> result = new HashMap<String, Object>();
-//        result.put("code" , "-505");
-//        result.put("msg" , "token过期");
-//        return result;
-//    }
-//
-//}
+package com.config.exception;
+
+import com.auth0.jwt.exceptions.InvalidClaimException;
+import org.apache.ibatis.binding.BindingException;
+import org.springframework.web.bind.annotation.ControllerAdvice;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.management.OperationsException;
+import java.util.HashMap;
+import java.util.Map;
+
+@ControllerAdvice
+public class GlobalException {
+    @ExceptionHandler(RuntimeException.class)
+    @ResponseBody
+    public Map<String, Object> exceptionHandle(){
+        Map<String, Object> result = new HashMap<String, Object>();
+        result.put("code" , "-502");
+        result.put("msg" , "服务器异常");
+        return result;
+    }
+
+    @ExceptionHandler(OperationsException.class)
+    @ResponseBody
+    public Map<String, Object> operationsException(){
+        Map<String, Object> result = new HashMap<String, Object>();
+        result.put("code" , "-503");
+        result.put("msg", "权限不足");
+        return result;
+    }
+
+
+    @ExceptionHandler(BindingException.class)
+    @ResponseBody
+    public Map<String, Object> BindingException(){
+        Map<String, Object> result = new HashMap<String, Object>();
+        result.put("code" , "-504");
+        result.put("msg" , "数据为空");
+        return result;
+    }
+
+    @ExceptionHandler(InvalidClaimException.class)
+    @ResponseBody
+    public Map<String, Object> InvalidClaimException(){
+        Map<String, Object> result = new HashMap<String, Object>();
+        result.put("code" , "-505");
+        result.put("msg" , "token过期");
+        return result;
+    }
+
+}