package com.ssyf.module.robot.domain.strategy;

/**
 * 聊天策略类型枚举
 * 定义支持的聊天策略类型
 */
public enum ChatStrategyType {
    
    /**
     * AI聊天策略
     */
    AI("AI", "AI聊天策略"),
    
    /**
     * 模板聊天策略
     */
    TEMPLATE("TEMPLATE", "模板聊天策略");
    
    private final String code;
    private final String description;
    
    ChatStrategyType(String code, String description) {
        this.code = code;
        this.description = description;
    }
    
    public String getCode() {
        return code;
    }
    
    public String getDescription() {
        return description;
    }
    
    /**
     * 根据code获取枚举
     */
    public static ChatStrategyType getByCode(String code) {
        for (ChatStrategyType type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        return null;
    }
    
    /**
     * 检查code是否有效
     */
    public static boolean isValid(String code) {
        return getByCode(code) != null;
    }
}