package com.hai.enum_type;

import java.util.Objects;

/**
 * 门店来源
 * @author hurui
 */
public enum MerchantStoreSourceType {
    type1(1, "平台自建", "自建站"),
    type2(2, "团油门店", "团油"),
    type3(3, "加好油", "重庆壳牌"),
    type4(4, "金猪加油", "金猪加油"),
    type5(5, "paylo", "四川壳牌"),
    ;

    private Integer number;

    private String name;

    private String desc;

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

    public static String getNameByType(Integer type) {
        for (MerchantStoreSourceType ele : values()) {
            if(Objects.equals(type,ele.getNumber())) return ele.getName();
        }
        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;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
