@ -47,6 +47,11 @@ public class ResponseResult<T> implements Serializable {
@@ -47,6 +47,11 @@ public class ResponseResult<T> implements Serializable {
return restResult ( data , HttpEnum . OK_200 . code ( ) , msg ) ;
}
/ * *
* 系统内部错误
* @return // 返回
* @param < T > // 泛型
* /
public static < T > ResponseResult < T > failed ( ) {
return restResult ( null , HttpEnum . ERROR_500 . code ( ) ,
HttpEnum . ERROR_500 . desc ( ) ) ;
@ -69,6 +74,40 @@ public class ResponseResult<T> implements Serializable {
@@ -69,6 +74,40 @@ public class ResponseResult<T> implements Serializable {
return restResult ( data , HttpEnum . ERROR_500 . code ( ) , msg ) ;
}
/ * *
* 支付错误
* @param data // 支付对象
* @return // 返回值
* @param < T > // 泛型
* /
public static < T > ResponseResult < T > notplay ( T data ) {
return restResult ( data , HttpEnum . ERROR_700 . code ( ) , HttpEnum . ERROR_700 . desc ( ) ) ;
}
public static < T > ResponseResult < T > notplay ( T data , String msg ) {
return restResult ( data , HttpEnum . ERROR_700 . code ( ) , msg ) ;
}
public static < T > ResponseResult < T > notplay ( int code , String msg ) {
return restResult ( null , code , msg ) ;
}
public static < T > ResponseResult < T > notplay ( String msg ) {
return restResult ( null , HttpEnum . ERROR_700 . code ( ) , msg ) ;
}
public static < T > ResponseResult < T > notplay ( ) {
return restResult ( null , HttpEnum . ERROR_700 . code ( ) , HttpEnum . ERROR_700 . desc ( ) ) ;
}
/ * *
* 构造器
* @param data // 数据对象
* @param code // 数据状态
* @param msg // 数据提示内容
* @return // 返回
* @param < T > // 泛型
* /
private static < T > ResponseResult < T > restResult ( T data , int code ,
String msg ) {
ResponseResult < T > apiResult = new ResponseResult < > ( ) ;