增加付费片单,修复种子列表搜索排序

Change-Id: Ib645906c0f240f954676790daf2ff0e5f16f6e0a
diff --git a/src/main/java/com/example/myproject/config/GlobalExceptionHandler.java b/src/main/java/com/example/myproject/config/GlobalExceptionHandler.java
new file mode 100644
index 0000000..abcd055
--- /dev/null
+++ b/src/main/java/com/example/myproject/config/GlobalExceptionHandler.java
@@ -0,0 +1,29 @@
+package com.example.myproject.config;
+
+import cn.dev33.satoken.exception.NotLoginException;
+import cn.dev33.satoken.exception.NotPermissionException;
+import cn.dev33.satoken.exception.NotRoleException;
+import com.example.myproject.common.base.Result;
+import com.example.myproject.exception.BusinessException;
+import org.springframework.web.bind.annotation.ControllerAdvice;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.RestControllerAdvice;
+
+@RestControllerAdvice
+public class GlobalExceptionHandler {
+
+    @ExceptionHandler(BusinessException.class)
+    public Result handleException(BusinessException e) {
+        // 这里可以根据不同的异常类型返回不同的结果
+        return Result.error(e.getMessage());
+    }
+
+    @ExceptionHandler(value = {NotLoginException.class})
+    public Result unLoginHandler(){
+        return Result.error(401, "您还未登录");
+    }
+    @ExceptionHandler(value = {NotRoleException.class, NotPermissionException.class})
+    public Result handlerException() {
+        return Result.error(403, "您没有权限");
+    }
+}