package com.sckw.payment.model.constant;

import java.util.Objects;

/**
 * 预付操作枚举
 *
 * @author xucaiqin
 * @date 2023-07-11 12:00:52
 */
public enum PrePayEnum {
    ADD(1, "新增预付", "新增预付"),
    APPEND(2, "预付追加", "预付追加");

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

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

    public String getLabel() {
        return label;
    }

    public int getStatus() {
        return status;
    }

    public String getDesc() {
        return desc;
    }

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

}
