package com.hfkj.sysenum.merchant;

import lombok.Getter;

import java.util.Objects;

/**
 * @className: MerchantStatusEnum
 * @author: HuRui
 * @date: 2024/6/11
 **/
@Getter
public enum MerchantSourceTypeEnum {
    /**
     * 自建站
     */
    type1(1, "自建站"),
    /**
     * 能链【团油】
     */
    type2(2, "能链【团油】"),
    /**
     * 加好油【重庆壳牌】
     */
    type3(3, "加好油【重庆壳牌】"),
    /**
     * 能链2【团油】
     */
    type4(4, "能链2【团油】"),
    ;

    private Integer number;

    private String name;

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

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

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

}
