/**
 * 文件名：ErrorCode.java
 * 描述：错误处理
 * 包名：cn.com.kmlt.monstarBase.utils.errcode
 * 作者：WENJQ
 * 创建日期：2016年05月26日
 * 
 */
package com.mgq.base.utils.errcode;


/**
 * 错误处理
 * 
 * @author WENJQ
 */
public class ErrorCode {
	public static final int SUCCESS = 1;
	public static final int UNKNOWN_ERROR = 2;

	private static final int CAN_NOT_EMPTY = 6;
	private static final int PASSWORD_ERROR = 7;


	private static final int ACCOUNT_EXIST = 15;

	private static final int ACCOUNT_NOT_EXIST = 19;

	private static final int IDENTIFY_CODE_CANNOT_NULL = 50;
	private static final int IDENTIFY_CODE_ERROR = 51;
	public static final int NETWORK_ERROR = -1;
	
	private static final int NETWORK_LINK_ERROR = -98;
	
	public static final int HTTPCONN_TIMEOUT = -99;
	

	public static String getErrorCode(String error_code) {
		try {
			int i = Integer.valueOf(error_code);
			switch (i) {
			case SUCCESS:

				return "成功";
			case UNKNOWN_ERROR:

				return "未知错误";

			case CAN_NOT_EMPTY:

				return "不能为空";

			case PASSWORD_ERROR:

				return "密码错误";

			case ACCOUNT_EXIST:

				return "账号已经存在";

			case ACCOUNT_NOT_EXIST:

				return "账号不存在";


			case IDENTIFY_CODE_CANNOT_NULL:

				return "验证码不能为空";

			case IDENTIFY_CODE_ERROR:

				return "验证码错误";

				
			case NETWORK_LINK_ERROR:
				return "抱歉,网络连接错误,请重新登录后再操作";	
				

				
			case HTTPCONN_TIMEOUT:
			    return "服务器连接超时";

			case 99:
			    return "重复操作";
			default:
				return "未知错误";
			}
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return "未知错误";
	}

}
