| | |
| | | } |
| | | |
| | | public static Re ok() { |
| | | return parse("0-操作成功"); |
| | | return parse("0-response.operation_success"); |
| | | } |
| | | |
| | | public static Re ok(String msg) { |
| | |
| | | } |
| | | |
| | | public static Re ok(Object obj) { |
| | | return parse("0-操作成功").add(obj); |
| | | return parse("0-response.operation_success").add(obj); |
| | | } |
| | | |
| | | public static Re error() { |
| | | return parse("1-服务器错误"); |
| | | return parse("1-response.server_exception"); |
| | | } |
| | | |
| | | public static Re error(String msg) { |
| | |
| | | |
| | | public static Re parse(String message) { |
| | | if (Cools.isEmpty(message)) { |
| | | return parse("1-服务器错误"); |
| | | return parse("1-response.server_exception"); |
| | | } else { |
| | | String[] msg = message.split("-"); |
| | | return msg.length == 2 ? new Re(Integer.parseInt(msg[0]), msg[1]) : parse("1-".concat(message)); |