package com.cmvr.test.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum FlowiseActionEnum {
    // ===== 说话 =====
    SPEAK("speak", "tts说话"),

    // ===== 表情控制 =====
    SMILE("smile", "高兴"),
    SURPRISED("surprised", "惊讶"),
    SAD("sad", "悲伤"),
    TIRED("tired", "疲惫"),

    // ===== 动作=====
    AC_ON("ac_on", "打开空调"),
    AC_OFF("ac_off", "关闭空调"),
    MUSIC_ON("music_on", "打开音乐"),
    MUSIC_OFF("music_off", "关闭音乐"),
    DRIVE_MODE_ECONOMY("drive_mode_economy", "设置驾驶模式为节能模式"),
    DRIVE_MODE_COMFORT("drive_mode_comfort", "设置驾驶模式为舒适模式"),
    HELLO("hello", "打招呼");

    private final String action;
    private final String description;


    // 根据 action 字符串反查枚举
    public static FlowiseActionEnum fromAction(String action) {
        for (FlowiseActionEnum e : values()) {
            if (e.action.equalsIgnoreCase(action)) {
                return e;
            }
        }
        throw new IllegalArgumentException("未实现的 flowise action: " + action);
    }
}
