package com.ylx.order.enums;

import lombok.Getter;

@Getter
public enum PaymentMethodEnum {

    BALANCE(0, "余额支付"),
    THIRD_PARTY(1, "第三方支付");


    private final Integer code;
    private final String info;

    PaymentMethodEnum(Integer code, String info) {
        this.code = code;
        this.info = info;
    }
    public static String getNameByCode(Integer code) {
        if (code == null) {
            return "";
        }
        for (PaymentMethodEnum method : values()) {
            if (method.code.equals(code)) {
                return method.info;
            }
        }
        return "";
    }
}
