package com.buy507.mall.model;

/**
 * 分销会员等级
 * @author yeyun
 *
 */
public enum MemberLevel {
	/**普通用户**/
	Member(1),
	/**vip会员**/
	Consumer(2),
	/**店长**/
	Partner(3),
	/**代理**/
	Diamond(4),
	/** 市代 **/
	OneDiamond(5),

	TwoDiamond(6), //中级合作商
	ThreeDiamond(7), //高级合作商
	FourDiamond(8); //特级合作商
	
	private int value;
	
	private MemberLevel(int value) {
		this.value = value;
	}
	
	public int getValue() {
		return value;
	}
	
	public static MemberLevel getMemberByInt(int value){
		for (MemberLevel memberLevel : MemberLevel.values()) {
			if(value == memberLevel.value){
				return memberLevel;
			}
		}
		return null;
	}
}
