mirror of
https://github.com/JeffLi1993/springboot-learning-example.git
synced 2026-03-15 07:03:49 +08:00
Spring Boot HTTP over JSON 的错误码异常处理
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package org.spring.springboot.result.base;
|
||||
package org.spring.springboot.result;
|
||||
|
||||
/**
|
||||
* 错误码接口
|
||||
@@ -1,8 +1,8 @@
|
||||
package org.spring.springboot.result;
|
||||
|
||||
import org.spring.springboot.result.base.ErrorInfoInterface;
|
||||
|
||||
/**
|
||||
* 统一错误码异常
|
||||
*
|
||||
* Created by bysocket on 14/03/2017.
|
||||
*/
|
||||
public class GlobalErrorInfoException extends Exception {
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package org.spring.springboot.result;
|
||||
|
||||
import org.spring.springboot.result.base.ErrorInfoInterface;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 统一错误码异常处理
|
||||
*
|
||||
* Created by bysocket on 14/03/2017.
|
||||
*/
|
||||
@RestControllerAdvice
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package org.spring.springboot.result;
|
||||
|
||||
import org.spring.springboot.result.base.ErrorInfoInterface;
|
||||
|
||||
/**
|
||||
* 返回体
|
||||
*
|
||||
* Created by bysocket on 14/03/2017.
|
||||
*/
|
||||
public class ResultBody<T> {
|
||||
|
||||
Reference in New Issue
Block a user