package com.org.hktshop.utils;


/**
 * Ajax 请求时的自定义查询状态码，主要参考Http状态码，但并不完全对应
 */
public enum HttpCode {
	OK(200, "请求成功"),
	BAD_REQUEST(201, "请求参数出错"),
	MULTI_STATUS(207, "频繁操作"),
	LOGIN_FAIL(303, "登录失败"),
	LEVEL_FAIL(304, "层级错误"),
	MAIL_OR_CODE_ERROR(305, "邮箱或验证码错误"),
	MAIL_FORMATE_CHECK_ERROR(306, "邮箱格式错误"),
	UNAUTHORIZED(401, "登录已过期,请重新登录"),
	FORBIDDEN(403, "没有权限"),
	NOT_FOUND(404, "找不到页面"),
	REQUEST_TIMEOUT(408, "请求超时"),
	CONFLICT(409, "发生冲突"),
	YIDI_LOGIN(412, "你已經在其它地方登陸"),
	LOGIN_OUT_TIME(424, "用户登录失效"),
	REQUEST_UNDEFINE(425, "请求来源未知"),
	USER_ALREADY_LOGIN(427,"用户已经登录"),
	USER_User_ISlOGIN_OUT(426,"用户已经登出"),
	NAME_REPEAT(431, "用户名重复"),
	USER_STATUS_ERROR(432, "用户没有权限登录"),
	USER_NOT_EXISTS(433, "用户不存在"),
	USERNAME_ERROR(436, "用户名密码错误"),
	IDENTITY_CODE_ERROR(437,"验证码错误"),
	MOBILE_REGISTER_ERROR(438,"手机已经被注册"),
	MOBILE_NOT_REGISTER_ERROR(439,"手机尚未注册"),
	MOBILE_NOT_EXIST_ERROR(440,"手机号码不存在"),
	QUERY_INPUT_CHECKED_CONTROL(496, "输入异常,請檢查輸入的正確性"),
	QUERY_IP_DISABLE_CONTROL(497, "當前IP異常，請稍後再試"),
	QUERY_ERROR_CONTROL(498, "登陸已失效,請重新登陸"),
	/** 500服务器出错 */
	INTERNAL_SERVER_ERROR(500, "服务器出错");

	private final Integer code;
	private final String msg;
	
	HttpCode(Integer code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	public Integer getCode() {
		return code;
	}

	public String getMsg() {
		return msg;
	}
}
