Przeglądaj źródła

feat 项目标识新增和查询接口 fix 开心中文报名新增国家id字段

classic_blue 4 dni temu
rodzic
commit
83178b2ad2

+ 42 - 42
edu-travel-service/edu-travel-service-education/src/main/java/edu/travel/education/exception/GlobalExceptionHandler.java

@@ -1,42 +1,42 @@
-//package edu.travel.education.exception;
-//
-//import edu.travel.emun.ResponseCode;
-//import edu.travel.exception.BaseException;
-//import edu.travel.resp.BaseResponse;
-//import edu.travel.resp.PageResponse;
-//import lombok.extern.slf4j.Slf4j;
-//import org.springframework.web.bind.annotation.ExceptionHandler;
-//import org.springframework.web.bind.annotation.RestControllerAdvice;
-//
-///**
-// * GlobalExceptionHandler 类。
-// * <p>
-// * 描述:
-// *
-// * @author huangwenwen
-// * @date 2025/2/11
-// */
-//
-//@RestControllerAdvice
-//@Slf4j
-//public class GlobalExceptionHandler {
-//
-//    @ExceptionHandler(BaseException.class)
-//    public BaseResponse<Object> handleUserInfoException(BaseException e){
-//        e.printStackTrace();
-//        return  PageResponse.out(e.getCode(),e.getMessage(),null);
-//    }
-//
-//    @ExceptionHandler(IllegalArgumentException.class)
-//    public BaseResponse<Object> handleException(IllegalArgumentException e){
-//        e.printStackTrace();
-//        return PageResponse.out(ResponseCode.LOGIC_ERROR.getCode(), e.getMessage(),null);
-//    }
-//
-//    @ExceptionHandler(Throwable.class)
-//    public BaseResponse<Object> handleException(Exception e){
-//        e.printStackTrace();
-//        return PageResponse.out(ResponseCode.ERROR.getCode(),e.getMessage(),null);
-//    }
-//
-//}
+package edu.travel.education.exception;
+
+import edu.travel.emun.ResponseCode;
+import edu.travel.exception.BaseException;
+import edu.travel.resp.BaseResponse;
+import edu.travel.resp.PageResponse;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+
+/**
+ * GlobalExceptionHandler 类。
+ * <p>
+ * 描述:
+ *
+ * @author huangwenwen
+ * @date 2025/2/11
+ */
+
+@RestControllerAdvice
+@Slf4j
+public class GlobalExceptionHandler {
+
+    @ExceptionHandler(BaseException.class)
+    public BaseResponse<Object> handleUserInfoException(BaseException e){
+        e.printStackTrace();
+        return  PageResponse.out(e.getCode(),e.getMessage(),null);
+    }
+
+    @ExceptionHandler(IllegalArgumentException.class)
+    public BaseResponse<Object> handleException(IllegalArgumentException e){
+        e.printStackTrace();
+        return PageResponse.out(ResponseCode.LOGIC_ERROR.getCode(), e.getMessage(),null);
+    }
+
+    @ExceptionHandler(Throwable.class)
+    public BaseResponse<Object> handleException(Exception e){
+        e.printStackTrace();
+        return PageResponse.out(ResponseCode.ERROR.getCode(),e.getMessage(),null);
+    }
+
+}