package com.jsowell.common.enums.uniapp;

/**
 * 占桩订单支付状态enum
 *
 * @author Lemon
 * @Date 2023/8/18 9:49
 */
public enum OccupyOrderPayStatusEnum {
    UN_PAY("0", "未支付"),
    PAYMENT_COMPLETION("1", "支付完成"),
    NO_PAYMENT_REQUIRED("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;
    }

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

    /**
     * 根据code获取value
     * @param code
     * @return
     */
    public static String getValueByCode(String code) {
        for (OccupyOrderPayStatusEnum item : OccupyOrderPayStatusEnum.values()) {
            if (item.getCode().equals(code)) {
                return item.getValue();
            }
        }
        return null;
    }
}
