| | |
| | | |
| | | /** 成功 */ |
| | | public static final int SUCCESS = Constants.SUCCESS; |
| | | public static final int VIPERROR = Constants.VIP_ERROR; |
| | | |
| | | /** 失败 */ |
| | | public static final int FAIL = Constants.FAIL; |
| | | /** 积分商城兑换失败 */ |
| | | public static final int EXCHANGECODE = Constants.EXCHANGECODE; |
| | | /** |
| | | * 账号被冻结 |
| | | */ |
| | | public static final int FREEZE = Constants.FREEZE; |
| | | /** |
| | | * 短信验证码无效 |
| | | */ |
| | | public static final int ERRORCODE = Constants.ERRORCODE; |
| | | /** |
| | | * 登陆失效 |
| | | */ |
| | |
| | | { |
| | | return restResult(data, SUCCESS, null); |
| | | } |
| | | public static <T> R<T> vipError(String msg) |
| | | { |
| | | return restResult(null, VIPERROR, msg); |
| | | } |
| | | |
| | | public static <T> R<T> ok(T data, String msg) |
| | | { |
| | |
| | | return restResult(null, FAIL, msg); |
| | | } |
| | | |
| | | /** |
| | | * 商城兑换失败code |
| | | * @param msg |
| | | * @return |
| | | * @param <T> |
| | | */ |
| | | public static <T> R<T> exchangeError(String msg) |
| | | { |
| | | return restResult(null, EXCHANGECODE, msg); |
| | | } |
| | | public static <T> R<T> freeze(String msg) |
| | | { |
| | | return restResult(null, FREEZE, msg); |
| | | } |
| | | public static <T> R<T> errorCode(String msg) |
| | | { |
| | | return restResult(null, ERRORCODE, msg); |
| | | } |
| | | public static <T> R<T> errCode(String msg) |
| | | { |
| | | return restResult(null, FREEZE, msg); |
| | | } |
| | | |
| | | public static <T> R<T> fail(T data) |
| | | { |
| | | return restResult(data, FAIL, null); |