| | |
| | | |
| | | /** 成功 */ |
| | | public static final int SUCCESS = Constants.SUCCESS; |
| | | /** |
| | | * token失效 |
| | | */ |
| | | public static final int TOKEN_ERROR = Constants.TOKEN_ERROR; |
| | | public static final int GIVE_ERROR = Constants.GIVE_ERROR; |
| | | public static final int VALUE_ERROR = Constants.VALUE_ERROR; |
| | | |
| | | /** 失败 */ |
| | | public static final int FAIL = Constants.FAIL; |
| | |
| | | return restResult(null, SUCCESS, null); |
| | | } |
| | | |
| | | public static <T> R<T> tokenError(String msg) |
| | | { |
| | | return restResult(null, TOKEN_ERROR, msg); |
| | | } |
| | | public static <T> R<T> giveError(String msg) |
| | | { |
| | | return restResult(null, GIVE_ERROR, msg); |
| | | } |
| | | public static <T> R<T> energyValueError(String msg) |
| | | { |
| | | return restResult(null, VALUE_ERROR, msg); |
| | | } |
| | | public static <T> R<T> ok(T data) |
| | | { |
| | | return restResult(data, SUCCESS, null); |