|
|
@@ -0,0 +1,110 @@
|
|
|
+package com.shkpr.service.mcpcenterservice.dto;
|
|
|
+
|
|
|
+public enum ResponseCode {
|
|
|
+ RESULT_NORMAL(0, "Normal result."),
|
|
|
+ RESULT_BAD(1, "Bad result,see the message/data for reason."),
|
|
|
+
|
|
|
+ STATUS_SUCCESS(200, "Success"),
|
|
|
+ STATUS_BAD_REQUEST(600, "Bad Request,see the message/data for reason."),
|
|
|
+ STATUS_ACCESS_DENY(603, "Access denied."),
|
|
|
+ STATUS_NOT_FOUND_URI(604, "No mapping found for HTTP request with URI."),
|
|
|
+ STATUS_METHOD_NOT_ALLOWED(605, "Method Not Allowed."),
|
|
|
+ STATUS_HTTP_TYPE_NOT_ACCEPTABLE(606, "Http media type not acceptable."),
|
|
|
+ STATUS_HTTP_TYPE_NOT_SUPPORTED(615, "Http media type not supported."),
|
|
|
+ STATUS_INTERNAL_SERVER_ERROR(700, "Internal Server Error."),
|
|
|
+ STATUS_SERVER_RUN_ERROR(1000,"The server is abnormal."),
|
|
|
+ STATUS_NULL_POINT_EXCEPTION(1001, "Empty param or param is null."),
|
|
|
+ STATUS_ERROR_DATA_TYPE(1002, "The data type is wrong."),
|
|
|
+ STATUS_IO_EXCEPTION(1003, "IO exception."),
|
|
|
+ STATUS_NO_SUCH_METHOD(1004, "No such method."),
|
|
|
+ STATUS_INDEX_OUT_OF_BOUNDS(1005, "Index out of bounds."),
|
|
|
+ STATUS_ERROR_JSON_FORMAT(1006, "Error JSON data format."),
|
|
|
+ STATUS_NOT_POST_REQUEST(1007, "Not post request."),
|
|
|
+ STATUS_NOT_DELETE_REQUEST(1008, "Not delete request."),
|
|
|
+ STATUS_ERROR_PARAM_FORMAT(1009, "Error parameter format."),
|
|
|
+ STATUS_INVALID_CONTENT_TYPE(1010, "Error Content-Type."),
|
|
|
+ STATUS_NOT_MATCHED_URI(1011, "No mapping found for HTTP request with URI."),
|
|
|
+ STATUS_ERROR_REQUEST_METHOD(1012, "Error request method."),
|
|
|
+ STATUS_NO_USER_ACCOUNT(1013, "No such user or has not login."),
|
|
|
+ STATUS_SERVER_NET_DISCONN_OR_BUSY(1014, "The network of server is down or busy. Please try again later."),
|
|
|
+ STATUS_MAX_CONCURRENT_REQUEST_COUNT(1015, "Exceeded the maximum number of concurrent requests. Please try again later."),
|
|
|
+ STATUS_INVALID_HEADER(1016, "Invalid headers, please check the headers of request."),
|
|
|
+ STATUS_INVALID_SIGN(1017, "Illegal signature, please check and request again."),
|
|
|
+
|
|
|
+ STATUS_EMPTY_TOKEN(2000,"Empty token."),
|
|
|
+ STATUS_INVALID_TOKEN(2001, "Invalidate Token, please re-login."),
|
|
|
+ STATUS_EXPIRED_TOKEN(2002, "Expired Token, please re-login."),
|
|
|
+ STATUS_NOT_LOGGED_IN(2003, "Not logged in."),
|
|
|
+ STATUS_DENY_OPERATE_USER(2004, "No permission to operate."),
|
|
|
+ STATUS_TOO_OLD_TOKEN(2005, "The token is too old, please use your new token."),
|
|
|
+ STATUS_INVALID_OLD_PWD(2006, "The original password is wrong."),
|
|
|
+ STATUS_INVALID_KEY(2007, "Invalidate Key"),
|
|
|
+ STATUS_INVALID_NAME(2008, "Invalidate Name"),
|
|
|
+
|
|
|
+
|
|
|
+ RESULT_ERROR_SIGN(3000, "Illegal signature"),
|
|
|
+ RESULT_REPEAT_SEQUENCE(3001, "Repeat the request, please check the request sequence number."),
|
|
|
+ RESULT_REQUEST_TIMEOUT(3002, "Request timed out."),
|
|
|
+ RESULT_REQUEST_TOO_BUSY(3003, "Request too busy, please try again later."),
|
|
|
+ RESULT_REPEAT_RECORDS(3004, "Repeat the records, please check the request."),
|
|
|
+ RESULT_REFERENCE_RECORDS(3005, "Reference the records, please check the request."),
|
|
|
+ RESULT_REFERENCE_NOT_EXIST(3006, "Reference the not exist, please check the request."),
|
|
|
+ RESULT_INVALID_MULTI_TYPE_BIND(3007, "Multi type binding, please check the request."),
|
|
|
+ RESULT_ILLEGAL_LOGIN(3998, "Illegal login."),
|
|
|
+ RESULT_ACCOUNT_LOCKED(3999, "Account has been locked, please try again later."),
|
|
|
+
|
|
|
+ RESULT_INVALID_ORDER(4000, "The order number is inconsistent."),//错误或不合法的工单号
|
|
|
+ RESULT_DUPLICATE_ORDER(4001,"The order is already exists."), //指定工单已存在
|
|
|
+ RESULT_ORDER_ACCEPTED(4002, "The order is already accepted."),//指定工单已被接收
|
|
|
+ RESULT_ORDER_DEALED(4003, "The order is already deal."),//指定工单已被处理
|
|
|
+ RESULT_ORDER_ODD_STATUS(4004, "The order status is incorrect.No permission to operation."),//指定工单状态错误,暂无权限做次操作
|
|
|
+ RESULT_ORDER_OWN_CHANGED(4005, "The owner of order is changed.No permission to operation."),//指定工单归属已变更,暂无限操作
|
|
|
+
|
|
|
+ RESULT_USER_ALREADY_REG(8000, "This phone is already registered."),
|
|
|
+ RESULT_DENY_FOR_SAME_PASS(8001, "Two passwords cannot be the same."),
|
|
|
+ RESULT_REFRESH_TOKEN_FAILED(8002, "Refresh token failed, please login again."),
|
|
|
+ RESULT_TOKEN_INVALID_SIGN(8003, "Refresh token failed, invalid signature"),
|
|
|
+ RESULT_INVALID_USER_INFO(8004, "User information verification failed."),
|
|
|
+ RESULT_EXISTS_USER_NAME(8005, "Username already exists."),
|
|
|
+ RESULT_USER_NOT_REG(8006, "This phone is not registered."),
|
|
|
+ RESULT_INNER_JS_SERVER_AUTH_FAILED(8007, "Inner js service verify failed."),
|
|
|
+
|
|
|
+ RESULT_SERVER_NET_DISCONN_OR_BUSY(9000, "The network of server is down or busy. Please try again later."),
|
|
|
+
|
|
|
+ RESULT_INVALID_PUSH_TASK(9100, "The push task is inconsistent."),
|
|
|
+ RESULT_PUSH_TASK_CLOSE(9101, "The push task will be closed."),
|
|
|
+ RESULT_PUSH_TASK_RETRY(9102, "The push task will be next push in the queue."),
|
|
|
+ RESULT_PUSH_FAILED_ERROR_RECEIVER(9103, "Push task failed because of error receiver."),
|
|
|
+ RESULT_PUSH_FAILED_ERROR_OTHERS(9104, "Push task failed because of other errors."),
|
|
|
+ RESULT_PUSH_FAILED_NO_WAY(9105, "Push task failed because of no support the push way."),
|
|
|
+
|
|
|
+ RESULT_FILE_INVALID_TYPE(10000, "Illegal file type."),
|
|
|
+ RESULT_FILE_RW_FILED(10001, "File read/write error."),
|
|
|
+ RESULT_FILE_SIZE_EXCEED(10002, "File size limit exceeded."),
|
|
|
+ RESULT_FILE_PARSE_FAILED(10003, "File parse failed."),
|
|
|
+ RESULT_FILE_EMPTY_ROWS(10004, "File is empty rows."),
|
|
|
+ RESULT_FILE_DATA_INVALID(10005, "File Data is invalid format."),
|
|
|
+
|
|
|
+ BUSINESS_DB_REQ_FAILED(65530,"The DB operation failed."),
|
|
|
+ BUSINESS_API_ABOLISH(65531,"The Api has been abolished."),
|
|
|
+ BUSINESS_BUSY(65532,"Business is busy, please try again."),
|
|
|
+ SERVICE_OFFLINE(65533, "Service offline, please check the license"),
|
|
|
+ STATUS_UNKNOWN(65534,"Unknown reason,see the message/data for reason."),
|
|
|
+ RESULT_UNKNOWN(65535,"Unknown reason,see the message/data for reason.");
|
|
|
+
|
|
|
+ private String name;
|
|
|
+ private int index;
|
|
|
+ private ResponseCode(int indexC, String strN){
|
|
|
+ index = indexC;
|
|
|
+ name = strN;
|
|
|
+ }
|
|
|
+
|
|
|
+ public int toInt() {return index;}
|
|
|
+ public String toStrCode() {return String.valueOf(index);}
|
|
|
+ public String toStrMsg() {return name;}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String toString() {
|
|
|
+ return "StatusCode: " + index + " Message: " + name;
|
|
|
+ }
|
|
|
+}
|