package com.hfkj.sysenum.order;

import lombok.Getter;

import java.util.Objects;

/**
 * 交易支付渠道
 * @className: OrderPayModelEnum
 * @author: HuRui
 * @date: 2024/5/7
 **/
@Getter
public enum OrderPayChannelEnum {
    /**
     * 惠支付
     */
    type1(1, "惠支付"),
    /**
     * 微信合作商
     */
    type2(2, "微信合作商"),
    /**
     * 贵州银行
     */
    type3(3, "贵州银行"),
    /**
     * 汇联通
     */
    type4(4, "汇联通"),
    ;

    private final int code;

    private final String name;

    OrderPayChannelEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public static OrderPayChannelEnum getData(Integer type) {
        for (OrderPayChannelEnum ele : values()) {
            if (Objects.equals(type,ele.getCode())) return ele;
        }
        return null;
    }
}
