package com.fuyuanshen.equipment.enums;

/**
 * @author: 默苍璃
 * @date: 2025-06-1818:17
 */
public enum BindingStatusEnum {
    UNBOUND(0, "未绑定"), BOUND(1, "已绑定");

    private final int code;
    private final String description;

    BindingStatusEnum(int code, String description) {
        this.code = code;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static BindingStatusEnum fromCode(int code) {
        for (BindingStatusEnum status : values()) {
            if (status.getCode() == code) {
                return status;
            }
        }
        throw new IllegalArgumentException("Invalid binding status code: " + code);
    }

}