package com.hai.order.type;

import java.util.Objects;

public enum PlatformType {
    TYPE1(1, "嗨森逛"),
    TYPE2(2, "黔印象"),
            ;

    private Integer number;

    private String name;

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

    /**
     * 根据类型查询数据
     * @param type
     * @return
     */
    public static PlatformType getDataByType(Integer type) {
        for (PlatformType 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;
    }
}
