package com.hfkj.sysenum.merchant;

import lombok.Getter;

import java.util.Objects;

/**
 * @className: MerchantChainBrandSettleTypeEnum
 * @author: HuRui
 * @date: 2024/8/14
 **/
@Getter
public enum MerchantChainBrandSettleTypeEnum {
    /**
     * 连锁额度
     */
    type1(1, "连锁额度"),
    /**
     * 商户额度
     */
    type2(2, "商户额度"),
    ;

    private Integer number;

    private String name;

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

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

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

}
