package com.hfkj.sysenum;

import java.util.Objects;

/**
 * 用户类型
 * @author hurui
 */

public enum SecUserTypeEnum {

    type0(0, "超级管理员"),
    type1(1, "公司"),
    type2(2, "代理商"),
    type3(3, "业务员"),
    type4(4, "商户"),
    type5(5, "门店"),
    ;

    private Integer number;

    private String name;

    SecUserTypeEnum(int number, String name) {
        this.number = number;
        this.name = name;
    }

    public static SecUserTypeEnum getNameByType(Integer type) {
        for (SecUserTypeEnum ele : values()) {
            if (Objects.equals(type,ele.getNumber())) {
                return ele;
            }
        }
        return null;
    }

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
