package com.jsowell.common.enums.lianlian;

/**
 * 站点 支付方式
 *
 * @author JS-ZZA
 * @date 2023/5/16 9:17
 */
public enum StationPaymentEnum {
    CARD_PAYMENT("0", "刷卡"),
    ONLINE_PAYMENT("1", "线上"),
    CASH_PAYMENT("2", "现金"),
    ;

    private String code;
    private String value;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    StationPaymentEnum(String code, String value) {
        this.code = code;
        this.value = value;
    }

    public static String getPaymentByCode(String code) {
        for (StationPaymentEnum paymentEnum : StationPaymentEnum.values()) {
            if (paymentEnum.getValue().equals(code)) {
                return paymentEnum.getValue();
            }
        }
        return "";
    }
}
