package cn.com.qmth.stmms.common.enums;

/**
 * 用户来源
 */
public enum UserSource {

    INTERNAL("内部用户", 1), EXTERNAL("外部用户", 2);

    private String name;

    private int value;

    private UserSource(String name, int value) {
        this.name = name;
        this.value = value;
    }

    public String getName() {
        return name;
    }

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

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public static UserSource findByValue(int value) {
        for (UserSource c : UserSource.values()) {
            if (c.getValue() == value) {
                return c;
            }
        }
        return null;
    }

}
