package com.ruoyi.ss.transactionBill.domain.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * 订单设备充值状态
 * @author wjh
 * 2024/4/17
 */
@AllArgsConstructor
@Getter
public enum TransactionBillDeviceRechargeStatus {
    UN_RECHARGE("0", "未充值"),
    SUCCESS("1", "充值成功"),
    FAIL("2", "充值失败"),
    BLUETOOTH("3", "蓝牙充值");


    private final String status;
    private final String msg;

    public static TransactionBillDeviceRechargeStatus parse(String status) {
        for (TransactionBillDeviceRechargeStatus obj : TransactionBillDeviceRechargeStatus.values()) {
            if (Objects.equals(obj.getStatus(), status)) {
                return obj;
            }
        }
        throw new RuntimeException("不存在值为" + status + "的设备充值状态");
    }
}
