package com.hfkj.sysenum.order;

import lombok.Getter;

import java.util.Objects;

/**
 * 交易支付类型
 * @className: OrderPayModelEnum
 * @author: HuRui
 * @date: 2024/5/7
 **/
@Getter
public enum OrderPayTypeEnum {
    /**
     * 微信
     */
    type1(1, "微信"),
    /**
     * 支付宝
     */
    type2(2, "支付宝"),
    /**
     * 快捷支付
     */
    type3(3, "快捷支付"),
    /**
     * 工会卡
     */
    type4(4, "工会卡"),
    ;

    private final int code;

    private final String name;

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

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