package com.ywt.mg.domain.models.enums;

public enum OrderPayTypeEnum {

    UNKNOWN(0, "未知支付渠道"),
    WECHAT(1, "微信支付"),
    @Deprecated
    WALLET(2, "钱包支付"),
    F2F(3, "现场支付"),
    COIN(4, "微信+金币");
    String displayName;
    int value;

    OrderPayTypeEnum(int value, String displayName) {
        this.displayName = displayName;
        this.value = value;
    }

    public String getDisplayName() {
        return displayName;
    }

    public int getValue() {
        return value;
    }

    public static OrderPayTypeEnum valueOf(int value) {
        for (OrderPayTypeEnum typeEnum : OrderPayTypeEnum.values()) {
            // v3.0.5 移除钱包支付，新增金币支付
            if (value == WALLET.value) return UNKNOWN;
            if (typeEnum.value == value) {
                return typeEnum;
            }
        }
        return UNKNOWN;
    }
}
