package com.fuyuanshen.equipment.enums;

import com.fasterxml.jackson.annotation.JsonValue;

/**
 * 通讯方式枚举
 *
 * @author: 默苍璃
 * @date: 2025-06-2414:11
 */
public enum CommunicationModeEnum {

    FOUR_G(0, "4G"),
    BLUETOOTH(1, "蓝牙");

    private final int value;
    private final String label;

    CommunicationModeEnum(int value, String label) {
        this.value = value;
        this.label = label;
    }

    @JsonValue
    public int getValue() {
        return value;
    }

    public String getLabel() {
        return label;
    }

    /**
     * 根据值获取标签
     */
    public static String getLabelByValue(int value) {
        for (CommunicationModeEnum mode : values()) {
            if (mode.getValue() == value) {
                return mode.getLabel();
            }
        }
        return null;
    }

}