package com.yupi.project.model.enums;

import lombok.Getter;

/**
 * 机器人状态枚举
 */
@Getter
public enum RobotStatusEnum {

    IDLE("IDLE", "空闲"),
    MOVING("MOVING", "移动中"),
    CHARGING("CHARGING", "充电服务中"),
    ERROR("ERROR", "故障"),
    MAINTENANCE("MAINTENANCE", "维护中"),
    OFFLINE("OFFLINE", "离线");

    private final String value;
    private final String description;

    RobotStatusEnum(String value, String description) {
        this.value = value;
        this.description = description;
    }

    /**
     * 根据 value 获取枚举
     *
     * @param value
     * @return
     */
    public static RobotStatusEnum getEnumByValue(String value) {
        if (value == null) {
            return null;
        }
        for (RobotStatusEnum anEnum : RobotStatusEnum.values()) {
            if (anEnum.value.equals(value)) {
                return anEnum;
            }
        }
        return null;
    }
} 