package com.sckw.payment.model.constant;

import java.util.Objects;

/**
 * 钱包退款枚举类
 * 1-申请退款 2-退款中 3-退款失败 4-退款驳回
 * @author xucaiqin
 * @date 2023-07-11 12:00:52
 */
public enum RefundEnum {
    APPLY(1, "申请退款", "1"),
    REFUNDING(2, "退款中", "2"),
    FAILED(3, "退款失败", "3"),
    BACK(4, "退款驳回", "4"),
    SUCCESS(5,"退款成功","5");

    private final int status;
    private final String desc;
    private final String label;

    RefundEnum(int status, String desc, String label) {
        this.status = status;
        this.label = label;
        this.desc = desc;
    }

    public static String getDesc(Integer status) {
        if (Objects.isNull(status)) {
            return "";
        }
        for (RefundEnum value : values()) {
            if (status == value.getStatus()) {
                return value.getDesc();
            }
        }
        return "";
    }

    public String getLabel() {
        return label;
    }

    public int getStatus() {
        return status;
    }


    public String getDesc() {
        return desc;
    }

}
