TRX před 1 rokem
rodič
revize
3af6db003e

+ 19 - 0
src/main/java/com/github/microservice/utils/exception/BusinessException.java

@@ -0,0 +1,19 @@
+package com.github.microservice.utils.exception;
+
+/**
+ * 统一业务异常
+ */
+public class BusinessException extends RuntimeException{
+
+    public BusinessException(){}
+
+    public BusinessException(String message)
+    {
+        super(message);
+    }
+
+    public BusinessException(String message, Throwable throwable)
+    {
+        super(message,throwable);
+    }
+}

+ 19 - 0
src/main/java/com/github/microservice/utils/exception/ServiceException.java

@@ -0,0 +1,19 @@
+package com.github.microservice.utils.exception;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.Setter;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.ResponseStatus;
+
+@Setter
+@Getter
+@AllArgsConstructor
+@ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR) //, reason = ""
+public class ServiceException extends RuntimeException{
+
+	private static final long serialVersionUID = 552192089988571466L;
+
+	private String message;
+
+}